fast-find-in-files
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -22,10 +22,7 @@ export interface QueryHit { | ||
/** | ||
* Relative folder paths to exclude from the search. | ||
* | ||
* Requirements: | ||
* - Must not end with `/` | ||
* Relative folder paths or RegExp paths to exclude from the search. | ||
*/ | ||
excludeFolderPaths?: string[]; | ||
excludeFolderPaths?: (string | RegExp)[]; | ||
} | ||
declare function fastFindInFiles(options: FastFindInFilesOptions): FastFindInFiles[]; | ||
export { fastFindInFiles }; |
@@ -24,3 +24,6 @@ "use strict"; | ||
} | ||
options.excludeFolderPaths.forEach((excludeFolderPath) => { | ||
options.excludeFolderPaths = options.excludeFolderPaths.map((excludeFolderPath) => { | ||
if (excludeFolderPath instanceof RegExp) { | ||
return excludeFolderPath.source; | ||
} | ||
if (typeof excludeFolderPath !== 'string' || excludeFolderPath.length === 0) { | ||
@@ -32,2 +35,3 @@ throw new TypeError('Invalid input: options.excludeFolderPaths.excludeFolderPath must be nonempty string'); | ||
} | ||
return `^${excludeFolderPath}$`; | ||
}); | ||
@@ -34,0 +38,0 @@ } |
{ | ||
"name": "fast-find-in-files", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "fast-find-in-files recursively searches sub-directories for needle matches", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
46520
67