| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent dc12a25 commit 9b483fb
32 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -157,7 +157,9 @@ Returns a function that tests its | |||
| 157 | 157 | supplied argument, suitable for use with `Array.filter`. Example: | |
| 158 | 158 | ||
| 159 | 159 | ```javascript | |
| 160 | - var javascripts = fileList.filter(minimatch.filter('*.js', { matchBase: true })) | ||
| 160 | + var javascripts = fileList.filter( | ||
| 161 | + minimatch.filter('*.js', { matchBase: true }), | ||
| 162 | + ) | ||
| 161 | 163 | ``` | |
| 162 | 164 | ||
| 163 | 165 | ### minimatch.escape(pattern, options = {}) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,26 +1,76 @@ | |||
| 1 | 1 | import { AST } from './ast.js'; | |
| 2 | 2 | export type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd'; | |
| 3 | 3 | export interface MinimatchOptions { | |
| 4 | + /** do not expand `{x,y}` style braces */ | ||
| 4 | 5 | nobrace?: boolean; | |
| 6 | + /** do not treat patterns starting with `#` as a comment */ | ||
| 5 | 7 | nocomment?: boolean; | |
| 8 | + /** do not treat patterns starting with `!` as a negation */ | ||
| 6 | 9 | nonegate?: boolean; | |
| 10 | + /** print LOTS of debugging output */ | ||
| 7 | 11 | debug?: boolean; | |
| 12 | + /** treat `**` the same as `*` */ | ||
| 8 | 13 | noglobstar?: boolean; | |
| 14 | + /** do not expand extglobs like `+(a|b)` */ | ||
| 9 | 15 | noext?: boolean; | |
| 16 | + /** return the pattern if nothing matches */ | ||
| 10 | 17 | nonull?: boolean; | |
| 18 | + /** treat `\\` as a path separator, not an escape character */ | ||
| 11 | 19 | windowsPathsNoEscape?: boolean; | |
| 20 | + /** | ||
| 21 | + * inverse of {@link MinimatchOptions.windowsPathsNoEscape} | ||
| 22 | + * @deprecated | ||
| 23 | + */ | ||
| 12 | 24 | allowWindowsEscape?: boolean; | |
| 25 | + /** | ||
| 26 | + * Compare a partial path to a pattern. As long as the parts | ||
| 27 | + * of the path that are present are not contradicted by the | ||
| 28 | + * pattern, it will be treated as a match. This is useful in | ||
| 29 | + * applications where you're walking through a folder structure, | ||
| 30 | + * and don't yet have the full path, but want to ensure that you | ||
| 31 | + * do not walk down paths that can never be a match. | ||
| 32 | + */ | ||
| 13 | 33 | partial?: boolean; | |
| 34 | + /** allow matches that start with `.` even if the pattern does not */ | ||
| 14 | 35 | dot?: boolean; | |
| 36 | + /** ignore case */ | ||
| 15 | 37 | nocase?: boolean; | |
| 38 | + /** ignore case only in wildcard patterns */ | ||
| 16 | 39 | nocaseMagicOnly?: boolean; | |
| 40 | + /** consider braces to be "magic" for the purpose of `hasMagic` */ | ||
| 17 | 41 | magicalBraces?: boolean; | |
| 42 | + /** | ||
| 43 | + * If set, then patterns without slashes will be matched | ||
| 44 | + * against the basename of the path if it contains slashes. | ||
| 45 | + * For example, `a?b` would match the path `/xyz/123/acb`, but | ||
| 46 | + * not `/xyz/acb/123`. | ||
| 47 | + */ | ||
| 18 | 48 | matchBase?: boolean; | |
| 49 | + /** invert the results of negated matches */ | ||
| 19 | 50 | flipNegate?: boolean; | |
| 51 | + /** do not collapse multiple `/` into a single `/` */ | ||
| 20 | 52 | preserveMultipleSlashes?: boolean; | |
| 53 | + /** | ||
| 54 | + * A number indicating the level of optimization that should be done | ||
| 55 | + * to the pattern prior to parsing and using it for matches. | ||
| 56 | + */ | ||
| 21 | 57 | optimizationLevel?: number; | |
| 58 | + /** operating system platform */ | ||
| 22 | 59 | platform?: Platform; | |
| 60 | + /** | ||
| 61 | + * When a pattern starts with a UNC path or drive letter, and in | ||
| 62 | + * `nocase:true` mode, do not convert the root portions of the | ||
| 63 | + * pattern into a case-insensitive regular expression, and instead | ||
| 64 | + * leave them as strings. | ||
| 65 | + * | ||
| 66 | + * This is the default when the platform is `win32` and | ||
| 67 | + * `nocase:true` is set. | ||
| 68 | + */ | ||
| 23 | 69 | windowsNoMagicRoot?: boolean; | |
| 70 | + /** | ||
| 71 | + * max number of `{...}` patterns to expand. Default 100_000. | ||
| 72 | + */ | ||
| 73 | + braceExpandMax?: number; | ||
| 24 | 74 | } | |
| 25 | 75 | export declare const minimatch: { | |
| 26 | 76 | (p: string, pattern: string, options?: MinimatchOptions): boolean; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments