File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,8 @@ export const isFile = async (path: string): Promise<boolean> => {
163
163
164
164
export const multiLinePatternMatch = (
165
165
content : string ,
166
- pattern : string
166
+ pattern : string ,
167
+ offset = 0
167
168
) : { start ?: number ; end ?: number ; matched : boolean } => {
168
169
const matched = content . includes ( pattern ) ;
169
170
@@ -174,7 +175,7 @@ export const multiLinePatternMatch = (
174
175
const contentLines = content . split ( / \r ? \n / ) ;
175
176
const patternLines = pattern . split ( / \r ? \n / ) ;
176
177
177
- for ( let i = 0 ; i < contentLines . length ; i += 1 ) {
178
+ for ( let i = offset ; i < contentLines . length ; i += 1 ) {
178
179
if ( contentLines [ i ] === patternLines [ 0 ] ) {
179
180
const contentGroup = contentLines
180
181
. slice ( i , i + patternLines . length )
You can’t perform that action at this time.
0 commit comments