{"_id":"glob-to-regex.js","_rev":"5-b3b4fb0c09556f1db2657374830c334c","name":"glob-to-regex.js","dist-tags":{"latest":"1.3.1"},"versions":{"1.0.1":{"name":"glob-to-regex.js","version":"1.0.1","keywords":["glob","regex","regexp","pattern","matcher","path","filesystem","wildcard"],"author":{"url":"https://github.com/streamich","name":"streamich"},"license":"Apache-2.0","_id":"glob-to-regex.js@1.0.1","maintainers":[{"name":"streamich","email":"vadimsdaleckis@gmail.com"}],"homepage":"https://github.com/streamich/glob-to-regex","bugs":{"url":"https://github.com/streamich/glob-to-regex/issues"},"dist":{"shasum":"f71cc9cb8441471a9318626160bc8a35e1306b21","tarball":"https://registry.npmjs.org/glob-to-regex.js/-/glob-to-regex.js-1.0.1.tgz","fileCount":4,"integrity":"sha512-CG/iEvgQqfzoVsMUbxSJcwbG2JwyZ3naEqPkeltwl0BSS8Bp83k3xlGms+0QdWFUAwV+uvo80wNswKF6FWEkKg==","signatures":[{"sig":"MEQCIGh/D2XcALiLWI9oW6ClNB3xKei8GdsY2wF+TE95pW7nAiBYo6i2f68pV7daQYSVCUTlTxBUw5tMl2/2hPkaOfWl7g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11378},"main":"lib/index.js","types":"lib/index.d.ts","engines":{"node":">=10.0"},"funding":{"url":"https://github.com/sponsors/streamich","type":"github"},"gitHead":"d1522da4c68c3818a20bd9dde3eaf07c88285b3e","scripts":{"lint":"biome lint ./src","test":"vitest ./src","build":"tsc --project tsconfig.build.json --module commonjs --target es2020 --outDir lib","clean":"npx rimraf@6.0.1 lib typedocs coverage gh-pages yarn-error.log","format":"biome format ./src","typedoc":"npx typedoc@0.25.13 --tsconfig tsconfig.build.json","coverage":"vitest run --coverage","lint:fix":"biome lint --apply ./src","format:fix":"biome format --write ./src","build:pages":"npx rimraf@6.0.1 gh-pages && mkdir -p gh-pages && cp -r typedocs/* gh-pages && cp -r coverage gh-pages/coverage","deploy:pages":"gh-pages -d gh-pages","publish-coverage-and-typedocs":"yarn typedoc && yarn coverage && yarn build:pages && yarn deploy:pages"},"typings":"lib/index.d.ts","_npmUser":{"name":"streamich","email":"vadimsdaleckis@gmail.com"},"repository":{"url":"git+https://github.com/streamich/glob-to-regex.git","type":"git"},"_npmVersion":"11.5.1","description":"Transform GLOB patterns to JavaScript regular expressions for fast file path matching.","directories":{},"_nodeVersion":"24.6.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@4.9.3","devDependencies":{"tslib":"^2.8.1","vitest":"^3.2.4","typescript":"^5.8.3","config-galore":"^1.0.0","@biomejs/biome":"^2.1.2","@vitest/coverage-v8":"^3.2.4"},"peerDependencies":{"tslib":"2"},"_npmOperationalInternal":{"tmp":"tmp/glob-to-regex.js_1.0.1_1756033666286_0.386317580852928","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"glob-to-regex.js","version":"1.1.0","keywords":["glob","regex","regexp","pattern","matcher","path","filesystem","wildcard"],"author":{"url":"https://github.com/streamich","name":"streamich"},"license":"Apache-2.0","_id":"glob-to-regex.js@1.1.0","maintainers":[{"name":"streamich","email":"vadimsdaleckis@gmail.com"}],"homepage":"https://github.com/streamich/glob-to-regex","bugs":{"url":"https://github.com/streamich/glob-to-regex/issues"},"dist":{"shasum":"191f07c7e7a87be33399494a3f18f43076ab1562","tarball":"https://registry.npmjs.org/glob-to-regex.js/-/glob-to-regex.js-1.1.0.tgz","fileCount":4,"integrity":"sha512-y44MUHqM0KXB5NIS/zxmuvaer/9PxsLnNaMDdDyN4m9W7wx115I5Tj/XHtNpuL6x+r4LwRefymkiiiWUfHVNRw==","signatures":[{"sig":"MEUCIG3qcYFke2VpQVZJPsOYhfYcBEB686YOoetGha7Gl3W4AiEA/f1zg8vQhHtTUTMX+VR/bmNvNRY4YmwLTpwRvNxzjPE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11553},"main":"lib/index.js","types":"lib/index.d.ts","engines":{"node":">=10.0"},"funding":{"url":"https://github.com/sponsors/streamich","type":"github"},"gitHead":"e80e79c18cbb93bb138505da022d87a7ff59aacf","scripts":{"lint":"biome lint ./src","test":"vitest ./src","build":"tsc --project tsconfig.build.json --module commonjs --target es2020 --outDir lib","clean":"npx rimraf@6.0.1 lib typedocs coverage gh-pages yarn-error.log","format":"biome format ./src","typedoc":"npx typedoc@0.25.13 --tsconfig tsconfig.build.json","coverage":"vitest run --coverage","lint:fix":"biome lint --apply ./src","format:fix":"biome format --write ./src","build:pages":"npx rimraf@6.0.1 gh-pages && mkdir -p gh-pages && cp -r typedocs/* gh-pages && cp -r coverage gh-pages/coverage","deploy:pages":"gh-pages -d gh-pages","publish-coverage-and-typedocs":"yarn typedoc && yarn coverage && yarn build:pages && yarn deploy:pages"},"typings":"lib/index.d.ts","_npmUser":{"name":"streamich","email":"vadimsdaleckis@gmail.com"},"repository":{"url":"git+https://github.com/streamich/glob-to-regex.git","type":"git"},"_npmVersion":"11.6.0","description":"Transform GLOB patterns to JavaScript regular expressions for fast file path matching.","directories":{},"_nodeVersion":"24.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@4.9.4","devDependencies":{"tslib":"^2.8.1","vitest":"^3.2.4","typescript":"^5.8.3","config-galore":"^1.0.0","@biomejs/biome":"^2.1.2","@vitest/coverage-v8":"^3.2.4"},"peerDependencies":{"tslib":"2"},"_npmOperationalInternal":{"tmp":"tmp/glob-to-regex.js_1.1.0_1759444071818_0.28473056380484785","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"glob-to-regex.js","version":"1.2.0","keywords":["glob","regex","regexp","pattern","matcher","path","filesystem","wildcard"],"author":{"url":"https://github.com/streamich","name":"streamich"},"license":"Apache-2.0","_id":"glob-to-regex.js@1.2.0","maintainers":[{"name":"streamich","email":"vadimsdaleckis@gmail.com"}],"homepage":"https://github.com/streamich/glob-to-regex","bugs":{"url":"https://github.com/streamich/glob-to-regex/issues"},"dist":{"shasum":"2b323728271d133830850e32311f40766c5f6413","tarball":"https://registry.npmjs.org/glob-to-regex.js/-/glob-to-regex.js-1.2.0.tgz","fileCount":4,"integrity":"sha512-QMwlOQKU/IzqMUOAZWubUOT8Qft+Y0KQWnX9nK3ch0CJg0tTp4TvGZsTfudYKv2NzoQSyPcnA6TYeIQ3jGichQ==","signatures":[{"sig":"MEYCIQCh8VyUpWpmS/tI6Eda+81EszLGMtzQPqP9te4RUAMXTQIhAKdvLDbPvUf7VuT+gL85BxGI81RtBqb8xB8FUdyrPV4/","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15981},"main":"lib/index.js","types":"lib/index.d.ts","engines":{"node":">=10.0"},"funding":{"url":"https://github.com/sponsors/streamich","type":"github"},"gitHead":"bd39c83a44f5a5a2cf1a8bdd7996658c6b93368c","scripts":{"lint":"biome lint ./src","test":"vitest ./src","build":"tsc --project tsconfig.build.json --module commonjs --target es2020 --outDir lib","clean":"npx rimraf@6.0.1 lib typedocs coverage gh-pages yarn-error.log","format":"biome format ./src","typedoc":"npx typedoc@0.25.13 --tsconfig tsconfig.build.json","coverage":"vitest run --coverage","lint:fix":"biome lint --apply ./src","format:fix":"biome format --write ./src","build:pages":"npx rimraf@6.0.1 gh-pages && mkdir -p gh-pages && cp -r typedocs/* gh-pages && cp -r coverage gh-pages/coverage","deploy:pages":"gh-pages -d gh-pages","publish-coverage-and-typedocs":"yarn typedoc && yarn coverage && yarn build:pages && yarn deploy:pages"},"typings":"lib/index.d.ts","_npmUser":{"name":"streamich","email":"vadimsdaleckis@gmail.com"},"repository":{"url":"git+https://github.com/streamich/glob-to-regex.git","type":"git"},"_npmVersion":"11.6.0","description":"Transform GLOB patterns to JavaScript regular expressions for fast file path matching.","directories":{},"_nodeVersion":"24.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@4.9.4","devDependencies":{"tslib":"^2.8.1","vitest":"^3.2.4","typescript":"^5.8.3","config-galore":"^1.0.0","@biomejs/biome":"^2.1.2","@vitest/coverage-v8":"^3.2.4"},"peerDependencies":{"tslib":"2"},"_npmOperationalInternal":{"tmp":"tmp/glob-to-regex.js_1.2.0_1759496971685_0.24592518077960257","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"glob-to-regex.js","version":"1.3.0","keywords":["glob","regex","regexp","pattern","matcher","path","filesystem","wildcard"],"author":{"url":"https://github.com/streamich","name":"streamich"},"license":"Apache-2.0","_id":"glob-to-regex.js@1.3.0","maintainers":[{"name":"streamich","email":"vadimsdaleckis@gmail.com"}],"homepage":"https://github.com/streamich/glob-to-regex","bugs":{"url":"https://github.com/streamich/glob-to-regex/issues"},"dist":{"shasum":"3cd7d2bfbaf723a07bb392f292fc3f2547b43e2c","tarball":"https://registry.npmjs.org/glob-to-regex.js/-/glob-to-regex.js-1.3.0.tgz","fileCount":4,"integrity":"sha512-BhmW1B8BFcGKT/O4VjzfN4A16T1dbYh/uiy5gVxnn+89tVYk/SzH6ShOLAgBHxUCHhdFvcJT1a6Ksx6G0nPNnw==","signatures":[{"sig":"MEYCIQDot1blKh768LL+YQzMOyXyBBYcEP9ueIBpuL60gG4P3QIhANGgDd7Zn2K5G0JtCuMzGZSy6HeEW0YU7mACiFzr7ch+","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIBnVT5Gz2mD1aceCBAck7tdFC1f4eypWWWSPlYRRd/f8AiAJxD/DEk3RCtYdV6OBpgRG/iqr2POvPCcYJebAK/L6gw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26479},"main":"lib/index.js","types":"lib/index.d.ts","engines":{"node":">=10.0"},"funding":{"url":"https://github.com/sponsors/streamich","type":"github"},"gitHead":"313614175f895f4a44aef833ee80e0cc6fb3e654","scripts":{"lint":"biome lint ./src","test":"vitest ./src","build":"tsc --project tsconfig.build.json --module commonjs --target es2020 --outDir lib","clean":"npx rimraf@6.0.1 lib typedocs coverage gh-pages yarn-error.log","format":"biome format ./src","typedoc":"npx typedoc@0.25.13 --tsconfig tsconfig.build.json","coverage":"vitest run --coverage","lint:fix":"biome lint --apply ./src","format:fix":"biome format --write ./src","build:pages":"npx rimraf@6.0.1 gh-pages && mkdir -p gh-pages && cp -r typedocs/* gh-pages && cp -r coverage gh-pages/coverage","deploy:pages":"gh-pages -d gh-pages","publish-coverage-and-typedocs":"yarn typedoc && yarn coverage && yarn build:pages && yarn deploy:pages"},"typings":"lib/index.d.ts","_npmUser":{"name":"streamich","email":"vadimsdaleckis@gmail.com"},"repository":{"url":"git+https://github.com/streamich/glob-to-regex.git","type":"git"},"_npmVersion":"11.19.0","description":"Transform GLOB patterns to JavaScript regular expressions for fast file path matching.","directories":{},"_nodeVersion":"24.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@4.9.4","devDependencies":{"tslib":"^2.8.1","vitest":"^3.2.4","typescript":"^5.8.3","config-galore":"^1.0.0","@biomejs/biome":"^2.1.2","@vitest/coverage-v8":"^3.2.4"},"peerDependencies":{"tslib":"2"},"_npmOperationalInternal":{"tmp":"tmp/glob-to-regex.js_1.3.0_1789294103448_0.22950289093668652","host":"s3://npm-registry-packages-npm-production"}},"1.3.1":{"_id":"glob-to-regex.js@1.3.1","bugs":{"url":"https://github.com/streamich/glob-to-regex/issues"},"dist":{"shasum":"2f9fe8821218b18e6dcced9bcb4413932162db4b","tarball":"https://registry.npmjs.org/glob-to-regex.js/-/glob-to-regex.js-1.3.1.tgz","fileCount":4,"integrity":"sha512-zhWhMRsgnOym+1txhUmYJGD6eUsbUdrZv55gCYKuJX8t2p3+M8My23PD09bEIsreGUs5pnSa/idmcfp2/IlqGg==","signatures":[{"sig":"MEQCIAcIZL1bfv4bfi6B97jv3HIpzZX7r2ez5C4baiWy4uFLAiAmP1TqYxi7iO5d5nUhfO+egzOZ6pt2smMbc53Nxgh8KA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGJkIcgAHNDLp14dBwKMGrbxqsZyM+sFfnxSMqqC+K4OAiEA7Ev6DMsuErX65/k/FwiY3B2z1DEVXQyQuDCRRRn+I0Y="}],"unpackedSize":26583},"main":"lib/index.js","name":"glob-to-regex.js","types":"lib/index.d.ts","author":{"url":"https://github.com/streamich","name":"streamich"},"engines":{"node":">=10.0"},"funding":{"url":"https://github.com/sponsors/streamich","type":"github"},"gitHead":"2b429f9c32ab82a1218d9391c42fcff799ef41ed","license":"Apache-2.0","scripts":{"lint":"biome lint ./src","test":"vitest ./src","build":"tsc --project tsconfig.build.json --module commonjs --target es2020 --outDir lib","clean":"npx rimraf@6.0.1 lib typedocs coverage gh-pages yarn-error.log","format":"biome format ./src","typedoc":"npx typedoc@0.25.13 --tsconfig tsconfig.build.json","coverage":"vitest run --coverage","lint:fix":"biome lint --apply ./src","format:fix":"biome format --write ./src","build:pages":"npx rimraf@6.0.1 gh-pages && mkdir -p gh-pages && cp -r typedocs/* gh-pages && cp -r coverage gh-pages/coverage","deploy:pages":"gh-pages -d gh-pages","publish-coverage-and-typedocs":"yarn typedoc && yarn coverage && yarn build:pages && yarn deploy:pages"},"typings":"lib/index.d.ts","version":"1.3.1","_npmUser":{"name":"streamich","email":"vadimsdaleckis@gmail.com"},"homepage":"https://github.com/streamich/glob-to-regex","keywords":["glob","regex","regexp","pattern","matcher","path","filesystem","wildcard"],"repository":{"url":"git+https://github.com/streamich/glob-to-regex.git","type":"git"},"_npmVersion":"11.19.0","description":"Transform GLOB patterns to JavaScript regular expressions for fast file path matching.","directories":{},"maintainers":[{"name":"streamich","email":"vadimsdaleckis@gmail.com"}],"_nodeVersion":"24.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@4.9.4","devDependencies":{"tslib":"^2.8.1","vitest":"^3.2.4","typescript":"^5.8.3","config-galore":"^1.0.0","@biomejs/biome":"^2.1.2","@vitest/coverage-v8":"^3.2.4"},"peerDependencies":{"tslib":"2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/glob-to-regex.js_1.3.1_1789296333783_0.3698117302493438"}}},"time":{"created":"2025-08-24T11:07:46.134Z","modified":"2026-09-13T10:45:34.034Z","1.0.1":"2025-08-24T11:07:46.470Z","1.1.0":"2025-10-02T22:27:52.035Z","1.2.0":"2025-10-03T13:09:31.841Z","1.3.0":"2026-09-13T10:08:23.541Z","1.3.1":"2026-09-13T10:45:33.871Z"},"bugs":{"url":"https://github.com/streamich/glob-to-regex/issues"},"author":{"url":"https://github.com/streamich","name":"streamich"},"license":"Apache-2.0","homepage":"https://github.com/streamich/glob-to-regex","keywords":["glob","regex","regexp","pattern","matcher","path","filesystem","wildcard"],"repository":{"url":"git+https://github.com/streamich/glob-to-regex.git","type":"git"},"description":"Transform GLOB patterns to JavaScript regular expressions for fast file path matching.","maintainers":[{"name":"streamich","email":"vadimsdaleckis@gmail.com"}],"readme":"# glob-to-regex.js\n\nTransform GLOB patterns to JavaScript regular expressions for fast file path matching.\n\nThis tiny library converts familiar shell-style glob patterns like `**/*.ts` or `src/{a,b}/**/*.js` into JavaScript `RegExp` objects and provides a convenient matcher utility. Matching semantics follow `minimatch`,\nso the regexes can stand in for it segment by segment.\n\n## Install\n\n```bash\nyarn add glob-to-regex.js\n# or\nnpm i glob-to-regex.js\n```\n\n## Quick start\n\n```ts\nimport {toRegex, toMatcher, expandBraces} from 'glob-to-regex.js';\n\n// Build a RegExp from a glob\nconst re = toRegex('src/**/test.ts');\nre.test('src/a/b/test.ts'); // true\nre.test('src/test.ts');     // true\nre.test('src/test.tsx');    // false\n\n// Shell rules for dotfiles and extended globs\nconst shell = toRegex('**/!(*.test).js', {dot: false, extglob: true});\nshell.test('src/index.js');    // true\nshell.test('src/app.test.js'); // false\nshell.test('.git/hooks.js');   // false\n\n// Build a predicate function from a pattern or an array of patterns\nconst match = toMatcher(['**/*.ts', '/\\\\.d\\\\.ts$/']);\nmatch('index.ts');   // true\nmatch('types.d.ts'); // true\n\nexpandBraces('src/{lib,test}/{1..3}.ts');\n// ['src/lib/1.ts', 'src/lib/2.ts', ..., 'src/test/3.ts']\n```\n\n## API\n\n- `toRegex(pattern: string, options?: GlobOptions): RegExp`\n\t- Converts a glob pattern to an anchored regular expression (`^...$`).\n\n- `toMatcher(pattern: string | RegExp | Array<string | RegExp>, options?: GlobOptions): (path: string) => boolean`\n\t- Accepts a glob string, a RegExp, or an array of them. If given an array, it returns true if any item matches (logical OR, short-circuited).\n\t- Strings starting with `/` and ending with `/flags?` are treated as regular expressions (e.g. `\"/\\\\.test\\\\.ts$/\"`).\n\n- `expandBraces(pattern: string, max?: number): string[]`\n\t- Expands `{a,b}` alternations and `{1..3}` ranges into the list of patterns they stand for, nesting included. Stops after `max` patterns (default 100,000).\n\n### Options\n\n- `nocase` — case-insensitive matching.\n- `extglob` — enables the `?(...)`, `*(...)`, `+(...)`, `@(...)` and `!(...)` groups.\n- `dot` — whether `*`, `?`, `[...]` and extglobs match a leading `.` of a path segment. Defaults to `true`; `false` is the shell rule, where a dotfile is matched only by a literal dot in the pattern (`.*` matches `.gitignore`, `*` does not) and `**` does not descend into dot directories.\n\n## Supported glob features\n\n- `/` separates path segments\n- `*` matches zero or more characters within a single segment (does not cross `/`). A segment that is only `*` matches at least one character, as a file name is never empty: `a/*` does not match `a/`\n- `?` matches exactly one character within a single segment\n- `**` matches across path segments, including none. `**/**/` is the same as `**/`\n- `{a,b,c}` alternation groups, nested as in `{a,{b,c}}`. Each item can itself contain glob syntax\n- `{1..3}`, `{a..c}`, `{01..10..2}` ranges, with the step and zero padding of bash\n- Character classes: `[abc]`, `[a-z]`, `[!a-z]`, `[^a-z]`, and POSIX classes such as `[[:alpha:]]` or `[a[:digit:]]`. A `]` right after the opening bracket is a member of the class: `[]a]` matches `]` or `a`\n- **Extended globbing** (when `extglob: true` option is set):\n  - `?(pattern-list)` matches zero or one occurrence of the given patterns\n  - `*(pattern-list)` matches zero or more occurrences of the given patterns\n  - `+(pattern-list)` matches one or more occurrences of the given patterns\n  - `@(pattern-list)` matches exactly one of the given patterns\n  - `!(pattern-list)` matches anything except one of the given patterns. The exclusion covers the rest of the pattern, so `!(a).js` rejects `a.js` and accepts `ab.js`; `!()` matches any non-empty segment\n  - Pattern lists use `|` as separator (e.g., `@(jpg|png|gif)`)\n\nNotes:\n- The produced RegExp is anchored at start and end (`^...$`).\n- A brace group without a comma or range (`{a}`, `{}`) and an unmatched `{`, `[` or `(` are literal.\n- A range with its ends reversed, like `[z-a]`, matches nothing instead of throwing.\n- There is no escape character: a backslash is a literal backslash.\n\n## Examples\n\n```ts\ntoRegex('a/b/c.txt').test('a/b/c.txt'); // true\ntoRegex('a/*.txt').test('a/file.txt');  // true\ntoRegex('a/*.txt').test('a/x/y.txt');   // false\ntoRegex('file?.js').test('file1.js');   // true\ntoRegex('src/**/test.ts').test('src/a/b/test.ts'); // true\ntoRegex('assets/**').test('assets/a/b.png');       // true\ntoRegex('*.{html,txt}').test('page.html');         // true\ntoRegex('src/{a,b}/**/*.ts').test('src/b/x/y.ts'); // true\ntoRegex('v{1..3}.tgz').test('v2.tgz');             // true\ntoRegex('file[0-9].txt').test('file5.txt');        // true\ntoRegex('file[!0-9].txt').test('filea.txt');       // true\ntoRegex('[[:upper:]]*.ts').test('App.ts');         // true\ntoRegex('**/*.[jt]s{,x}').test('dir/a/b.jsx');     // true\n\n// Dotfiles\ntoRegex('*.js').test('.eslintrc.js');               // true\ntoRegex('*.js', {dot: false}).test('.eslintrc.js'); // false\ntoRegex('.*', {dot: false}).test('.eslintrc.js');   // true\ntoRegex('**/*.js', {dot: false}).test('node_modules/.cache/a.js'); // false\n\n// Extended globbing examples\ntoRegex('file?(s).txt', {extglob: true}).test('file.txt');  // true\ntoRegex('file?(s).txt', {extglob: true}).test('files.txt'); // true\ntoRegex('file.@(jpg|png|gif)', {extglob: true}).test('file.jpg'); // true\ntoRegex('/var/log/!(*.gz)', {extglob: true}).test('/var/log/syslog'); // true\ntoRegex('/var/log/!(*.gz)', {extglob: true}).test('/var/log/error.log.gz'); // false\ntoRegex('src/**/!(*.test).js', {extglob: true}).test('src/app.test.js'); // false\ntoRegex('src/**/!(*.test).js', {extglob: true}).test('src/index.js'); // true\ntoRegex('!(a).js', {extglob: true}).test('ab.js'); // true\ntoRegex('!(a).js', {extglob: true}).test('a.js');  // false\n```\n\n## TypeScript\n\nTypes are bundled. The library targets modern Node.js and browsers.\n\n## Performance\n\n`toRegex` performs a single pass over the pattern and creates a native RegExp. Matching is then performed by V8's highly optimized engine.\n\n## Limitations\n\n- Negated globs like `!**/*.d.ts` are not parsed specially. If you need exclusion, combine multiple matchers or filter results separately.\n- `**` is a globstar wherever it appears, not only as a whole segment: `a**` matches across `/`.\n- Like minimatch, `!(a)*` does not match `a`: the negation rejects the whole remainder, while bash tries every split.\n\n## License\n\nApache-2.0 © streamich\n","readmeFilename":"README.md"}