Skip to content

parseGlob

parseGlob(pattern, dialect?, limits?): GlobPattern

Defined in: packages/format-glob/src/parse-glob.ts:22

Parses pattern under dialect, within limits.

Constructs the dialect does not define are parsed as literal text rather than rejected, so a pattern written for a different tool degrades to an exact match instead of throwing. Outgrowing a bound is the one thing that does throw: past that point the cost has stopped being the author’s.

O(pattern length), except that the brace-expansion check walks the parsed tree once more.

string

GlobDialect = "posix"

GlobLimits

GlobPattern

If the pattern is longer than GlobLimits.maxPatternLength, nests braces or extglobs deeper than their bounds, or expands to more than GlobLimits.maxBraceProduct alternatives.