@r_masseater/wism 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -8
- package/dist/{app-Cz0XYkP8.mjs → app-CpjqcXHR.mjs} +82 -49
- package/dist/app-CpjqcXHR.mjs.map +1 -0
- package/dist/cli-BD4VKg7i.mjs +15 -0
- package/dist/cli-BD4VKg7i.mjs.map +1 -0
- package/dist/cli.mjs +3 -12
- package/dist/cli.mjs.map +1 -1
- package/dist/define-Dvnt_9zv.mjs +6 -0
- package/dist/define-Dvnt_9zv.mjs.map +1 -0
- package/dist/{index-wGGk2Etn.d.mts → index-BS1qCX0f.d.mts} +2 -2
- package/dist/index.d.mts +7 -5
- package/dist/index.mjs +3 -1
- package/dist/presets.d.mts +48 -0
- package/dist/presets.mjs +2608 -0
- package/dist/presets.mjs.map +1 -0
- package/dist/vite.d.mts +1 -1
- package/package.json +23 -14
- package/skills/lint-presets/SKILL.md +65 -0
- package/skills/lint-structure/SKILL.md +4 -4
- package/dist/app-Cz0XYkP8.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.mjs","names":["Arr","pathsOf","ONE","Str","Arr","compile","Arr","Str","ONE","Arr","Str","Arr","Rec","Str","Arr","Arr","Arr","Rec"],"sources":["../src/entities/kind/model/layers.ts","../src/entities/kind/model/presets.ts","../../path-kit/src/entities/path/model/path.ts","../../../node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js","../../../node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion/dist/esm/index.js","../../../node_modules/.pnpm/@isaacs+nonrecursive-glob-match@1.1.0/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/numeric-range.js","../../../node_modules/.pnpm/@isaacs+nonrecursive-glob-match@1.1.0/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.js","../../../node_modules/.pnpm/@isaacs+nonrecursive-glob-match@1.1.0/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.js","../../../node_modules/.pnpm/minimatch@11.0.9/node_modules/minimatch/dist/esm/assert-valid-pattern.js","../../../node_modules/.pnpm/minimatch@11.0.9/node_modules/minimatch/dist/esm/escape.js","../../../node_modules/.pnpm/minimatch@11.0.9/node_modules/minimatch/dist/esm/unescape.js","../../../node_modules/.pnpm/minimatch@11.0.9/node_modules/minimatch/dist/esm/index.js","../../path-kit/src/entities/glob/model/glob.ts","../src/shared/lib/memo.ts","../src/entities/layout/model/position.ts","../src/entities/layout/model/layout.ts","../src/features/check-imports/model/imports.ts","../src/shared/lib/finding.ts","../src/features/check-placement/model/placement.ts","../src/app/presets/preset.ts"],"sourcesContent":["import { Array as Arr } from \"effect\";\n\nimport type { Layers } from \"./types.ts\";\n\nconst listed =\n (pick: (layers: Layers) => readonly string[] | undefined) =>\n (layers: Layers) =>\n (layer: string): boolean =>\n Arr.contains(pick(layers) ?? [], layer);\n\nexport const isSliced = listed((layers) => layers.sliced);\n\nconst isSegmented = listed((layers) => layers.segmented);\n\nexport const isParted =\n (layers: Layers) =>\n (layer: string): boolean =>\n isSliced(layers)(layer) || isSegmented(layers)(layer);\n\nexport const isLayer = listed((layers) => layers.order);\n","import { Option } from \"effect\";\n\nimport type { Kind } from \"./types.ts\";\n\nexport const FSD_LAYERS: readonly string[] = [\n \"app\",\n \"pages\",\n \"widgets\",\n \"features\",\n \"entities\",\n \"shared\",\n];\n\nconst SLICED: readonly string[] = [\"pages\", \"widgets\", \"features\", \"entities\"];\nconst SCRIPTS: readonly string[] = [\"**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}\"];\nconst RUST: readonly string[] = [\"**/*.rs\"];\n\nexport interface PresetOptions {\n readonly paths?: readonly string[];\n}\n\nconst pathsOf = ({ paths }: PresetOptions): Pick<Kind, \"paths\"> =>\n Option.match(Option.fromUndefinedOr(paths), {\n onNone: () => ({}),\n onSome: (value) => ({ paths: value }),\n });\n\nexport const workspace = (options: PresetOptions = {}): Kind => ({\n name: \"workspace\",\n marker: \"package.json\",\n ...pathsOf(options),\n placements: [\n {\n files: SCRIPTS,\n allow: [\"src/**\", \"bin/**\", \"*.config.{ts,mts,js,mjs}\", \"alchemy.*.ts\", \"*.d.{ts,mts,cts}\"],\n message:\n \"sits outside src/. Put every module of a workspace under src/ in an FSD layer; only bin/, *.config.ts, alchemy.*.ts and *.d.ts may stay at the workspace root.\",\n },\n ],\n layers: {\n dir: \"src\",\n files: SCRIPTS,\n order: FSD_LAYERS,\n sliced: SLICED,\n segmented: [\"shared\"],\n entries: [\"index.*\"],\n open: [\"shared/lib/**\", \"shared/ui/**\"],\n cross: \"@x\",\n },\n});\n\nexport const rustCrate = (options: PresetOptions = {}): Kind => ({\n name: \"crate\",\n marker: \"Cargo.toml\",\n ...pathsOf(options),\n placements: [\n {\n files: RUST,\n allow: [\"src/**\", \"build.rs\", \"benches/**\", \"tests/**\"],\n message:\n \"sits outside src/. Put every module of a crate under src/ in an FSD layer; only build.rs, benches/ and tests/ may stay outside.\",\n },\n ],\n layers: {\n dir: \"src\",\n files: RUST,\n order: FSD_LAYERS,\n sliced: SLICED,\n segmented: [\"shared\"],\n loose: [\"lib.rs\", \"main.rs\", \"bin/**\"],\n moduleFiles: true,\n },\n});\n\nexport const skill = (options: PresetOptions = {}): Kind => ({\n name: \"skill\",\n marker: \"SKILL.md\",\n ...pathsOf(options),\n placements: [\n {\n files: [\"**\"],\n allow: [\"SKILL.md\", \"usecases/**\", \"references/**\", \"scripts/**\", \"assets/**\"],\n message:\n \"is not part of an Agent Skill's layout. A skill holds SKILL.md, usecases/, references/, scripts/ and assets/.\",\n },\n ],\n});\n","import { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nexport const SEPARATOR = \"/\";\n\nconst ROOT = \".\";\nconst EXTENSION = \".\";\nconst BACKSLASH = \"\\\\\";\nconst NONE = 0;\nconst ONE = 1;\n\nexport const toPosix = Str.replaceAll(BACKSLASH, SEPARATOR);\n\nexport const segments = (path: string): Arr.NonEmptyReadonlyArray<string> =>\n Str.split(path, SEPARATOR);\n\nexport const joinAll = (parts: readonly string[]): string => Arr.join(parts, SEPARATOR);\n\nexport const join =\n (directory: string) =>\n (name: string): string =>\n Arr.join(Arr.filter([directory, name], Str.isNonEmpty), SEPARATOR);\n\nexport const parent = (path: string): string => joinAll(Arr.dropRight(segments(path), ONE));\n\nexport const ancestors = (path: string): readonly string[] => {\n const parts = Arr.dropRight(segments(path), ONE);\n return pipe(\n Arr.range(NONE, parts.length),\n Arr.reverse,\n Arr.map((count) => joinAll(Arr.take(parts, count))),\n );\n};\n\nexport const baseName = (path: string): string =>\n pipe(\n segments(path),\n Arr.filter(Str.isNonEmpty),\n Arr.last,\n Option.getOrElse(() => \"\"),\n );\n\nexport const stem = (name: string): string =>\n pipe(\n Str.split(name, EXTENSION),\n Arr.head,\n Option.getOrElse(() => name),\n );\n\nexport const afterPrefix =\n (prefix: string) =>\n (text: string): Option.Option<string> =>\n pipe(Option.liftPredicate(text, Str.startsWith(prefix)), Option.map(Str.slice(prefix.length)));\n\nexport const isWithin =\n (directory: string) =>\n (path: string): boolean =>\n Str.isEmpty(directory) ||\n path === directory ||\n Str.startsWith(`${directory}${SEPARATOR}`)(path);\n\nexport const isInside =\n (directory: string) =>\n (path: string): boolean =>\n path !== directory && (directory === ROOT || isWithin(directory)(path));\n\nexport const below =\n (directory: string) =>\n (path: string): Option.Option<string> =>\n pipe(\n Option.liftPredicate(path, () => Str.isEmpty(directory)),\n Option.orElse(() => afterPrefix(`${directory}${SEPARATOR}`)(path)),\n );\n\nexport const relativeTo =\n (root: string) =>\n (file: string): Option.Option<string> =>\n below(toPosix(root))(toPosix(file));\n","export const balanced = (a, b, str) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a;\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b;\n const r = ma !== null && mb != null && range(ma, mb, str);\n return (r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n });\n};\nconst maybeMatch = (reg, str) => {\n const m = str.match(reg);\n return m ? m[0] : null;\n};\nexport const range = (a, b, str) => {\n let begs, beg, left, right = undefined, result;\n let ai = str.indexOf(a);\n let bi = str.indexOf(b, ai + 1);\n let i = ai;\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n }\n else if (begs.length === 1) {\n const r = begs.pop();\n if (r !== undefined)\n result = [r, bi];\n }\n else {\n beg = begs.pop();\n if (beg !== undefined && beg < left) {\n left = beg;\n right = bi;\n }\n bi = str.indexOf(b, i + 1);\n }\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n if (begs.length && right !== undefined) {\n result = [left, right];\n }\n }\n return result;\n};\n//# sourceMappingURL=index.js.map","import { balanced } from 'balanced-match';\nconst escSlash = '\\0SLASH' + Math.random() + '\\0';\nconst escOpen = '\\0OPEN' + Math.random() + '\\0';\nconst escClose = '\\0CLOSE' + Math.random() + '\\0';\nconst escComma = '\\0COMMA' + Math.random() + '\\0';\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0';\nconst escSlashPattern = new RegExp(escSlash, 'g');\nconst escOpenPattern = new RegExp(escOpen, 'g');\nconst escClosePattern = new RegExp(escClose, 'g');\nconst escCommaPattern = new RegExp(escComma, 'g');\nconst escPeriodPattern = new RegExp(escPeriod, 'g');\nconst slashPattern = /\\\\\\\\/g;\nconst openPattern = /\\\\{/g;\nconst closePattern = /\\\\}/g;\nconst commaPattern = /\\\\,/g;\nconst periodPattern = /\\\\\\./g;\nexport const EXPANSION_MAX = 100_000;\n// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An\n// input like `'{a,b}'.repeat(1500)` stays under that count - its output is\n// truncated to 100k results - while making every result ~1500 characters\n// long. The result set, and the intermediate arrays built while combining\n// brace sets, then grow large enough to exhaust memory and crash the process\n// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of\n// characters the accumulator may hold at any point, so memory stays flat no\n// matter how many brace groups are chained. The limit sits well above any\n// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M\n// characters) so legitimate input is unaffected.\nexport const EXPANSION_MAX_LENGTH = 4_000_000;\n// `expand_` recurses once per level of brace *nesting* - both when expanding a\n// set's comma members and when re-wrapping a set whose body is a single part.\n// The CVE-2026-14257 fix made the *tail* iterative (recursion on `m.post`, one\n// level per chained group), which left nesting depth unbounded: about 3,100\n// levels of `{{{...a,b...}}}` - only ~6KB of input - exhausted the native stack\n// and crashed the process. `EXPANSION_MAX_DEPTH` bounds how deep the parser\n// will follow nesting. It sits far above any realistic pattern and well below\n// the depth at which the stack runs out.\nexport const EXPANSION_MAX_DEPTH = 1_000;\n// Bash keeps a quirk where a brace group followed by a comma set still expands\n// (`{a},b}`). The parser implements it by rewriting the string and restarting\n// the scan, absorbing one `}` per pass. `n` trailing braces therefore cost `n`\n// full passes over a string that itself grows by one `escClose` sentinel each\n// time - quadratic in `n`, with a ~26x constant from the sentinel's length.\n// 128KB of `'{a}' + '}'.repeat(n) + ',z}'` blocked the event loop for 27\n// seconds to produce two results. `EXPANSION_MAX_REWRITES` bounds how many\n// times the scan may restart. Real `{a},b}` input needs a handful.\nexport const EXPANSION_MAX_REWRITES = 1_000;\nfunction numeric(str) {\n return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);\n}\nfunction escapeBraces(str) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod);\n}\nfunction unescapeBraces(str) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.');\n}\n// Like `target.push(...items)` but doesn't overflow the stack\nfunction pushAll(target, items) {\n for (let i = 0; i < items.length; i++) {\n target.push(items[i]);\n }\n}\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str) {\n const parts = [];\n // Walk the brace groups iteratively. Recursing on `post` once per group let a\n // chain of them exhaust the stack - the parsing-side counterpart to\n // the `expand_` overflow fixed for CVE-2026-14257, and not something `max` or\n // `maxLength` can bound, since it happens before expansion.\n //\n // The part the next chunk continues\n let carry = '';\n for (;;) {\n const m = balanced('{', '}', str);\n if (!m) {\n const tail = str.split(',');\n tail[0] = carry + tail[0];\n pushAll(parts, tail);\n return parts;\n }\n const { pre, body, post } = m;\n const p = pre.split(',');\n p[0] = carry + p[0];\n p[p.length - 1] += '{' + body + '}';\n if (!post.length) {\n pushAll(parts, p);\n return parts;\n }\n carry = p.pop();\n pushAll(parts, p);\n str = post;\n }\n}\nexport function expand(str, options = {}) {\n if (!str) {\n return [];\n }\n const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH, maxDepth = EXPANSION_MAX_DEPTH, maxRewrites = EXPANSION_MAX_REWRITES, } = options;\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2);\n }\n return expand_(escapeBraces(str), max, maxLength, maxDepth, 0, maxRewrites, true).map(unescapeBraces);\n}\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\n// Build `{ acc[a] + pre + values[v] }` for every combination, capping the\n// number of results at `max` and the total number of characters at `maxLength`.\n// This is the one place output grows, so bounding it here keeps the single\n// accumulator - and therefore memory - flat regardless of how many brace groups\n// are combined (CVE-2026-14257).\nfunction combine(acc, pre, values, max, maxLength, dropEmpties) {\n const out = [];\n let length = 0;\n for (let a = 0; a < acc.length; a++) {\n for (let v = 0; v < values.length; v++) {\n if (out.length >= max)\n return out;\n const expansion = acc[a] + pre + values[v];\n // Bash drops empty results at the top level. Skip them before they count\n // against `max`, so `max` bounds the number of *kept* results.\n if (dropEmpties && !expansion)\n continue;\n if (length + expansion.length > maxLength)\n return out;\n out.push(expansion);\n length += expansion.length;\n }\n }\n return out;\n}\n// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)\n// sequence body.\nfunction expandSequence(body, isAlphaSequence, max, maxLength) {\n const n = body.split(/\\.\\./);\n const N = [];\n // A sequence body always splits into two or three parts, but the compiler\n // can't know that.\n /* c8 ignore start */\n if (n[0] === undefined || n[1] === undefined) {\n return N;\n }\n /* c8 ignore stop */\n const x = numeric(n[0]);\n const y = numeric(n[1]);\n const width = Math.max(n[0].length, n[1].length);\n let incr = n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1;\n let test = lte;\n const reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n const pad = n.some(isPadded);\n let length = 0;\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\') {\n c = '';\n }\n }\n else {\n c = String(i);\n if (pad) {\n const need = width - c.length;\n if (need > 0) {\n const z = new Array(need + 1).join('0');\n if (i < 0) {\n c = '-' + z + c.slice(1);\n }\n else {\n c = z + c;\n }\n }\n }\n }\n if (length + c.length > maxLength)\n break;\n N.push(c);\n length += c.length;\n }\n return N;\n}\nfunction expand_(str, max, maxLength, maxDepth, depth, maxRewrites, isTop) {\n // Too deeply nested to keep following: treat the rest as literal, the same\n // way a group that cannot expand is already handled. Truncating rather than\n // throwing keeps `expand` total, matching `max` and `maxLength`.\n if (depth > maxDepth) {\n return [str];\n }\n // Consume the string's top-level brace groups left to right, threading a\n // running set of combined prefixes (`acc`). Expanding the tail iteratively -\n // rather than recursing on `m.post` once per group - keeps the native stack\n // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no\n // longer overflow the stack, and leaves a single accumulator whose size\n // `maxLength` bounds directly (CVE-2026-14257).\n let acc = [''];\n // Bash drops empty results, but only when the *first* top-level group is a\n // comma set - a sequence like `{a..\\}` may legitimately yield ''. The drop\n // is on the final strings, so it is applied to whichever `combine` produces\n // them (the one with no brace set left in the tail).\n // How many times the `{a},b}` rewrite below has restarted the scan. Each pass\n // re-reads the whole string, so leaving this unbounded is quadratic.\n let rewrites = 0;\n let dropEmpties = false;\n let firstGroup = true;\n for (;;) {\n const m = balanced('{', '}', str);\n // No brace set left: the rest of the string is literal.\n if (!m) {\n return combine(acc, str, [''], max, maxLength, dropEmpties);\n }\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre;\n if (/\\$$/.test(pre)) {\n acc = combine(acc, pre + '{' + m.body + '}', [''], max, maxLength, dropEmpties && !m.post.length);\n firstGroup = false;\n if (!m.post.length)\n break;\n str = m.post;\n continue;\n }\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n const isSequence = isNumericSequence || isAlphaSequence;\n const isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (rewrites < maxRewrites && m.post.match(/,(?!,).*\\}/)) {\n rewrites++;\n str = m.pre + '{' + m.body + escClose + m.post;\n isTop = true;\n continue;\n }\n // Nothing here expands, so the whole remaining string is literal.\n return combine(acc, pre + '{' + m.body + '}' + m.post, [''], max, maxLength, dropEmpties);\n }\n if (firstGroup) {\n dropEmpties = isTop && !isSequence;\n firstGroup = false;\n }\n let values;\n if (isSequence) {\n values = expandSequence(m.body, isAlphaSequence, max, maxLength);\n }\n else {\n let n = parseCommaParts(m.body);\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, maxLength, maxDepth, depth + 1, maxRewrites, false).map(embrace);\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n acc = combine(acc, pre + n[0], [''], max, maxLength, dropEmpties && !m.post.length);\n if (!m.post.length)\n break;\n str = m.post;\n continue;\n }\n /* c8 ignore stop */\n }\n // Values that `combine` is going to drop as empty produce no result, so\n // they must not count against `max` - otherwise `{a,,b}` with `max: 2`\n // would stop at `['a', '']` and yield one result instead of two. Skipping\n // them outright keeps `values` bounded while leaving `max` a bound on\n // *kept* results.\n let dropsEmpties = dropEmpties && !m.post.length && !pre;\n for (let d = 0; dropsEmpties && d < acc.length; d++) {\n if (acc[d]) {\n dropsEmpties = false;\n }\n }\n values = [];\n let valuesLength = 0;\n outer: for (let j = 0; j < n.length; j++) {\n const expanded = expand_(n[j], max, maxLength, maxDepth, depth + 1, maxRewrites, false);\n for (let k = 0; k < expanded.length; k++) {\n const v = expanded[k];\n if (dropsEmpties && !v)\n continue;\n if (values.length >= max ||\n valuesLength + v.length > maxLength) {\n break outer;\n }\n values.push(v);\n valuesLength += v.length;\n }\n }\n }\n acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length);\n if (!m.post.length)\n break;\n str = m.post;\n }\n return acc;\n}\n//# sourceMappingURL=index.js.map","// One digit, or a class of digits from a to b.\nconst digit = (a, b) => a === b ?\n { t: 'lit', ch: String(a) }\n : { t: 'class', re: new RegExp(`^[${a}-${b}]$`) };\nconst prefix = (d, alts) => alts.map(s => [digit(d, d), ...s]);\n// The digit strings from a to b, which have the same length.\nconst fixed = (a, b) => {\n if (!a)\n return [[]];\n let lo = +a[0];\n let hi = +b[0];\n const ra = a.slice(1);\n const rb = b.slice(1);\n if (lo === hi)\n return prefix(lo, fixed(ra, rb));\n const zeros = '0'.repeat(ra.length);\n const nines = '9'.repeat(ra.length);\n const out = [];\n if (ra !== zeros)\n out.push(...prefix(lo++, fixed(ra, nines)));\n const last = rb === nines ? [] : prefix(hi--, fixed(zeros, rb));\n if (lo <= hi) {\n out.push([digit(lo, hi), ...Array.from(ra, () => digit(0, 9))]);\n }\n out.push(...last);\n return out;\n};\n// The numbers from a to b, where 0 <= a <= b. If width is set, each\n// one has leading zeros to make it that many digits.\nconst nonneg = (a, b, width) => {\n if (width) {\n return fixed(String(a).padStart(width, '0'), String(b).padStart(width, '0'));\n }\n const out = [];\n for (let len = String(a).length; len <= String(b).length; len++) {\n const lo = Math.max(a, len === 1 ? 0 : 10 ** (len - 1));\n const hi = Math.min(b, 10 ** len - 1);\n out.push(...fixed(String(lo), String(hi)));\n }\n return out;\n};\n/**\n * The strings that the bash brace expansion `{lo..hi}` makes, as\n * the alternatives of an `@(...)` extglob. Each one is a sequence of\n * digits and digit classes, so there are only a few of them, even for\n * a large range.\n *\n * If either end has a leading zero, such as `{01..10}`, each number\n * has leading zeros to make it as long as the longer end, counting a\n * `-` sign. So `{-05..3}` makes `-05` to `-01`, then `000` to `003`.\n *\n * Returns undefined if either end is not a safe integer.\n */\nexport const numericRange = (loStr, hiStr) => {\n let lo = Number(loStr);\n let hi = Number(hiStr);\n if (!Number.isSafeInteger(lo) || !Number.isSafeInteger(hi))\n return;\n if (lo > hi)\n [lo, hi] = [hi, lo];\n const padded = /^-?0\\d/.test(loStr) || /^-?0\\d/.test(hiStr);\n const width = padded ? Math.max(loStr.length, hiStr.length) : 0;\n const out = [];\n if (lo < 0) {\n const neg = nonneg(Math.max(-hi, 1), -lo, width && width - 1);\n out.push(...neg.map(s => [{ t: 'lit', ch: '-' }, ...s]));\n }\n if (hi >= 0)\n out.push(...nonneg(Math.max(lo, 0), hi, width));\n return out;\n};\n//# sourceMappingURL=numeric-range.js.map","// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n// { <posix class>: [<translation>, negated]\nconst posixClasses = {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}'],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}'],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f'],\n '[:blank:]': ['\\\\p{Zs}\\\\t'],\n '[:cntrl:]': ['\\\\p{Cc}'],\n '[:digit:]': ['\\\\p{Nd}'],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true],\n '[:lower:]': ['\\\\p{Ll}'],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}\\\\p{S}'],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f'],\n '[:upper:]': ['\\\\p{Lu}'],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}'],\n '[:xdigit:]': ['A-Fa-f0-9'],\n};\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s) => s.replace(/[[\\]\\\\-]/g, '\\\\$&');\nconst noMatch = /$./;\n// Takes a glob string at a posix brace expression. Returns a RegExp\n// that tests one character, and the number of glob chars consumed.\n// If the class is not closed, consumed is 0, and the `[` must be\n// treated as a literal character.\n// Out of order ranges are removed. If nothing is left, the RegExp\n// is `/$./`, and the rest of the glob is consumed, so that the\n// whole glob cannot match.\nexport const parseClass = (glob, position, nocase = false, form) => {\n // normalize one class member, if it stays one code point\n const norm = (c) => {\n const n = form ? c.normalize(form) : c;\n return [...n].length === 1 ? n : c;\n };\n const pos = position;\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression');\n }\n /* c8 ignore stop */\n const ranges = [];\n const negs = [];\n let i = pos + 1;\n let sawStart = false;\n let escaping = false;\n let negate = false;\n let endPos = pos;\n let rangeStart = '';\n WHILE: while (i < glob.length) {\n const c = String.fromCodePoint(glob.codePointAt(i));\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true;\n i++;\n continue;\n }\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1;\n break;\n }\n sawStart = true;\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true;\n i++;\n continue;\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return [noMatch, glob.length - pos];\n }\n i += cls.length;\n if (neg)\n negs.push(unip);\n else\n ranges.push(unip);\n continue WHILE;\n }\n }\n }\n // now it's just a normal character, effectively\n escaping = false;\n const n = norm(c);\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (n.codePointAt(0) > rangeStart.codePointAt(0)) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(n));\n }\n else if (n === rangeStart) {\n ranges.push(braceEscape(n));\n }\n rangeStart = '';\n i += c.length;\n continue;\n }\n // now might be the start of a range.\n // can be either c-d or c-] or c<more...>] or c] at this point\n if (glob.startsWith('-]', i + c.length)) {\n ranges.push(braceEscape(n + '-'));\n i += c.length + 1;\n continue;\n }\n if (glob.startsWith('-', i + c.length)) {\n rangeStart = n;\n i += c.length + 1;\n continue;\n }\n // not the start of a range, just a single character\n ranges.push(braceEscape(n));\n i += c.length;\n }\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return [noMatch, 0];\n }\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return [noMatch, glob.length - pos];\n }\n const sranges = '[' + (negate ? '^' : '') + ranges.join('') + ']';\n const snegs = '[' + (negate ? '' : '^') + negs.join('') + ']';\n const comb = '^' +\n (ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n : ranges.length ? sranges\n : snegs);\n return [new RegExp(comb, nocase ? 'iu' : 'u'), endPos - pos];\n};\n//# sourceMappingURL=parse-class.js.map","import { numericRange } from './numeric-range.js';\nimport { parseClass } from './parse-class.js';\n// the end of the pattern, or of a negated sub-pattern\nconst MATCH = { t: 'match', id: 0 };\nconst extTypes = '!?+*@';\nconst lit = (ch) => ({ t: 'lit', ch });\nconst reEscape = (s) => s.replace(/[\\\\^$.*+?()[\\]{}|/]/g, '\\\\$&');\n// a RegExp that only matches `s`, with unicode case folding\nconst newFoldRe = (s) => new RegExp(`^${reEscape(s)}$`, 'iu');\n// foldRe for one literal char. The same chars are in most patterns,\n// so keep them. A RegExp without the `g` or `y` flag has no state to\n// share.\nconst foldCache = new Map();\nconst foldRe = (ch) => {\n let re = foldCache.get(ch);\n if (!re) {\n re = newFoldRe(ch);\n if (foldCache.size >= 1000)\n foldCache.clear();\n foldCache.set(ch, re);\n }\n return re;\n};\nconst litMatch = (l, c) => {\n if (c === l.ch)\n return true;\n if (!l.re)\n return false;\n const code = c.charCodeAt(0);\n if (code >= 128)\n return l.re.test(c);\n const ascii = (l.ascii ??= new Uint8Array(128));\n ascii[code] ||= l.re.test(c) ? 1 : 2;\n return ascii[code] === 1;\n};\nconst tokenize = (p, nocase, noext, form, mark) => {\n const toks = [];\n for (let i = 0; i < p.length;) {\n const c = String.fromCodePoint(p.codePointAt(i));\n if (mark) {\n // a \\ before a range would only escape its first char\n const m = c === '\\\\' && p.startsWith(mark, i + 1) ? 1 : 0;\n if (m || c === mark) {\n const start = i + m + mark.length;\n const end = p.indexOf(mark, start);\n const r = /^(-?\\d+)\\.\\.(-?\\d+)$/.exec(p.slice(start, end));\n const alts = end !== -1 && r && numericRange(r[1], r[2]);\n if (alts) {\n toks.push({ t: 'ext', type: '@', alts });\n i = end + mark.length;\n continue;\n }\n }\n }\n if (c === '\\\\') {\n // a trailing \\ is a literal \\\n const e = p.codePointAt(i + 1);\n const ch = e === undefined ? c : String.fromCodePoint(e);\n toks.push(lit(ch));\n i += 1 + ch.length;\n continue;\n }\n if (c === '[') {\n const [re, consumed] = parseClass(p, i, nocase, form);\n if (consumed) {\n toks.push({ t: 'class', re });\n i += consumed;\n continue;\n }\n }\n if (!noext && extTypes.includes(c) && p[i + 1] === '(') {\n toks.push({ t: 'open', type: c });\n i += 2;\n continue;\n }\n toks.push(!noext && c === '|' ? { t: 'bar' }\n : !noext && c === ')' ? { t: 'close' }\n : c === '*' ? { t: 'star' }\n : c === '?' ? { t: 'any' }\n : lit(c));\n i += c.length;\n }\n return toks;\n};\n// map each open token index to the index of its close token\nconst pair = (toks) => {\n const pairs = new Map();\n const stack = [];\n toks.forEach((tok, i) => {\n if (tok.t === 'open')\n stack.push(i);\n else if (tok.t === 'close' && stack.length)\n pairs.set(stack.pop(), i);\n });\n return pairs;\n};\n// build the alternatives between start and end. An open token that\n// is not closed is never inside a closed extglob, so bar and close\n// tokens are only literal at the top level.\nconst build = (toks, pairs, start, end, top) => {\n let seq = [];\n const alts = [seq];\n for (let i = start; i < end; i++) {\n const tok = toks[i];\n const close = pairs.get(i);\n if (tok.t === 'open' && close !== undefined) {\n const sub = build(toks, pairs, i + 1, close, false);\n seq.push({ t: 'ext', type: tok.type, alts: sub });\n i = close;\n }\n else if (tok.t === 'bar' && !top) {\n alts.push((seq = []));\n }\n else if (tok.t === 'open') {\n seq.push(lit(tok.type), lit('('));\n }\n else if (tok.t === 'bar') {\n seq.push(lit('|'));\n }\n else if (tok.t === 'close') {\n seq.push(lit(')'));\n }\n else {\n seq.push(tok);\n }\n }\n return alts;\n};\n// normalize each run of literal chars as one string, so that a char\n// and the combining marks after it compose (or decompose) together.\n// Syntax is already parsed, so a char that normalizes to a syntax\n// char (such as full-width `*` in NFKC) stays a literal.\nconst normalize = (items, form) => {\n const out = [];\n let run = '';\n const flush = () => {\n for (const ch of run.normalize(form))\n out.push(lit(ch));\n run = '';\n };\n for (const it of items) {\n if (it.t === 'lit') {\n run += it.ch;\n continue;\n }\n flush();\n out.push(it.t === 'ext' ?\n { ...it, alts: it.alts.map(a => normalize(a, form)) }\n : it);\n }\n flush();\n return out;\n};\n// the start node, and the number of node ids. Ids are dense, from 0\n// for the match node.\nconst compile = (items, nocase) => {\n let id = 1;\n const split = (out) => ({ t: 'split', id: id++, out });\n const seq = (items, next) => items.reduceRight((next, it) => item(it, next), next);\n const item = (it, next) => {\n switch (it.t) {\n case 'lit':\n const re = nocase ? foldRe(it.ch) : undefined;\n return { t: 'lit', id: id++, ch: it.ch, re, next };\n case 'any':\n case 'star':\n return { t: it.t, id: id++, next };\n case 'class':\n return { t: 'class', id: id++, re: it.re, next };\n }\n const alts = (next) => it.alts.map(a => seq(a, next));\n switch (it.type) {\n case '@':\n return split(alts(next));\n case '?':\n return split([next, ...alts(next)]);\n case '!':\n return { t: 'neg', id: id++, sub: split(alts(MATCH)), next };\n }\n // * and +, loop back after each match\n const after = split([]);\n const entry = split(alts(after));\n after.out.push(next, entry);\n return it.type === '*' ? after : entry;\n };\n const start = seq(items, MATCH);\n return [start, id];\n};\n// one line per node, in the order that a walk from the start\n// reaches them. Edges point to node ids. The nodes of a negated\n// sub-pattern are indented under their negation.\nconst show = (start) => {\n const lines = [];\n const seen = new Set();\n const ref = (n) => (n.t === 'match' ? 'match' : String(n.id));\n const walk = (n, indent) => {\n if (n.t === 'match' || seen.has(n))\n return;\n seen.add(n);\n const line = (desc) => lines.push(`${indent}${n.id}: ${desc}`);\n switch (n.t) {\n case 'split':\n line(`split -> ${n.out.map(ref).join(', ')}`);\n for (const o of n.out)\n walk(o, indent);\n return;\n case 'neg':\n line(`!(${ref(n.sub)}) -> ${ref(n.next)}`);\n walk(n.sub, indent + ' ');\n return walk(n.next, indent);\n case 'lit':\n line(`${JSON.stringify(n.ch)} -> ${ref(n.next)}`);\n break;\n case 'class':\n line(`${n.re} -> ${ref(n.next)}`);\n break;\n default:\n line(`${n.t === 'any' ? '?' : '*'} -> ${ref(n.next)}`);\n }\n walk(n.next, indent);\n };\n walk(start, '');\n return [`start -> ${ref(start)}`, ...lines].join('\\n');\n};\n// The threads at one position in the string. Each node thread is\n// only kept once, and runs with the same state are only kept once,\n// so that identical threads merge. The match node is not in\n// `threads`, because it can not step. It sets `match` instead.\nclass State {\n // set by the Sim, to mark the nodes that this state has\n gen;\n threads = [];\n match = false;\n runs = [];\n // the sorted ids of the threads, with 0 for a match, once the\n // state is done\n ids = [];\n constructor(gen) {\n this.gen = gen;\n }\n // no threads, so nothing more can match\n get dead() {\n return !this.threads.length && !this.match && !this.runs.length;\n }\n}\n// true if the two states hold the same threads\nconst sameState = (a, b) => {\n if (a.ids.length !== b.ids.length)\n return false;\n if (a.runs.length !== b.runs.length)\n return false;\n if (a.ids.some((id, i) => id !== b.ids[i]))\n return false;\n return a.runs.every(r => b.runs.some(o => o.neg === r.neg && sameState(o.state, r.state)));\n};\nconst marks = (size) => ({\n has: new Float64Array(size),\n seen: new Float64Array(size),\n gen: 0,\n});\nclass Sim {\n // `.` and `..` only match literal dots, even with `dot:true`\n dots;\n // the string starts with `.`, and `dot:true` is not set\n dotStart;\n #marks;\n constructor(dots, dotStart, marks) {\n this.dots = dots;\n this.dotStart = dotStart;\n this.#marks = marks;\n }\n state() {\n return new State(++this.#marks.gen);\n }\n // sort the ids of a state, once it has all of its threads\n done(state) {\n state.ids = state.threads.map(n => n.id).sort((a, b) => a - b);\n if (state.match)\n state.ids.unshift(MATCH.id);\n return state;\n }\n // true the first time that the state walks through the node, so\n // that loops in the graph stop\n #visit(state, node) {\n const { seen } = this.#marks;\n if (seen[node.id] === state.gen)\n return false;\n seen[node.id] = state.gen;\n return true;\n }\n #addThread(state, node) {\n const { has } = this.#marks;\n if (has[node.id] === state.gen)\n return false;\n has[node.id] = state.gen;\n state.threads.push(node);\n return true;\n }\n // wildcards only match a leading dot if `dot:true`. In a negated\n // sub-pattern, this does not apply, because the negation itself\n // can not match a leading dot.\n restricted(i, top) {\n return top && (this.dots || (this.dotStart && i === 0));\n }\n add(state, node, i, top) {\n switch (node.t) {\n case 'split':\n if (!this.#visit(state, node))\n return;\n for (const o of node.out)\n this.add(state, o, i, top);\n return;\n case 'neg':\n if (!this.#visit(state, node))\n return;\n const sub = this.state();\n this.add(sub, node.sub, i, false);\n this.done(sub);\n return this.addRun(state, { t: 'run', neg: node, state: sub }, i, top);\n case 'star':\n // a * can not start a dotfile, even if it matches nothing\n if (this.restricted(i, top))\n return;\n if (this.#addThread(state, node))\n this.add(state, node.next, i, top);\n return;\n case 'match':\n state.match = true;\n return;\n default:\n this.#addThread(state, node);\n }\n }\n addRun(state, run, i, top) {\n for (const r of state.runs) {\n if (r.neg === run.neg && sameState(r.state, run.state))\n return;\n }\n state.runs.push(run);\n if (!run.state.match) {\n this.add(state, run.neg.next, i, top);\n }\n }\n // the threads after char `c`, at index `i`\n step(state, c, i, top) {\n const next = this.state();\n for (const th of state.threads) {\n switch (th.t) {\n case 'lit':\n if (litMatch(th, c)) {\n this.add(next, th.next, i + 1, top);\n }\n break;\n case 'any':\n if (!this.restricted(i, top))\n this.add(next, th.next, i + 1, top);\n break;\n case 'class':\n if (!this.restricted(i, top) && th.re.test(c)) {\n this.add(next, th.next, i + 1, top);\n }\n break;\n case 'star':\n if (!this.restricted(i, top))\n this.add(next, th, i + 1, top);\n }\n }\n if (!this.restricted(i, top)) {\n for (const run of state.runs) {\n // a sub-pattern with no threads can not match again, so the\n // run stays the same\n if (run.state.dead) {\n this.addRun(next, run, i + 1, top);\n continue;\n }\n const sub = this.step(run.state, c, i, false);\n this.addRun(next, { t: 'run', neg: run.neg, state: sub }, i + 1, top);\n }\n }\n return this.done(next);\n }\n}\n// A canonical key for the threads in a state. States with the same\n// key hold the same threads, so they match the same strings.\nconst stateKey = (state) => {\n const ids = state.ids.join();\n if (!state.runs.length)\n return ids;\n const runs = state.runs.map(r => `${r.neg.id}(${stateKey(r.state)})`);\n return `${ids}|${runs.sort().join('|')}`;\n};\n// The cache can hold about this many chars of state keys and\n// transitions. When it is full, it is cleared, so that a pattern\n// can not use an unbounded amount of memory.\nconst DFA_BUDGET = 1 << 18;\n// A cache of the states that the simulation reaches, built as the\n// matcher is used. Each char of a string is then one Map lookup,\n// once the states that it leads to are known.\n//\n// The dot rules only restrict the first char of a dotfile (strings\n// that are only `.` or `..` do not use the cache). So a dotfile\n// starts at its own state, which takes its first step with the\n// restriction, and every other state takes steps without it.\nclass Dfa {\n #start;\n #states = new Map();\n #size = 0;\n #plain;\n #dotStart;\n #sim;\n #dotSim;\n constructor(start, marks) {\n this.#start = start;\n this.#sim = new Sim(false, false, marks);\n this.#dotSim = new Sim(false, true, marks);\n }\n #make(state) {\n return {\n state,\n match: state.match,\n dead: state.dead,\n next: new Map(),\n };\n }\n #intern(state) {\n const key = stateKey(state);\n const found = this.#states.get(key);\n if (found)\n return found;\n if (this.#size > DFA_BUDGET)\n this.#clear();\n const d = this.#make(state);\n this.#states.set(key, d);\n this.#size += key.length + 1;\n return d;\n }\n #clear() {\n this.#states.clear();\n this.#size = 0;\n this.#plain = undefined;\n this.#dotStart = undefined;\n }\n start(dotStart) {\n if (dotStart) {\n if (this.#dotStart)\n return this.#dotStart;\n const state = this.#dotSim.state();\n this.#dotSim.add(state, this.#start, 0, true);\n return (this.#dotStart = this.#make(this.#dotSim.done(state)));\n }\n if (this.#plain)\n return this.#plain;\n const state = this.#sim.state();\n this.#sim.add(state, this.#start, 0, true);\n return (this.#plain = this.#intern(this.#sim.done(state)));\n }\n // the next state, after a miss in `d.ascii`\n next(d, c) {\n const code = c.charCodeAt(0);\n const found = code < 128 ? undefined : d.next.get(c);\n if (found)\n return found;\n // the dotfile start is not in the cache, so it is never shared\n const n = d === this.#dotStart ?\n this.#intern(this.#dotSim.step(d.state, c, 0, true))\n : this.#intern(this.#sim.step(d.state, c, 1, true));\n if (code < 128) {\n if (!d.ascii) {\n d.ascii = new Array(128);\n this.#size += 128;\n }\n d.ascii[code] = n;\n }\n else {\n d.next.set(c, n);\n }\n this.#size++;\n return n;\n }\n}\n// the nodes in order, if the graph is a single chain\nconst linear = (start) => {\n const nodes = [];\n for (let n = start; n.t !== 'match'; n = n.next) {\n if (n.t === 'split' || n.t === 'neg')\n return undefined;\n nodes.push(n);\n }\n return nodes;\n};\n// Match a chain of nodes. Each node other than `*` matches exactly\n// one char, so on a failure it is enough to go back to the last `*`\n// and let it match one more char. This takes at most\n// nodes.length * chars.length steps.\nconst testLinear = (nodes, chars, start, end) => {\n let ni = 0;\n let ci = start;\n let starNi = -1;\n let starCi = 0;\n while (ci < end) {\n const n = nodes[ni];\n if (n?.t === 'star') {\n starNi = ni++;\n starCi = ci;\n continue;\n }\n const c = chars[ci];\n if (n &&\n (n.t === 'any' ||\n (n.t === 'lit' && litMatch(n, c)) ||\n (n.t === 'class' && n.re.test(c)))) {\n ni++;\n ci++;\n continue;\n }\n if (starNi === -1)\n return false;\n ni = starNi + 1;\n ci = ++starCi;\n }\n while (nodes[ni]?.t === 'star')\n ni++;\n return ni === nodes.length;\n};\n// The least and most chars that the items can match. These are only\n// bounds: a negation can match a string of any length, so it counts\n// as 0 to Infinity.\nconst lengths = (items) => {\n let min = 0;\n let max = 0;\n for (const it of items) {\n const [lo, hi] = itemLengths(it);\n min += lo;\n max += hi;\n }\n return [min, max];\n};\nconst itemLengths = (it) => {\n if (it.t === 'star')\n return [0, Infinity];\n if (it.t !== 'ext')\n return [1, 1];\n if (it.type === '!')\n return [0, Infinity];\n const alts = it.alts.map(lengths);\n const min = Math.min(...alts.map(a => a[0]));\n const max = Math.max(...alts.map(a => a[1]));\n // a loop of alternatives that only match the empty string is empty\n const loop = max === 0 ? 0 : Infinity;\n return (it.type === '@' ? [min, max]\n : it.type === '?' ? [0, max]\n : it.type === '*' ? [0, loop]\n : [min, loop]);\n};\n// true if the chars from `start` match the literals\nconst hasAffix = (lits, chars, start) => {\n for (let j = 0; j < lits.length; j++) {\n if (!litMatch(lits[j], chars[start + j]))\n return false;\n }\n return true;\n};\n// a `/`, or half of a surrogate pair\nconst slashOrSurrogate = /[/\\ud800-\\udfff]/;\nconst surrogate = /[\\ud800-\\udfff]/;\n// a string can be indexed by code point, unless it has surrogate\n// pairs\nconst codePoints = (s) => surrogate.test(s) ? [...s] : s;\nconst noSlash = (s) => {\n if (s.includes('/')) {\n throw new Error('can only match a single path portion, got: ' + s);\n }\n};\nexport class Matcher {\n pattern;\n options;\n #start;\n // the number of node ids\n #size;\n #marks;\n // the Sim for strings that are only `.` or `..`\n #dotsSim;\n // the string to compare, if the pattern has no magic. With\n // `nocase:true`, the RegExp that folds case is made when it is\n // first used.\n #literal;\n #literalFold = false;\n #literalRe;\n // the nodes between the prefix and suffix, if the graph is a\n // single chain\n #linear;\n // the linear nodes are only `*` and `?`, so the length bounds and\n // the prefix and suffix decide the match\n #wild = false;\n // the least and most chars that a match can have\n #min = 0;\n #max = Infinity;\n // the literals that a match must start and end with. Each one\n // matches exactly one char, and they are distinct items in the\n // pattern, so a string that does not have them can not match.\n #prefix = [];\n #suffix = [];\n // the prefix and suffix as strings, if they do not fold case\n #prefixStr;\n #suffixStr;\n // there is a prefix or suffix to check\n #affix = false;\n #dfa;\n #form;\n constructor(pattern, options = {}) {\n if (pattern.includes('/')) {\n throw new Error('can only match a single path portion, got pattern: ' + pattern);\n }\n this.pattern = pattern;\n this.options = options;\n const { nocase = false, noext = false, normalize: n } = options;\n this.#form = n === true ? 'NFC' : n || undefined;\n // a pattern that is only an empty extglob is a literal string,\n // except for `!()`, which matches any non-empty string\n const literal = /^[?*+@]\\(\\)$/.test(pattern);\n const toks = tokenize(pattern, nocase, noext || literal, this.#form, options.rangeMark);\n let [items] = build(toks, pair(toks), 0, toks.length, true);\n if (this.#form)\n items = normalize(items, this.#form);\n const [start, size] = compile(items, nocase);\n this.#start = start;\n this.#size = size;\n if (items.every(it => it.t === 'lit')) {\n this.#literal = items.map(it => it.ch).join('');\n this.#literalFold = nocase;\n }\n else {\n const lit = (it) => it.t !== 'lit' ? undefined\n : nocase ? { ch: it.ch, re: foldRe(it.ch) }\n : { ch: it.ch };\n for (const it of items) {\n const l = lit(it);\n if (!l)\n break;\n this.#prefix.push(l);\n }\n for (let j = items.length - 1; j >= 0; j--) {\n const l = lit(items[j]);\n if (!l)\n break;\n this.#suffix.unshift(l);\n }\n this.#affix = !!(this.#prefix.length || this.#suffix.length);\n if (!nocase) {\n this.#prefixStr = this.#prefix.map(l => l.ch).join('');\n this.#suffixStr = this.#suffix.map(l => l.ch).join('');\n }\n this.#linear = linear(this.#start)?.slice(this.#prefix.length, -this.#suffix.length || undefined);\n this.#wild = !!this.#linear?.every(n => n.t === 'star' || n.t === 'any');\n const [min, max] = lengths(items);\n this.#min = min;\n this.#max = max;\n }\n }\n test(s) {\n // The `/` check uses the string as given, so with normalization it\n // is a separate step. Otherwise, one scan finds both a `/` and the\n // surrogate pairs that stop the string being indexed by code point.\n if (this.#form) {\n noSlash(s);\n return this.#test(s.normalize(this.#form));\n }\n if (slashOrSurrogate.test(s)) {\n noSlash(s);\n return this.#test(s, [...s]);\n }\n return this.#test(s, s);\n }\n /**\n * The same as {@link Matcher#test}, but the string is not checked\n * for `/` chars, so the result for a string that has one is not\n * defined. Only use it for a string that is known to be one path\n * portion, such as a part of a path that was split on `/`. It can\n * be faster, because some patterns do not need to look at each char\n * of the string.\n */\n testUnchecked(s) {\n return this.#test(this.#form ? s.normalize(this.#form) : s);\n }\n // Test a string that has no `/`. `chars` indexes it by code point.\n // If it is not given, it is only found if a step needs it.\n #test(s, chars) {\n if (this.#literal !== undefined) {\n return this.#literalFold ?\n (this.#literalRe ??= newFoldRe(this.#literal)).test(s)\n : s === this.#literal;\n }\n // the length check means that the prefix and suffix do not\n // overlap. Without the chars, the length in code points is from\n // half of the UTF-16 length (if each one is a surrogate pair) to\n // all of it, which is often enough to know.\n const min = this.#min;\n const max = this.#max;\n if (chars === undefined) {\n const most = s.length;\n const least = (most + 1) >> 1;\n if (most < min || least > max)\n return false;\n if (least < min || most > max)\n chars = codePoints(s);\n }\n if (chars !== undefined &&\n (chars.length < min || chars.length > max)) {\n return false;\n }\n const prefix = this.#prefix.length;\n if (this.#affix) {\n if (this.#prefixStr !== undefined && this.#suffixStr !== undefined) {\n if (!s.startsWith(this.#prefixStr) ||\n !s.endsWith(this.#suffixStr)) {\n return false;\n }\n }\n else {\n chars ??= codePoints(s);\n const end = chars.length - this.#suffix.length;\n if (!hasAffix(this.#prefix, chars, 0) ||\n !hasAffix(this.#suffix, chars, end)) {\n return false;\n }\n }\n }\n const dotStart = !this.options.dot && s.startsWith('.');\n if (this.#linear) {\n // `.` and `..` only match literal dots, even with `dot:true`\n if (s === '.' || s === '..')\n return false;\n // only a literal can match the leading dot. A `*` can not\n // start a dotfile, even if it matches nothing.\n if (dotStart && !prefix)\n return false;\n if (this.#wild)\n return true;\n chars ??= codePoints(s);\n const end = chars.length - this.#suffix.length;\n return testLinear(this.#linear, chars, prefix, end);\n }\n chars ??= codePoints(s);\n if (s === '.' || s === '..') {\n this.#marks ??= marks(this.#size);\n const sim = (this.#dotsSim ??= new Sim(true, false, this.#marks));\n const start = sim.state();\n sim.add(start, this.#start, 0, true);\n let state = sim.done(start);\n for (let i = 0; i < chars.length; i++) {\n state = sim.step(state, chars[i], i, true);\n }\n return state.match;\n }\n this.#marks ??= marks(this.#size);\n const dfa = (this.#dfa ??= new Dfa(this.#start, this.#marks));\n let d = dfa.start(dotStart);\n // read char codes from the string, so that a one-char string is\n // only made for a cache miss\n const str = chars === s;\n for (let i = 0; i < chars.length; i++) {\n if (d.dead)\n return false;\n const code = str ? s.charCodeAt(i) : chars[i].charCodeAt(0);\n d = d.ascii?.[code] ?? dfa.next(d, chars[i]);\n }\n return d.match;\n }\n /** a readable listing of the state machine */\n toString() {\n return show(this.#start);\n }\n}\n//# sourceMappingURL=index.js.map","const MAX_PATTERN_LENGTH = 1024 * 64;\nexport const assertValidPattern = (pattern) => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern');\n }\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long');\n }\n};\n//# sourceMappingURL=assert-valid-pattern.js.map","/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n *\n * A leading `#` or `!` is escaped as well, so that the result is never a\n * comment or a negated pattern. In `windowsPathsNoEscape` mode, a leading\n * `!` is written as `@(!)`, because `[!` starts a negated class.\n */\nexport const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n // However, at the start of the pattern, '!' negates the pattern and\n // '#' makes it a comment, so the first character is handled below.\n const e = magicalBraces ?\n windowsPathsNoEscape ? s.replace(/[?*()[\\]{}]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&')\n : windowsPathsNoEscape ? s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&');\n const c = e.charAt(0);\n if (c === '#') {\n return (windowsPathsNoEscape ? '[#]' : '\\\\#') + e.slice(1);\n }\n if (c === '!') {\n // '[!]' can not be used, because '[!' starts a negated class, and\n // '\\' is a path separator in windowsPathsNoEscape mode. '@(!)'\n // matches only '!'. If extglobs are disabled with `noext`, it\n // matches nothing, rather than everything.\n return (windowsPathsNoEscape ? '@(!)' : '\\\\!') + e.slice(1);\n }\n return e;\n};\n//# sourceMappingURL=escape.js.map","/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\nexport const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {\n // escape() writes a leading '!' as '@(!)' in windowsPathsNoEscape mode\n if (windowsPathsNoEscape && s.startsWith('@(!)')) {\n return ('!' + unescape(s.slice(4), { windowsPathsNoEscape, magicalBraces }));\n }\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n .replace(/\\\\([^/])/g, '$1');\n }\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n .replace(/\\\\([^/{}])/g, '$1');\n};\n//# sourceMappingURL=unescape.js.map","import { expand } from 'brace-expansion';\nimport { Matcher } from '@isaacs/nonrecursive-glob-match';\nimport { assertValidPattern } from './assert-valid-pattern.js';\nimport { escape } from './escape.js';\nimport { unescape } from './unescape.js';\nconst DEFAULT_BRACE_EXPAND_MAX = 100_000;\nconst DEFAULT_GLOB_STAR_RECURSION_MAX = 200;\n// avoid the annoying deprecation flag lol\nconst AWE_KEY = ('allowWindow' + 'sEscape');\nexport const minimatch = (p, pattern, options) => {\n assertValidPattern(pattern);\n // shortcut: comments match nothing.\n if (!options?.nocomment && pattern.charAt(0) === '#') {\n return false;\n }\n return cachedMinimatch(pattern, options).match(p);\n};\n// The Minimatch objects that minimatch() used most recently, by options\n// and then by pattern. When the cache is full, it becomes the old one,\n// and the objects used from the old one are moved back to a new one.\n// So it keeps 256 to 512 objects.\n// The patterns can come from users, so the cache is also bounded by\n// the total weight of the objects (see cacheWeight()), and an object\n// that is too heavy is never kept. Otherwise a few unique patterns\n// with large brace expansions would fill the heap.\nlet cache = new Map();\nlet oldCache = new Map();\nlet cacheSize = 0;\nlet cacheTotalWeight = 0;\nconst cacheMax = 256;\nconst cacheMaxWeight = 1 << 15;\nconst cacheMaxEntryWeight = 1 << 12;\n// About the memory that a compiled object keeps: the pattern and the\n// expanded patterns, of which each row in set is made.\nconst cacheWeight = (mm) => {\n let w = mm.pattern.length;\n for (const s of mm.globSet) {\n w += s.length + 1;\n if (w > cacheMaxEntryWeight)\n break;\n }\n return w;\n};\n// tsc fails here if a new option is in neither type. Add it to\n// optionsKey() too.\nconst allOptionsKeyed = true;\nvoid allOptionsKeyed;\n// 0, 1 or 2 for undefined, falsy or truthy.\nconst tri = (v) => v === undefined ? 0\n : v ? 2\n : 1;\n// The weight of each boolean option's base-3 digit in the key. The\n// weights below 24 are for optimizationLevel (1), platform (3) and\n// windowsPathsNoEscape (12). tsc fails here if a boolean option is\n// not in the list.\nconst booleanWeights = new Map(Object.keys({\n nobrace: 0,\n nocomment: 0,\n nonegate: 0,\n noglobstar: 0,\n noext: 0,\n nonull: 0,\n partial: 0,\n dot: 0,\n nocase: 0,\n nocaseMagicOnly: 0,\n magicalBraces: 0,\n matchBase: 0,\n flipNegate: 0,\n preserveMultipleSlashes: 0,\n windowsNoMagicRoot: 0,\n}).map((k, i) => [k, 24 * 3 ** i]));\n// The cache key for a set of options. It is a number, unless an\n// option is set to a value that the number can not show, such as\n// normalize or an uncommon platform. Then it is a JSON string.\n// The defaults give 0, the same key as no options.\n// It only reads the keys that are set, so that the speed does not\n// depend on the shape of the options object.\nconst optionsKey = (o) => {\n let n = 0;\n let wpe = false;\n // inherited keys too, because Minimatch reads them\n // oxlint-disable-next-line guard-for-in\n for (const k in o) {\n const v = o[k];\n switch (k) {\n // the same test as the Minimatch constructor\n case 'windowsPathsNoEscape':\n if (v)\n wpe = true;\n break;\n case AWE_KEY:\n if (v === false)\n wpe = true;\n break;\n case 'platform': {\n // the same test as the Minimatch constructor\n const p = v || defaultPlatform;\n if (p === defaultPlatform)\n break;\n if (p === 'darwin')\n n += 3;\n else if (p === 'win32')\n n += 6;\n else if (p === 'linux')\n n += 9;\n else\n return JSON.stringify(o);\n break;\n }\n case 'optimizationLevel':\n // The same tests as Minimatch: 1 when undefined, then >= 2,\n // >= 1, or else 0. The default level 1 adds 0.\n if (v === undefined)\n break;\n n +=\n v >= 2 ? 1\n : v >= 1 ? 0\n : 2;\n break;\n case 'braceExpandMax':\n if (v !== undefined && v !== DEFAULT_BRACE_EXPAND_MAX) {\n return JSON.stringify(o);\n }\n break;\n case 'maxGlobstarRecursion':\n if (v !== undefined && v !== DEFAULT_GLOB_STAR_RECURSION_MAX) {\n return JSON.stringify(o);\n }\n break;\n case 'normalize':\n if (v !== undefined)\n return JSON.stringify(o);\n break;\n default:\n // unknown keys have no weight\n n += (booleanWeights.get(k) ?? 0) * tri(v);\n }\n }\n return wpe ? n + 12 : n;\n};\n// A copy, so a later change to the options can not change it. Unlike\n// a spread, it keeps the inherited keys, which optionsKey() and the\n// Minimatch constructor also read.\nconst copyOptions = (o) => {\n const copy = {};\n // oxlint-disable-next-line guard-for-in\n for (const k in o)\n copy[k] = o[k];\n return copy;\n};\nconst cachedMinimatch = (pattern, options) => {\n const key = options ? optionsKey(options) : 0;\n let mm = cache.get(key)?.get(pattern);\n if (mm)\n return mm;\n mm =\n oldCache.get(key)?.get(pattern) ??\n new Minimatch(pattern, copyOptions(options));\n const weight = cacheWeight(mm);\n // too big to keep, so it is compiled again each time\n if (weight > cacheMaxEntryWeight)\n return mm;\n if (cacheSize >= cacheMax ||\n cacheTotalWeight + weight > cacheMaxWeight) {\n oldCache = cache;\n cache = new Map();\n cacheSize = 0;\n cacheTotalWeight = 0;\n }\n let byPattern = cache.get(key);\n if (!byPattern)\n cache.set(key, (byPattern = new Map()));\n byPattern.set(pattern, mm);\n cacheSize++;\n cacheTotalWeight += weight;\n return mm;\n};\n/* c8 ignore start */\nconst defaultPlatform = (typeof process === 'object' && process ?\n process.env?.__MINIMATCH_TESTING_PLATFORM__ || process.platform\n : 'posix');\nconst path = {\n win32: { sep: '\\\\' },\n posix: { sep: '/' },\n};\n/* c8 ignore stop */\nexport const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;\nminimatch.sep = sep;\nexport const GLOBSTAR = Symbol('globstar **');\nminimatch.GLOBSTAR = GLOBSTAR;\nexport const filter = (pattern, options) => {\n let mm;\n return (p) => (mm ??= cachedMinimatch(pattern, options)).match(p);\n};\nminimatch.filter = filter;\nconst ext = (a, b = {}) => Object.assign({}, a, b);\nexport const defaults = (def) => {\n if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n return minimatch;\n }\n const orig = minimatch;\n const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));\n return Object.assign(m, {\n Minimatch: class Minimatch extends orig.Minimatch {\n constructor(pattern, options = {}) {\n super(pattern, ext(def, options));\n }\n static defaults(options) {\n return orig.defaults(ext(def, options)).Minimatch;\n }\n },\n unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),\n escape: (s, options = {}) => orig.escape(s, ext(def, options)),\n filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),\n defaults: (options) => orig.defaults(ext(def, options)),\n braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),\n match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),\n sep: orig.sep,\n GLOBSTAR: GLOBSTAR,\n });\n};\nminimatch.defaults = defaults;\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (pattern, options = {}) => {\n assertValidPattern(pattern);\n // Thanks to Yeting Li <https://github.com/yetingli> for\n // improving this regexp to avoid a ReDOS vulnerability.\n if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n // shortcut. no need to expand.\n return [pattern];\n }\n // brace-expansion turns each escaped backslash '\\\\' into a single '\\',\n // which then escapes the next character instead, and can turn an\n // escaped magic character (for example '\\\\\\*') into a live one.\n // Double every pair, so an escaped backslash comes back out still\n // escaped. The parity of each run of backslashes is unchanged.\n let p = pattern.replace(/\\\\\\\\/g, '\\\\\\\\\\\\\\\\');\n // brace-expansion does not know about [...] classes. In\n // windowsPathsNoEscape mode, escape() writes a literal brace as '[{]'\n // or '[}]'. Escape the brace for brace-expansion, which removes that\n // backslash again, leaving '[{]' or '[}]'.\n if (options.windowsPathsNoEscape || options[AWE_KEY] === false) {\n p = p.replace(/\\[([{}])\\]/g, '[\\\\$1]');\n }\n return expand(p, { max: options.braceExpandMax });\n};\nminimatch.braceExpand = braceExpand;\n// A numeric range with at least this many values is matched as one\n// pattern portion, rather than expanded. For a glob walk, that is\n// one directory read, in place of a stat for each value.\nconst RANGE_MIN = 100;\n// a {lo..hi} range that is not escaped, and not a ${...} variable\nconst rangeRe = /(?<![\\\\$])\\{(-?\\d+)\\.\\.(-?\\d+)\\}/g;\n// true if a range mark in this portion is inside a `!(...)`,\n// `*(...)` or `+(...)` extglob. Those repeat or negate their\n// contents, so one Matcher for the whole range does not match the\n// same strings as the union of one pattern per value. For example,\n// `*({1..100})` would match `510` as `5` then `10`, and `!({1..100})`\n// would not match `5`, but every expanded pattern except `!(5)` does.\n// `@(...)` and `?(...)` are fine: they pick one value at most.\nconst inRepeatOrNegExt = (portion, mark) => {\n const stack = [];\n for (let i = 0; i < portion.length; i++) {\n const c = portion.charAt(i);\n if (c === '\\\\') {\n i++;\n }\n else if (c === mark) {\n if (stack.some(t => t !== '@' && t !== '?'))\n return true;\n }\n else if (portion.charAt(i + 1) === '(' && '!?+*@'.includes(c)) {\n stack.push(c);\n i++;\n }\n else if (c === ')') {\n stack.pop();\n }\n }\n return false;\n};\nexport const match = (list, pattern, options = {}) => {\n const mm = new Minimatch(pattern, options);\n list = list.filter(f => mm.match(f));\n if (mm.options.nonull && !list.length) {\n list.push(pattern);\n }\n return list;\n};\nminimatch.match = match;\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/;\n// Index of the `]` that closes the class that starts at `start`,\n// or -1 if it is not closed. Posix classes such as `[:alpha:]` are\n// not skipped, so this can find a `]` before the real end. That\n// only makes a class look less like a literal.\nconst classEnd = (pattern, start) => {\n let i = start + 1;\n if (pattern.charAt(i) === '!' || pattern.charAt(i) === '^')\n i++;\n let sawStart = false;\n for (; i < pattern.length; i++) {\n const c = pattern.charAt(i);\n if (c === ']' && sawStart)\n return i;\n sawStart = true;\n if (c === '\\\\')\n i++;\n }\n return -1;\n};\n// If a path portion pattern has no magic, return the string it\n// matches. Otherwise, return undefined. This can report magic for\n// a pattern that is in fact literal (eg, `[]`), but never the\n// reverse, so a string result is always safe to compare directly.\nconst literal = (pattern, noext) => {\n if (!noext && (pattern === '+()' || pattern === '@()'))\n return pattern;\n let lit = '';\n for (let i = 0; i < pattern.length; i++) {\n const c = pattern.charAt(i);\n if (c === '\\\\') {\n // a trailing \\ is a literal \\\n lit += pattern.charAt(++i) || c;\n }\n else if (c === '*' || c === '?') {\n return undefined;\n }\n else if (c === '[') {\n const close = classEnd(pattern, i);\n if (close === -1) {\n // not closed, so the [ is a literal\n lit += c;\n continue;\n }\n // a class of one char, such as `[*]` or `[\\b]`, is a literal\n let body = pattern.slice(i + 1, close);\n if (body.startsWith('\\\\'))\n body = body.slice(1);\n if ([...body].length !== 1 || '!^'.includes(pattern.charAt(i + 1))) {\n return undefined;\n }\n lit += body;\n i = close;\n }\n else if (!noext &&\n '+@!'.includes(c) &&\n pattern.charAt(i + 1) === '(' &&\n pattern.includes(')', i + 2)) {\n return undefined;\n }\n else {\n lit += c;\n }\n }\n return lit;\n};\n// The matching engine compiles and walks extglobs recursively, so a\n// path portion with very many extglobs (nested, such as `*(*(*(a)))`,\n// or in a row, such as `?(a)?(a)?(a)`) can exhaust the call stack.\n// Portions with more than this many extglobs are rejected.\nconst MAX_EXTGLOBS = 256;\n// The number of extglob openers, such as `*(`, in a path portion\n// pattern. Chars in a class are counted too, so this can be more than\n// the number of extglobs, but never less.\nconst extglobCount = (pattern) => {\n let n = 0;\n for (let i = 0; i < pattern.length - 1; i++) {\n const c = pattern.charAt(i);\n if (c === '\\\\') {\n i++;\n }\n else if ('+@!?*'.includes(c) && pattern.charAt(i + 1) === '(') {\n n++;\n i++;\n }\n }\n return n;\n};\nconst assertValidExtglobs = (pattern) => {\n if (extglobCount(pattern) > MAX_EXTGLOBS) {\n throw new TypeError('pattern has too many extglobs');\n }\n};\n// True if the portion pattern has the same meaning as an alternative\n// inside `@(...)`. It must not have a `|` or `)` that is not in a\n// closed extglob (those are literal at the top level), an extglob\n// that is not closed (the `)` of the `@(...)` would close it), or a\n// trailing `\\` (it would escape the next `|`). A pattern that is\n// only an empty extglob, such as `?()`, is literal on its own, but\n// not in `@(...)`. Posix classes such as `[:alpha:]` can hide a `]`\n// from classEnd, so patterns with them are not merged.\nconst extSafe = (pattern) => {\n if (/^[?*+@]\\(\\)$/.test(pattern) || pattern.includes('[:'))\n return false;\n let depth = 0;\n for (let i = 0; i < pattern.length; i++) {\n const c = pattern.charAt(i);\n if (c === '\\\\') {\n if (++i === pattern.length)\n return false;\n }\n else if (c === '[') {\n const close = classEnd(pattern, i);\n if (close !== -1)\n i = close;\n }\n else if ('+@!?*'.includes(c) && pattern.charAt(i + 1) === '(') {\n depth++;\n i++;\n }\n else if (c === ')') {\n if (!depth--)\n return false;\n }\n else if (c === '|' && !depth) {\n return false;\n }\n }\n return !depth;\n};\n// The last path that Minimatch#match split, and its parts. A path is\n// often tested against many patterns in a row (such as a list of\n// ignore patterns), so this saves splitting it again. The parts are\n// never changed, so they can be shared.\nlet lastSplit;\n// The last path that Minimatch#match checked before splitting it. If\n// the same path is checked again, it is being tested against many\n// patterns, so it is split and the parts are kept for the others.\nlet lastChecked;\n// true if a pattern portion that is not ** matches a path portion.\n// An empty path portion only matches an empty pattern portion. A path\n// portion never has a `/`, so the Matcher does not need to check it.\nconst portionMatch = (p, f) => typeof p === 'string' ? f === p : f !== '' && p.testUnchecked(f);\n// Where the last portion of a row matches in a path: the start of the\n// last portion of the path, or of the one before a trailing `/`. -1 if\n// it matches neither.\nconst endIndex = (p, last, lastStart, prev, prevStart) => portionMatch(p, last) ? lastStart\n : prev !== undefined && portionMatch(p, prev) ? prevStart\n : -1;\nconst isDots = (p) => p === '.' || p === '..';\n// a Windows drive letter portion, like `c:`\nconst isDrive = (p) => typeof p === 'string' && /^[a-z]:$/i.test(p);\n// true for the `UNC` portion of a long UNC root, //?/UNC/host/share\nconst isLongUNC = (p) => typeof p === 'string' && /^unc$/i.test(p);\n// The index of the host in a row or split path that starts with a\n// Windows UNC root: 2 for `//host/share`, and 4 for\n// `//?/UNC/host/share`. Otherwise -1. `//?/c:` is not one.\nconst uncHost = (p) => {\n if (p[0] !== '' || p[1] !== '')\n return -1;\n const h = p[2] !== '?' ? 2\n : isLongUNC(p[3]) ? 4\n : -1;\n const host = p[h];\n const share = p[h + 1];\n return (h !== -1 &&\n host !== undefined &&\n host !== '' &&\n host !== GLOBSTAR &&\n share !== undefined &&\n share !== '' &&\n share !== GLOBSTAR) ?\n h\n : -1;\n};\n// true if ** can walk the path portion: not `.` or `..`, and not a\n// dotfile unless `dot` is set\nconst walkable = (p, dot) => !isDots(p) && (dot || !p.startsWith('.'));\n// True if a portion of the path from `start` to `end` can not be\n// walked by **: one that starts with `.`, or with `dot`, one that is\n// `.` or `..`. `start` is the start of a portion, and `end` is the end\n// of the path, or just after a separator.\nconst dotPortion = (f, start, end, dot, sep) => {\n for (let k = start; k < end;) {\n if (f.charCodeAt(k) === 46) {\n if (!dot)\n return true;\n const n = f.charCodeAt(k + 1) === 46 ? k + 2 : k + 1;\n if (n >= end || isSep(f.charCodeAt(n), sep))\n return true;\n }\n // the start of the next portion, after any run of separators\n const s = nextSep(f, k, sep);\n if (s === -1)\n return false;\n k = s + 1;\n while (k < end && isSep(f.charCodeAt(k), sep))\n k++;\n }\n return false;\n};\nconst isSep = (c, sep) => sep === '/' ? c === 47\n : sep === '\\\\' ? c === 92\n : c === 47 || c === 92;\n// the index of the first separator at or after `from`, or -1\nconst nextSep = (f, from, sep) => {\n if (sep !== 'both')\n return f.indexOf(sep, from);\n const s = f.indexOf('/', from);\n const b = f.indexOf('\\\\', from);\n return (s === -1 ? b\n : b === -1 ? s\n : Math.min(s, b));\n};\n// the index of the last separator at or before `from`, or -1\nconst lastSep = (f, from, sep) => sep !== 'both' ?\n f.lastIndexOf(sep, from)\n : Math.max(f.lastIndexOf('/', from), f.lastIndexOf('\\\\', from));\n// What parse() returns in place of a Matcher while make() builds and\n// merges the rows. Most of the Matchers in rows that are merged would\n// never be used, so they are only made for the rows that are left.\nconst PENDING = {};\nexport class Minimatch {\n options;\n set;\n pattern;\n windowsPathsNoEscape;\n nonegate;\n negate;\n comment;\n empty;\n preserveMultipleSlashes;\n partial;\n globSet;\n globParts;\n nocase;\n isWindows;\n platform;\n windowsNoMagicRoot;\n maxGlobstarRecursion;\n // the path can be checked against the last portion, and the string\n // portions, of each row before it is split. See #canMatch.\n #endCheck;\n #literalCheck;\n // level 2 resolves `.` and `..` portions in the path\n #level2;\n // the unicode normalization form, if any\n #form;\n // the string portions of each row in the set\n #literals = [];\n // the rows that #canMatch can match without splitting the path\n #shapes = [];\n // the rows whose last portion can be checked against the path's\n #endRows = [];\n // brace expansion can make the same portion in many rows, so they\n // share one Matcher, and the states that it caches\n #matchers = new Map();\n // parse() returns PENDING in place of a Matcher\n #pending = false;\n // the char that marks numeric ranges in globSet, if any\n #rangeMark;\n // the GlobstarParts of each pattern row, by start index and partial\n #globstarParts = new WeakMap();\n constructor(pattern, options = {}) {\n assertValidPattern(pattern);\n options = options || {};\n this.options = options;\n this.maxGlobstarRecursion =\n options.maxGlobstarRecursion ?? DEFAULT_GLOB_STAR_RECURSION_MAX;\n this.pattern = pattern;\n this.platform = options.platform || defaultPlatform;\n this.isWindows = this.platform === 'win32';\n this.windowsPathsNoEscape =\n !!options.windowsPathsNoEscape || options[AWE_KEY] === false;\n if (this.windowsPathsNoEscape) {\n this.pattern = this.pattern.replace(/\\\\/g, '/');\n }\n this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;\n this.negate = false;\n this.nonegate = !!options.nonegate;\n this.comment = false;\n this.empty = false;\n this.partial = !!options.partial;\n this.nocase = !!this.options.nocase;\n this.windowsNoMagicRoot =\n options.windowsNoMagicRoot !== undefined ?\n options.windowsNoMagicRoot\n : !!(this.isWindows && this.nocase);\n this.globSet = [];\n this.globParts = [];\n this.set = [];\n this.#endCheck = !this.preserveMultipleSlashes;\n this.#level2 = (options.optimizationLevel ?? 1) >= 2;\n const n = options.normalize;\n this.#form = n === true ? 'NFC' : n || undefined;\n // make the set of Matchers etc.\n this.make();\n // On Windows, the portions of a row up to its drive letter or UNC\n // share are skipped or compared without case, if the path has one\n // too. So the checks only use the portions after it.\n const drives = this.set.map(row => this.#rootIndex(row));\n this.#endRows = this.set.map((row, r) => this.#endCheck && row.length - 1 > drives[r]);\n // with the end check, the last portion is already checked\n this.#literals = this.set.map((row, r) => {\n const end = this.#endRows[r] ? row.length - 1 : row.length;\n const lits = row\n .slice(drives[r] + 1, end)\n .filter((p) => typeof p === 'string' && !!p);\n return [...new Set(lits)];\n });\n this.#literalCheck = this.#literals.some(l => l.length);\n this.#shapes = this.set.map((row, r) => {\n const [p0, p1, p2] = row;\n if (this.#endRows[r] && row.length === 2) {\n if (p0 === GLOBSTAR && p1 !== GLOBSTAR)\n return 'tail';\n }\n // the basename of a path that is split on / is its last portion,\n // or the one before a trailing /, the same as the end check\n if (this.#endRows[r] &&\n options.matchBase &&\n row.length === 1 &&\n p0 !== GLOBSTAR &&\n p0 !== '') {\n return 'base';\n }\n // the portion must not be a root, or '', which can be a\n // different portion on Windows (where //x paths get an extra '')\n if (!this.#endCheck || drives[r] !== -1)\n return undefined;\n if (row.length === 3 &&\n p0 === GLOBSTAR &&\n p2 === GLOBSTAR &&\n p1 !== GLOBSTAR &&\n p1 !== '' &&\n // the portion between is only matched below this limit\n this.maxGlobstarRecursion > 0) {\n return 'mid';\n }\n if (row.length === 2 &&\n p1 === GLOBSTAR &&\n p0 !== GLOBSTAR &&\n p0 !== '') {\n return 'head';\n }\n return undefined;\n });\n }\n // a string portion of a pattern, normalized if the option is set\n #norm(p) {\n return this.#form ? p.normalize(this.#form) : p;\n }\n // On Windows, the index of the last root portion of a row, as\n // #matchRow finds it: 0 for `c:/...`, 3 for `//?/c:/...` and\n // `//host/share/...`, and 5 for `//?/UNC/host/share/...`. Otherwise\n // -1.\n #rootIndex(row) {\n if (!this.isWindows)\n return -1;\n if (isDrive(row[0]))\n return 0;\n const uncDrive = row[0] === '' && row[1] === '' && row[2] === '?' && isDrive(row[3]);\n if (uncDrive)\n return 3;\n const h = uncHost(row);\n return h === -1 ? -1 : h + 1;\n }\n hasMagic() {\n if (this.options.magicalBraces && this.set.length > 1) {\n return true;\n }\n for (const pattern of this.set) {\n for (const part of pattern) {\n if (typeof part !== 'string')\n return true;\n }\n }\n return false;\n }\n make() {\n const pattern = this.pattern;\n const options = this.options;\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true;\n return;\n }\n if (!pattern) {\n this.empty = true;\n return;\n }\n // step 1: figure out negation, etc.\n this.parseNegate();\n // step 2: expand braces\n this.globSet = [...new Set(this.#expandBraces())];\n // step 3: now we have a set, so turn each one into a series of\n // path-portion matching patterns.\n // These will be Matchers, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n //\n // First, we preprocess to make the glob pattern sets a bit simpler\n // and deduped. There are some perf-killing patterns that can cause\n // problems with a glob walk, but we can simplify them down a bit.\n const rawGlobParts = this.globSet.map(s => this.#slashSplit(s));\n this.globParts = this.preprocess(rawGlobParts);\n // glob --> Matchers\n this.#pending = true;\n let set = this.globParts.map((s, _, __) => {\n if (this.isWindows && this.windowsNoMagicRoot) {\n // check if it's a drive or unc path. The root of a long UNC\n // path, //?/UNC/host/share, is 6 portions.\n const n = s[2] === '?' && isLongUNC(s[3]) ? 6 : 4;\n const isUNC = s[0] === '' &&\n s[1] === '' &&\n (s[2] === '?' || !globMagic.test(s[2])) &&\n s.slice(3, n).every(p => !globMagic.test(p));\n const isDrive = /^[a-z]:/i.test(s[0]);\n if (isUNC) {\n return [\n ...s.slice(0, n).map(p => this.#norm(p)),\n ...s.slice(n).map(ss => this.parse(ss)),\n ];\n }\n else if (isDrive) {\n return [\n this.#norm(s[0]),\n ...s.slice(1).map(ss => this.parse(ss)),\n ];\n }\n }\n return s.map(ss => this.parse(ss));\n });\n // filter out everything that didn't compile properly.\n this.set = set.filter(s => s.indexOf(false) === -1);\n // do not treat the ? in UNC paths as magic\n if (this.isWindows) {\n for (let i = 0; i < this.set.length; i++) {\n const p = this.set[i];\n if (p[0] === '' &&\n p[1] === '' &&\n this.globParts[i][2] === '?' &&\n (isDrive(p[3]) || isLongUNC(this.globParts[i][3]))) {\n if (isLongUNC(this.globParts[i][3]))\n p[3] = 'UNC';\n p[2] = '?';\n }\n }\n }\n // with noext, `@(...)` would be literal\n if (!options.noext)\n this.mergeRows();\n this.#pending = false;\n this.set.forEach((row, i) => {\n for (let k = 0; k < row.length; k++) {\n if (row[k] === PENDING) {\n row[k] = this.parse(this.globParts[i][k]);\n }\n }\n });\n }\n // Merge rows that only differ in one portion, where each of them\n // is a Matcher, into one row that matches any of them with\n // `@(a|b|...)`. Then a path is only walked once for all of them,\n // for example with `**/*.{js,ts}`.\n mergeRows() {\n let merged = true;\n while (merged) {\n merged = false;\n // a single row cannot be merged with anything\n if (this.set.length < 2)\n return;\n let keys = this.#mergeKeys();\n const len = Math.max(0, ...this.set.map(r => r.length));\n for (let k = 0; k < len; k++) {\n // the rows that are the same other than at portion k, keyed\n // by the ids of the parts before k and the parts after k,\n // which are at most the number of rows\n const groups = new Map();\n const R = this.set.length + 1;\n this.set.forEach((row, i) => {\n if (!(row[k] instanceof Matcher || row[k] === PENDING) ||\n !extSafe(this.globParts[i][k])) {\n return;\n }\n const { pre, suf } = keys[i];\n const key = pre[k] * R + suf[k + 1];\n const g = groups.get(key);\n if (g)\n g.push(i);\n else\n groups.set(key, [i]);\n });\n const drop = new Set();\n for (const g of groups.values()) {\n if (g.length < 2)\n continue;\n const [first, ...rest] = g;\n const alts = g.map(i => this.globParts[i][k]);\n const glob = `@(${alts.join('|')})`;\n // merging is only an optimization, so leave the rows as they\n // are if the merged portion would have too many extglobs\n if (extglobCount(glob) > MAX_EXTGLOBS)\n continue;\n this.globParts[first][k] = glob;\n this.set[first][k] = this.parse(glob);\n for (const i of rest)\n drop.add(i);\n }\n if (drop.size) {\n merged = true;\n this.set = this.set.filter((_, i) => !drop.has(i));\n this.globParts = this.globParts.filter((_, i) => !drop.has(i));\n // every merge drops a row, so this happens at most once per row\n if (this.set.length < 2)\n return;\n keys = this.#mergeKeys();\n }\n }\n }\n }\n // For each row, number ids for its prefixes and suffixes, such that\n // pre[k] identifies parts[0..k) and suf[k] identifies parts[k..n).\n // Two rows are the same other than at portion k exactly when they\n // have the same pre[k] and suf[k + 1]. This is linear in the size of\n // the rows, where joining the whole row for every k was quadratic.\n #mergeKeys() {\n const partIds = new Map();\n const ids = this.globParts.map(parts => parts.map(s => {\n let id = partIds.get(s);\n if (id === undefined)\n partIds.set(s, (id = partIds.size));\n return id;\n }));\n // ids are only compared at the same k, so they are numbered per\n // portion, with 0 for the empty prefix or suffix. Then they are\n // at most the number of rows, and id * P + part id is a safe\n // integer key for any set that fits in memory.\n const P = partIds.size;\n const len = Math.max(0, ...ids.map(r => r.length));\n const keys = ids.map(r => ({\n pre: [0],\n suf: new Array(r.length + 1).fill(0),\n }));\n for (let k = 0; k < len; k++) {\n const m = new Map();\n ids.forEach((r, i) => {\n if (k >= r.length)\n return;\n const { pre } = keys[i];\n const key = pre[k] * P + r[k];\n let id = m.get(key);\n if (id === undefined)\n m.set(key, (id = m.size + 1));\n pre.push(id);\n });\n }\n for (let k = len - 1; k >= 0; k--) {\n const m = new Map();\n ids.forEach((r, i) => {\n if (k >= r.length)\n return;\n const { suf } = keys[i];\n const key = suf[k + 1] * P + r[k];\n let id = m.get(key);\n if (id === undefined)\n m.set(key, (id = m.size + 1));\n suf[k] = id;\n });\n }\n return keys;\n }\n // various transforms to equivalent pattern sets that are\n // faster to process in a filesystem walk. The goal is to\n // eliminate what we can, and push all ** patterns as far\n // to the right as possible, even if it increases the number\n // of patterns that we have to process.\n preprocess(globParts) {\n // if we're not in globstar mode, then turn ** into *\n if (this.options.noglobstar) {\n for (const partset of globParts) {\n for (let j = 0; j < partset.length; j++) {\n if (partset[j] === '**') {\n partset[j] = '*';\n }\n }\n }\n }\n const { optimizationLevel = 1 } = this.options;\n if (optimizationLevel >= 2) {\n // aggressive optimization for the purpose of fs walking\n globParts = this.firstPhasePreProcess(globParts);\n globParts = this.secondPhasePreProcess(globParts);\n }\n else if (optimizationLevel >= 1) {\n // just basic optimizations to remove some .. parts\n globParts = this.levelOneOptimize(globParts);\n }\n else {\n // just collapse multiple ** portions into one\n globParts = this.adjascentGlobstarOptimize(globParts);\n }\n return globParts;\n }\n // just get rid of adjascent ** portions\n adjascentGlobstarOptimize(globParts) {\n return globParts.map(parts => {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let i = gs;\n while (parts[i + 1] === '**') {\n i++;\n }\n if (i !== gs) {\n parts.splice(gs, i - gs);\n }\n }\n return parts;\n });\n }\n // get rid of adjascent ** and resolve .. portions\n levelOneOptimize(globParts) {\n return globParts.map(parts => {\n // .. can not remove the root of a Windows path\n const root = this.#rootIndex(parts) + 1;\n parts = parts.reduce((set, part) => {\n const prev = set[set.length - 1];\n if (part === '**' && prev === '**') {\n return set;\n }\n if (part === '..') {\n if (set.length > root &&\n prev &&\n prev !== '..' &&\n prev !== '.' &&\n prev !== '**') {\n set.pop();\n return set;\n }\n }\n set.push(part);\n return set;\n }, []);\n return parts.length === 0 ? [''] : parts;\n });\n }\n // Check the path against each row before it is split. 'no' if no\n // row can match, so it does not need to be split. 'yes' if a row of\n // `**` and one more portion matches. 'maybe' if it must be split to\n // know. None of this applies with partial, where the path can end\n // before the row does.\n //\n // On Windows, `\\` is a separator in the path too, and the portions of\n // a row up to its drive letter or UNC share are not checked (see\n // #rootIndex).\n //\n // Each string portion of a row must be a portion of the path, so the\n // path must contain it. Level 2 can only take portions out of the\n // path, so this is still true then.\n //\n // The last portion of a row must match the last portion of the path,\n // or the one before a trailing `/` (as a/* and a/**/* match a/b/).\n // This does not apply to rows that end in **, rows that end in a\n // root, or preserveMultipleSlashes (which can leave more\n // than one '' at the end). At level 2, it does not apply if that\n // portion is `.` or `..`, which can be\n // resolved away. Level 2 only takes other portions out of the\n // middle of the path.\n //\n // A row of `**/x` then matches if the ** can walk the portions\n // before the one that x matches, the same as #matchGlobstar. At\n // level 2, this is only known if none of them are `.` or `..`, so\n // that the path does not change when it is resolved.\n #canMatch(f) {\n const sep = !this.isWindows || !f.includes('\\\\') ? '/'\n : f.includes('/') ? 'both'\n : '\\\\';\n // the portions that f.split(/\\/+/) would end with, and where they\n // start in f, found when a row needs them. `ends` is 0 until they\n // are found, then 1, or -1 if they can not be used.\n let ends = this.#endCheck ? 0 : -1;\n let last = '';\n let lastStart = 0;\n let prev;\n let prevStart = 0;\n const dot = !!this.options.dot;\n // A string compare is cheaper than includes(), and a Matcher test\n // costs more, so the cheaper check goes first.\n ROWS: for (let r = 0; r < this.set.length; r++) {\n const row = this.set[r];\n const p = row[row.length - 1];\n let end = ends !== -1 && this.#endRows[r] && p !== GLOBSTAR;\n if (end && ends === 0) {\n const i = lastSep(f, f.length, sep);\n lastStart = i + 1;\n last = f.slice(lastStart);\n if (last === '' && i >= 0) {\n let j = i;\n while (j > 0 && isSep(f.charCodeAt(j - 1), sep))\n j--;\n prevStart = j === 0 ? 0 : lastSep(f, j - 1, sep) + 1;\n prev = f.slice(prevStart, j);\n }\n const resolves = this.#level2 &&\n (isDots(last) ||\n (last === '' && prev !== undefined && isDots(prev)));\n ends = resolves ? -1 : 1;\n end = !resolves;\n }\n let tailStart = -1;\n if (end && typeof p === 'string') {\n tailStart = endIndex(p, last, lastStart, prev, prevStart);\n if (tailStart === -1)\n continue;\n }\n if (this.#literalCheck) {\n for (const l of this.#literals[r]) {\n if (!f.includes(l))\n continue ROWS;\n }\n }\n if (end && typeof p === 'object') {\n tailStart = endIndex(p, last, lastStart, prev, prevStart);\n if (tailStart === -1)\n continue;\n }\n const shape = this.#shapes[r];\n if (shape === 'base' && end)\n return 'yes';\n if (shape === 'tail' && end) {\n if (this.#level2 && dotPortion(f, 0, tailStart, true, sep)) {\n return 'maybe';\n }\n if (!dotPortion(f, 0, tailStart, dot, sep))\n return 'yes';\n continue;\n }\n if (shape === 'mid' || shape === 'head') {\n const m = this.#walk(f, row, shape === 'head', dot, sep);\n if (m !== 'no')\n return m;\n continue;\n }\n return 'maybe';\n }\n return 'no';\n }\n // Match a row of a known shape against the split path, the same as\n // #matchGlobstar and #matchGlobStarBodySections do. None of these\n // rows have a drive letter, so they start at the first portion.\n #matchShape(file, row, shape) {\n const dot = !!this.options.dot;\n const n = file.length;\n if (shape === 'head') {\n // x, then at least one portion that ** can walk\n if (n < 2 || !portionMatch(row[0], file[0])) {\n return false;\n }\n for (let i = 1; i < n; i++)\n if (!walkable(file[i], dot))\n return false;\n return true;\n }\n const x = row[1];\n if (shape === 'tail') {\n // x is the last portion, or the one before a trailing ''\n let t = n - 1;\n if (!portionMatch(x, file[t])) {\n if (file[t] !== '' || n === 1 || !portionMatch(x, file[--t])) {\n return false;\n }\n }\n for (let i = 0; i < t; i++)\n if (!walkable(file[i], dot))\n return false;\n return true;\n }\n // mid: the first x that ** can walk to, with a portion after it,\n // and ** can walk all of those\n for (let k = 0; k < n; k++) {\n if (portionMatch(x, file[k]) && k + 1 < n) {\n let i = k + 1;\n while (i < n && walkable(file[i], dot))\n i++;\n if (i === n)\n return true;\n }\n if (!walkable(file[k], dot))\n return false;\n }\n return false;\n }\n // Match a row of `**/x/**` or `x/**` against the path, the same as\n // #matchGlobstar and #matchGlobStarBodySections do once it is split.\n // x must match a portion (the first one, for `x/**`), the ** before\n // it must be able to walk the portions before that one, and there\n // must be a portion after it, which the ** after it can walk. At\n // level 2, this is only known if no portion is `.` or `..`.\n #walk(f, row, head, dot, sep) {\n if (this.#level2 && dotPortion(f, 0, f.length, true, sep))\n return 'maybe';\n const x = row[head ? 0 : 1];\n // the last portion has none after it, so it can not be x\n let s = 0;\n for (let e = nextSep(f, s, sep); e !== -1; e = nextSep(f, s, sep)) {\n // the start of the next portion\n let next = e + 1;\n while (next < f.length && isSep(f.charCodeAt(next), sep))\n next++;\n const hit = typeof x === 'string' ?\n e - s === x.length && f.startsWith(x, s)\n : e > s && x.testUnchecked(f.slice(s, e));\n if (hit && !dotPortion(f, next, f.length, dot, sep))\n return 'yes';\n if (head || dotPortion(f, s, next, dot, sep))\n return 'no';\n s = next;\n }\n return 'no';\n }\n // the last split, if it was the same path with the same split\n // settings\n #cachedSplit(f) {\n const last = lastSplit;\n return (last?.f === f &&\n last.isWindows === this.isWindows &&\n last.preserveMultipleSlashes === this.preserveMultipleSlashes &&\n last.normalize === this.#form) ?\n last\n : undefined;\n }\n // split a path for match(), and keep the parts for the next call\n #split(f) {\n const { isWindows, preserveMultipleSlashes } = this;\n // windows: need to use /, not \\\n let parts = this.#slashSplit(isWindows ? f.split('\\\\').join('/') : f);\n // normalize each portion, so that a char that normalizes to `/`\n // does not make a new portion\n const normalize = this.#form;\n if (normalize)\n parts = parts.map(p => p.normalize(normalize));\n lastSplit = {\n f,\n isWindows,\n preserveMultipleSlashes,\n normalize,\n parts,\n };\n return lastSplit;\n }\n // resolve `.` and `..` portions of a path, for level 2\n #levelTwoFileOptimize(file) {\n // work on a copy, so that the cached parts do not change\n const parts = [...file];\n let didSomething = false;\n do {\n didSomething = false;\n // <pre>/<e>/<rest> -> <pre>/<rest>\n if (!this.preserveMultipleSlashes) {\n for (let i = 1; i < parts.length - 1; i++) {\n const p = parts[i];\n // don't squeeze out UNC patterns\n if (i === 1 && p === '' && parts[0] === '')\n continue;\n if (p === '.' || p === '') {\n didSomething = true;\n parts.splice(i, 1);\n i--;\n }\n }\n if (parts[0] === '.' &&\n parts.length === 2 &&\n (parts[1] === '.' || parts[1] === '')) {\n didSomething = true;\n parts.pop();\n }\n }\n // <pre>/<p>/../<rest> -> <pre>/<rest>\n // .. can not remove the root of a Windows path\n const root = this.#rootIndex(parts) + 1;\n let dd = root;\n while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n const p = parts[dd - 1];\n if (p && p !== '.' && p !== '..' && p !== '**') {\n didSomething = true;\n parts.splice(dd - 1, 2);\n dd = Math.max(dd - 2, root);\n }\n }\n } while (didSomething);\n return parts.length === 0 ? [''] : parts;\n }\n // First phase: single-pattern processing\n // <pre> is 1 or more portions\n // <rest> is 1 or more portions\n // <p> is any portion other than ., .., '', or **\n // <e> is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}\n // <pre>/<e>/<rest> -> <pre>/<rest>\n // <pre>/<p>/../<rest> -> <pre>/<rest>\n // **/**/<rest> -> **/<rest>\n //\n // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow\n // this WOULD be allowed if ** did follow symlinks, or * didn't\n firstPhasePreProcess(globParts) {\n // each **/.. split doubles the patterns, and adds a copy of the\n // whole pattern. Throw if either gets too large. A partial split\n // would match some paths and not others, depending on which rows\n // the pass reached first.\n const { braceExpandMax = DEFAULT_BRACE_EXPAND_MAX } = this.options;\n let splitCells = 0;\n const maxSplitCells = 1_000_000;\n let didSomething = false;\n do {\n didSomething = false;\n // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}\n for (let parts of globParts) {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss = gs;\n while (parts[gss + 1] === '**') {\n // <pre>/**/**/<rest> -> <pre>/**/<rest>\n gss++;\n }\n // eg, if gs is 2 and gss is 4, that means we have 3 **\n // parts, and can remove 2 of them.\n if (gss > gs) {\n parts.splice(gs + 1, gss - gs);\n }\n let next = parts[gs + 1];\n const p = parts[gs + 2];\n const p2 = parts[gs + 3];\n if (next !== '..')\n continue;\n if (!p ||\n p === '.' ||\n p === '..' ||\n !p2 ||\n p2 === '.' ||\n p2 === '..') {\n continue;\n }\n // Check before changing parts or allocating the new row.\n const addedCells = parts.length - 1;\n if (globParts.length >= braceExpandMax ||\n splitCells + addedCells > maxSplitCells) {\n throw new RangeError(`optimizationLevel 2: too many patterns from '**/..'`);\n }\n didSomething = true;\n // edit parts in place, and push the new one\n parts.splice(gs, 1);\n const other = parts.slice(0);\n other[gs] = '**';\n splitCells += addedCells;\n globParts.push(other);\n gs--;\n }\n // <pre>/<e>/<rest> -> <pre>/<rest>\n if (!this.preserveMultipleSlashes) {\n for (let i = 1; i < parts.length - 1; i++) {\n const p = parts[i];\n // don't squeeze out UNC patterns\n if (i === 1 && p === '' && parts[0] === '')\n continue;\n if (p === '.' || p === '') {\n didSomething = true;\n parts.splice(i, 1);\n i--;\n }\n }\n if (parts[0] === '.' &&\n parts.length === 2 &&\n (parts[1] === '.' || parts[1] === '')) {\n didSomething = true;\n parts.pop();\n }\n }\n // <pre>/<p>/../<rest> -> <pre>/<rest>\n // .. can not remove the root of a Windows path\n const root = this.#rootIndex(parts) + 1;\n let dd = root;\n while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n const p = parts[dd - 1];\n if (p && p !== '.' && p !== '..' && p !== '**') {\n didSomething = true;\n const needDot = dd === 1 && parts[dd + 1] === '**';\n const splin = needDot ? ['.'] : [];\n parts.splice(dd - 1, 2, ...splin);\n if (parts.length === 0)\n parts.push('');\n dd = Math.max(dd - 2, root);\n }\n }\n }\n } while (didSomething);\n return globParts;\n }\n // second phase: multi-pattern dedupes\n // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>\n // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>\n secondPhasePreProcess(globParts) {\n const keys = new Set();\n const rows = globParts.filter(parts => {\n const key = parts.join('/');\n if (keys.has(key))\n return false;\n keys.add(key);\n return true;\n });\n // A row is covered by another row that has `*` at some positions,\n // and is the same at all others. Collect each distinct set of `*`\n // positions, then look up each row with `*` put at those positions.\n const stars = new Map();\n for (const parts of rows) {\n const s = [];\n for (let i = 0; i < parts.length; i++) {\n if (parts[i] === '*')\n s.push(i);\n }\n if (s.length)\n stars.set(s.join(','), s);\n }\n // Each row is checked against each set of `*` positions, so skip\n // this if there are too many. The patterns match the same paths\n // either way.\n if (!stars.size || rows.length * stars.size > 100_000)\n return rows;\n const { dot } = this.options;\n return rows.filter(parts => {\n for (const s of stars.values()) {\n if (s[s.length - 1] >= parts.length)\n continue;\n const c = [...parts];\n let ok = true;\n let changed = false;\n for (const i of s) {\n const p = parts[i];\n if (p === '*')\n continue;\n if (!p || p === '**' || (!dot && p.startsWith('.'))) {\n ok = false;\n break;\n }\n c[i] = '*';\n changed = true;\n }\n if (ok && changed && keys.has(c.join('/')))\n return false;\n }\n return true;\n });\n }\n parseNegate() {\n if (this.nonegate)\n return;\n const pattern = this.pattern;\n let negate = false;\n let negateOffset = 0;\n for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n negate = !negate;\n negateOffset++;\n }\n if (negateOffset)\n this.pattern = pattern.slice(negateOffset);\n this.negate = negate;\n }\n // Match the parts of a path against one row of the set. `resolved`\n // is the parts after level 2 resolves `.` and `..` in them, or the\n // same parts below level 2. Set partial to true to test if, for\n // example, \"/a/b\" matches the start of \"/*/b/*/d\". Partial means, if\n // you run out of file before you run out of pattern, then that's\n // fine, as long as all the parts match.\n #matchRow(file, resolved, pattern, partial) {\n let fileStartIndex = 0;\n let patternStartIndex = 0;\n // UNC paths like //?/X:/... can match X:/... and vice versa, and\n // //?/UNC/host/share/... can match //host/share/... and vice versa.\n // Drive letters in absolute drive or unc paths, and the host and\n // share of UNC paths, are always compared case-insensitively.\n const fh = this.isWindows ? uncHost(resolved) : -1;\n const ph = fh === -1 ? -1 : uncHost(pattern);\n if (ph !== -1) {\n const host = pattern[ph];\n const share = pattern[ph + 1];\n if (typeof host !== 'string' || typeof share !== 'string') {\n // a host or share with magic is matched as usual\n fileStartIndex = fh;\n patternStartIndex = ph;\n }\n else if (resolved[fh].toLowerCase() === host.toLowerCase() &&\n resolved[fh + 1].toLowerCase() === share.toLowerCase()) {\n fileStartIndex = fh + 2;\n patternStartIndex = ph + 2;\n }\n }\n else if (this.isWindows) {\n const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);\n const fileUNC = !fileDrive &&\n file[0] === '' &&\n file[1] === '' &&\n file[2] === '?' &&\n /^[a-z]:$/i.test(file[3]);\n const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);\n const patternUNC = !patternDrive &&\n pattern[0] === '' &&\n pattern[1] === '' &&\n pattern[2] === '?' &&\n typeof pattern[3] === 'string' &&\n /^[a-z]:$/i.test(pattern[3]);\n const fdi = fileUNC ? 3\n : fileDrive ? 0\n : undefined;\n const pdi = patternUNC ? 3\n : patternDrive ? 0\n : undefined;\n if (typeof fdi === 'number' && typeof pdi === 'number') {\n const [fd, pd] = [\n file[fdi],\n pattern[pdi],\n ];\n // the drives match, so start matching after them\n if (fd.toLowerCase() === pd.toLowerCase()) {\n patternStartIndex = pdi + 1;\n fileStartIndex = fdi + 1;\n }\n }\n }\n // the drive letters are found in the parts before level 2 resolves\n // them, and the match uses the resolved parts\n file = resolved;\n if (pattern.includes(GLOBSTAR)) {\n return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);\n }\n return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);\n }\n #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {\n const { head, body, tail, segments } = this.#getGlobstarParts(pattern, partial, patternIndex);\n // check the head, from the current file/pattern index.\n if (head.length) {\n const headEnd = fileIndex + head.length;\n if (!this.#matchOne(file, head, partial, fileIndex, 0, headEnd)) {\n return false;\n }\n fileIndex += head.length;\n patternIndex += head.length;\n }\n // now we know the head matches!\n // if the last portion is not empty, it MUST match the end\n // check the tail\n let fileTailMatch = 0;\n if (tail.length) {\n // if head + tail > file, then we cannot possibly match\n if (tail.length + fileIndex > file.length)\n return false;\n // try to match the tail\n let tailStart = file.length - tail.length;\n if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n fileTailMatch = tail.length;\n }\n else {\n // affordance for stuff like a/**/* matching a/b/\n // if the last file portion is '', and there's more to the pattern\n // then try without the '' bit.\n if (file[file.length - 1] !== '' ||\n fileIndex + tail.length === file.length) {\n return false;\n }\n tailStart--;\n if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n return false;\n }\n fileTailMatch = tail.length + 1;\n }\n }\n // now we know the tail matches!\n // the middle is zero or more portions wrapped in **, possibly\n // containing more ** sections.\n // so a/**/b/**/c/**/d has become **/b/**/c/**\n // if it's empty, it means a/**/b, just verify we have no bad dots\n // if there's no tail, so it ends on /**, then we must have *something*\n // after the head, or it's not a matc\n if (!body.length) {\n let sawSome = !!fileTailMatch;\n for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n const f = String(file[i]);\n sawSome = true;\n if (f === '.' ||\n f === '..' ||\n (!this.options.dot && f.startsWith('.'))) {\n return false;\n }\n }\n // in partial mode, we just need to get past all file parts\n return partial || sawSome;\n }\n // now we know that there's one or more body sections, which can\n // be matched anywhere from the 0 index (because the head was pruned)\n // through to the length-fileTailMatch index.\n return !!this.#matchGlobStarBodySections(file, segments, file.length - fileTailMatch, fileIndex, 0, partial, 0, !!fileTailMatch, new Set());\n }\n // Split the pattern into head, tail, and middle of ** delimited\n // parts. The tail has to be at the end, and the others just have to\n // be found in order from the head. These only depend on the pattern\n // row, so they are kept for the next path.\n #getGlobstarParts(pattern, partial, patternIndex) {\n let byStart = this.#globstarParts.get(pattern);\n if (!byStart) {\n byStart = [];\n this.#globstarParts.set(pattern, byStart);\n }\n const key = patternIndex * 2 + (partial ? 1 : 0);\n const found = byStart[key];\n if (found)\n return found;\n const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);\n const lastgs = pattern.lastIndexOf(GLOBSTAR);\n const head = pattern.slice(patternIndex, firstgs);\n const body = pattern.slice(firstgs + 1, partial ? undefined : lastgs);\n const tail = partial ? [] : pattern.slice(lastgs + 1);\n // split the body up into sections, and note the number of\n // portions that must come after the start of each one\n const segments = [[[], 0]];\n let current = segments[0];\n let nonGsParts = 0;\n const nonGsPartsSums = [0];\n for (const b of body) {\n if (b === GLOBSTAR) {\n nonGsPartsSums.push(nonGsParts);\n current = [[], 0];\n segments.push(current);\n }\n else {\n current[0].push(b);\n nonGsParts++;\n }\n }\n // the portions in this section and the ones after it\n segments.forEach((b, i) => {\n b[1] = nonGsParts - nonGsPartsSums[i];\n });\n const parts = { head, body, tail, segments };\n byStart[key] = parts;\n return parts;\n }\n // return false for \"nope, not matching\"\n // return null for \"not matching, cannot keep trying\"\n #matchGlobStarBodySections(file, \n // pattern section, and the portions that it and the rest need\n bodySegments, \n // the end of the file portions that the body can match\n fileLength, fileIndex, bodyIndex, partial, globStarDepth, sawTail, \n // the places that a walk has already tried, as\n // bodyIndex * (file.length + 1) + fileIndex. A walk from a place\n // does the same no matter how it got there, and it only comes back\n // if it found no match, so a walk that gets to one stops.\n tried) {\n // take the first body segment, and walk from fileIndex to its \"after\"\n // value at the end\n // If it doesn't match at that position, we increment, until we hit\n // that final possible position, and give up.\n // If it does match, then advance and try to rest.\n // If any of them fail we keep walking forward.\n // this is still a bit recursively painful, but it's more constrained\n // than previous implementations, because we never test something that\n // can't possibly be a valid matching condition.\n const bs = bodySegments[bodyIndex];\n if (!bs) {\n // with partial, the body is the rest of the pattern, so it\n // matches if no portions are left, or only the '' of a trailing\n // / (as a/* matches a/b/). A ** at the end walks them as its own\n // empty section.\n if (partial) {\n return (fileIndex >= fileLength ||\n (fileIndex === fileLength - 1 && file[fileIndex] === ''));\n }\n // just make sure that there's no bad dots before the tail\n for (let i = fileIndex; i < fileLength; i++) {\n sawTail = true;\n const f = file[i];\n if (f === '.' ||\n f === '..' ||\n (!this.options.dot && f.startsWith('.'))) {\n return false;\n }\n }\n return sawTail;\n }\n // have a non-globstar body section to test, up to the last index\n // where it can start\n const [body, need] = bs;\n // with partial, the path can end before the body does\n const after = partial ? fileLength : fileLength - need;\n while (fileIndex <= after) {\n const key = bodyIndex * (file.length + 1) + fileIndex;\n if (tried.has(key))\n return false;\n tried.add(key);\n const m = this.#matchOne(file, body, partial, fileIndex, 0, fileIndex + body.length);\n // if limit exceeded, no match. intentional false negative,\n // acceptable break in correctness for security.\n if (m && globStarDepth < this.maxGlobstarRecursion) {\n // match! see if the rest match. if so, we're done!\n const sub = this.#matchGlobStarBodySections(file, bodySegments, fileLength, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail, tried);\n if (sub !== false) {\n return sub;\n }\n }\n // the ** does not walk past the last place the body can start\n if (fileIndex === after)\n break;\n const f = file[fileIndex];\n if (f === '.' ||\n f === '..' ||\n (!this.options.dot && f.startsWith('.'))) {\n return false;\n }\n fileIndex++;\n }\n // walked off. no point continuing\n return partial || null;\n }\n #matchOne(file, pattern, partial, fileIndex, patternIndex, \n // only match the file portions before this index\n fileEnd = file.length) {\n let fi;\n let pi;\n let pl;\n let fl;\n for (fi = fileIndex,\n pi = patternIndex,\n fl = Math.min(fileEnd, file.length),\n pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {\n let p = pattern[pi];\n let f = file[fi];\n // should be impossible.\n /* c8 ignore start */\n if (p === false || p === GLOBSTAR) {\n return false;\n }\n /* c8 ignore stop */\n // something other than **\n // non-magic patterns just have to match exactly\n // patterns with magic have been turned into Matchers.\n if (!portionMatch(p, f))\n return false;\n }\n // Note: ending in / means that we'll get a final \"\"\n // at the end of the pattern. This can only match a\n // corresponding \"\" at the end of the file.\n // If the file ends in /, then it can only match a\n // a pattern that ends in /, unless the pattern just\n // doesn't have any more for it. But, a/b/ should *not*\n // match \"a/b/*\", even though * can match \"\", except in\n // partial mode, where it might simply not be reached yet.\n // However, a/b/ should still satisfy a/*\n // now either we fell off the end of the pattern, or we're done.\n if (fi === fl && pi === pl) {\n // ran out of pattern and filename at the same time.\n // an exact hit!\n return true;\n }\n else if (fi === fl) {\n // ran out of file, but still had pattern left.\n // this is ok if we're doing the match as part of\n // a glob fs traversal.\n return partial;\n }\n else if (pi === pl) {\n // ran out of pattern, still have file left.\n // this is only acceptable if we're on the very last\n // empty segment of a file with a trailing slash.\n // a/* should match a/b/\n return fi === fl - 1 && file[fi] === '';\n /* c8 ignore start */\n }\n else {\n // should be unreachable.\n throw new Error('wtf?');\n }\n /* c8 ignore stop */\n }\n braceExpand() {\n return braceExpand(this.pattern, this.options);\n }\n // Expand braces, except numeric ranges such as {0..999} with at\n // least RANGE_MIN values. Each of those stays in its pattern as\n // `<mark>0..999<mark>`, for the Matcher to test. If a range might\n // be inside a [...] class, expand all of them instead.\n #expandBraces() {\n const { pattern } = this;\n if (this.options.nobrace)\n return this.braceExpand();\n let code = 0xe000;\n while (pattern.includes(String.fromCharCode(code))) {\n if (++code > 0xf8ff)\n return this.braceExpand();\n }\n const mark = String.fromCharCode(code);\n let found = false;\n const marked = pattern.replace(rangeRe, (m, lo, hi) => {\n const a = Number(lo);\n const b = Number(hi);\n if (!Number.isSafeInteger(a) ||\n !Number.isSafeInteger(b) ||\n Math.abs(a - b) + 1 < RANGE_MIN) {\n return m;\n }\n found = true;\n return `${mark}${lo}..${hi}${mark}`;\n });\n if (!found)\n return this.braceExpand();\n const set = braceExpand(marked, this.options);\n for (const p of set) {\n for (const portion of p.split('/')) {\n const c = portion.indexOf('[');\n if (c !== -1 && c < portion.lastIndexOf(mark)) {\n return this.braceExpand();\n }\n if (!this.options.noext && inRepeatOrNegExt(portion, mark)) {\n return this.braceExpand();\n }\n }\n }\n this.#rangeMark = mark;\n return set;\n }\n parse(pattern) {\n assertValidPattern(pattern);\n const options = this.options;\n // shortcuts\n if (pattern === '**')\n return GLOBSTAR;\n if (pattern === '')\n return '';\n const { nocase, nocaseMagicOnly, noext = false, dot, normalize, } = options;\n const rangeMark = this.#rangeMark;\n const lit = rangeMark && pattern.includes(rangeMark) ?\n undefined\n : literal(pattern, noext);\n // in nocase mode, a literal with cased chars still needs a\n // Matcher, unless nocaseMagicOnly is set.\n if (lit !== undefined &&\n !(nocase &&\n !nocaseMagicOnly &&\n pattern.toUpperCase() !== pattern.toLowerCase())) {\n return this.#norm(lit);\n }\n if (this.#pending)\n return PENDING;\n let m = this.#matchers.get(pattern);\n if (!m) {\n if (!noext)\n assertValidExtglobs(pattern);\n m = new Matcher(pattern, {\n nocase,\n noext,\n dot,\n normalize,\n ...(rangeMark && { rangeMark }),\n });\n this.#matchers.set(pattern, m);\n }\n return m;\n }\n #slashSplit(p) {\n // if p starts with // on windows, we preserve that\n // so that UNC paths aren't broken. Otherwise, any number of\n // / characters are coalesced into one, unless\n // preserveMultipleSlashes is set to true.\n if (this.preserveMultipleSlashes) {\n return p.split('/');\n }\n else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n // add an extra '' for the one we lose\n return ['', ...p.split(/\\/+/)];\n }\n else {\n return p.split(/\\/+/);\n }\n }\n match(f, partial = this.partial) {\n // short-circuit in the case of busted things.\n // comments, etc.\n if (this.comment) {\n return false;\n }\n if (this.empty) {\n return f === '';\n }\n if (f === '/' && partial) {\n return true;\n }\n const options = this.options;\n // treat the test path as a set of pathparts. If it was not just\n // split or checked, check that it can match before splitting it.\n let split = this.#cachedSplit(f);\n if (!split) {\n // the checks look at the path as given, so not if it is\n // normalized\n if (!partial &&\n !this.#form &&\n (this.#endCheck || this.#literalCheck) &&\n lastChecked !== f) {\n lastChecked = f;\n const can = this.#canMatch(f);\n if (can === 'no')\n return options.flipNegate ? false : this.negate;\n if (can === 'yes')\n return options.flipNegate ? true : !this.negate;\n }\n split = this.#split(f);\n }\n const ff = split.parts;\n // the parts after level 2 resolves them, kept for the next pattern\n // that tests the same path\n const resolved = this.#level2 ?\n (split.resolved ??= this.#levelTwoFileOptimize(ff))\n : ff;\n // just ONE of the pattern sets in this.set needs to match\n // in order for it to be valid. If negating, then just one\n // match means that we have failed.\n // Either way, return on the first hit.\n const set = this.set;\n // Find the basename of the path by looking for the last non-empty segment\n let filename = ff[ff.length - 1];\n if (!filename) {\n for (let i = ff.length - 2; !filename && i >= 0; i--) {\n filename = ff[i];\n }\n }\n for (let r = 0; r < set.length; r++) {\n const pattern = set[r];\n const shape = partial ? undefined : this.#shapes[r];\n // level 2 does not change a path of one portion\n const hit = shape === 'base' ?\n portionMatch(pattern[0], filename)\n : shape ? this.#matchShape(resolved, pattern, shape)\n : options.matchBase && pattern.length === 1 ?\n this.#matchRow([filename], [filename], pattern, partial)\n : this.#matchRow(ff, resolved, pattern, partial);\n if (hit) {\n if (options.flipNegate) {\n return true;\n }\n return !this.negate;\n }\n }\n // didn't get any hits. this is success if it's a negative\n // pattern, failure otherwise.\n if (options.flipNegate) {\n return false;\n }\n return this.negate;\n }\n static defaults(def) {\n return minimatch.defaults(def).Minimatch;\n }\n}\n/* c8 ignore start */\nexport { escape } from './escape.js';\nexport { unescape } from './unescape.js';\n/* c8 ignore stop */\nminimatch.Minimatch = Minimatch;\nminimatch.escape = escape;\nminimatch.unescape = unescape;\n//# sourceMappingURL=index.js.map","import { Array as Arr, String as Str, pipe } from \"effect\";\nimport { Minimatch } from \"minimatch\";\n\nconst NEGATION = \"!\";\n\nexport type Matcher = (path: string) => boolean;\n\nexport const matcher = (patterns: readonly string[]): Matcher => {\n const compiled = pipe(\n patterns,\n Arr.map((pattern) => new Minimatch(pattern, { dot: true })),\n );\n return (path) =>\n pipe(\n compiled,\n Arr.some((glob) => glob.match(path)),\n );\n};\n\nconst isNegated = Str.startsWith(NEGATION);\n\nconst isIncluded = (pattern: string): boolean => !isNegated(pattern);\n\nconst withoutNegation = Str.slice(NEGATION.length);\n\nexport const selects = (patterns: readonly string[]): Matcher => {\n const included = pipe(patterns, Arr.filter(isIncluded), matcher);\n const excluded = pipe(patterns, Arr.filter(isNegated), Arr.map(withoutNegation), matcher);\n return (path) => included(path) && !excluded(path);\n};\n","import { Option } from \"effect\";\n\nexport const memoize = <Value>(compute: (key: string) => Value): ((key: string) => Value) => {\n const cache = new Map<string, Value>();\n const store = (key: string): Value => {\n const value = compute(key);\n cache.set(key, value);\n return value;\n };\n return (key) => Option.getOrElse(Option.fromNullishOr(cache.get(key)), () => store(key));\n};\n","import { joinAll, matcher, segments, stem } from \"@masseater.dev/path-kit\";\nimport type { Matcher } from \"@masseater.dev/path-kit\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nimport { isLayer, isParted } from \"#/entities/kind/@x/layout.ts\";\nimport type { Layers } from \"#/entities/kind/@x/layout.ts\";\n\nexport type Position =\n | { readonly type: \"ignored\" }\n | { readonly type: \"outside\" }\n | { readonly type: \"root\" }\n | { readonly type: \"loose\" }\n | { readonly type: \"unknownLayer\"; readonly layer: string }\n | {\n readonly type: \"layer\";\n readonly layer: string;\n readonly slice: Option.Option<string>;\n readonly inner: Option.Option<string>;\n };\n\nexport type LayerPosition = Extract<Position, { readonly type: \"layer\" }>;\nexport interface LayerGlobs {\n readonly files: Matcher;\n readonly loose: Matcher;\n readonly entries: Matcher;\n readonly open: Matcher;\n}\n\nexport interface Scope {\n readonly layers: Layers;\n readonly globs: LayerGlobs;\n readonly isSlice: (path: string) => boolean;\n}\n\nconst ONE = 1;\nexport const IGNORED: Position = { type: \"ignored\" };\nexport const OUTSIDE: Position = { type: \"outside\" };\nconst ROOT: Position = { type: \"root\" };\nconst LOOSE: Position = { type: \"loose\" };\n\nconst layerAt = (\n layer: string,\n slice: Option.Option<string> = Option.none(),\n inner: Option.Option<string> = Option.none(),\n): Position => ({ type: \"layer\", layer, slice, inner });\n\nexport const globsOf = (layers: Layers): LayerGlobs => ({\n files: matcher(layers.files),\n loose: matcher(layers.loose ?? []),\n entries: matcher(layers.entries ?? []),\n open: matcher(layers.open ?? []),\n});\n\nconst sliceOf = (\n layer: string,\n tail: readonly string[],\n isSlice: (path: string) => boolean,\n): LayerPosition => {\n const end = pipe(\n Arr.range(ONE, tail.length - ONE),\n Arr.findFirst((count) => isSlice(joinAll([layer, ...Arr.take(tail, count)]))),\n Option.getOrElse(() => ONE),\n );\n return {\n type: \"layer\",\n layer,\n slice: Option.some(joinAll(Arr.take(tail, end))),\n inner: Option.some(joinAll(Arr.drop(tail, end))),\n };\n};\n\nconst locateSingle = ({ layers, globs }: Scope, single: string): Position => {\n if (globs.loose(single)) {\n return ROOT;\n }\n if (layers.moduleFiles !== true) {\n return LOOSE;\n }\n const name = stem(single);\n if (isLayer(layers)(name)) {\n return layerAt(name);\n }\n return { type: \"unknownLayer\", layer: name };\n};\n\nconst locateParted = (\n scope: Scope,\n layer: string,\n tail: Arr.NonEmptyReadonlyArray<string>,\n): Position => {\n const [only, ...more] = tail;\n const modules = scope.layers.moduleFiles === true;\n if (Arr.isReadonlyArrayNonEmpty(more) && modules) {\n return layerAt(layer, Option.some(only), Option.some(joinAll(more)));\n }\n if (Arr.isReadonlyArrayNonEmpty(more)) {\n return sliceOf(layer, tail, scope.isSlice);\n }\n if (modules) {\n return layerAt(layer, Option.some(stem(only)));\n }\n return layerAt(layer, Option.some(stem(only)), Option.some(only));\n};\n\nexport const locateRest =\n (scope: Scope) =>\n (rest: string): Position => {\n const [layer, ...tail] = segments(rest);\n if (!Arr.isReadonlyArrayNonEmpty(tail)) {\n return locateSingle(scope, layer);\n }\n if (!isLayer(scope.layers)(layer)) {\n return { type: \"unknownLayer\", layer };\n }\n if (!isParted(scope.layers)(layer)) {\n return layerAt(layer);\n }\n return locateParted(scope, layer, tail);\n };\n\nexport const asLayer = (position: Position): Option.Option<LayerPosition> =>\n pipe(\n Option.some(position),\n Option.filter((value): value is LayerPosition => value.type === \"layer\"),\n );\n","import { ancestors, baseName, below, join, matcher, parent } from \"@masseater.dev/path-kit\";\nimport type { Matcher } from \"@masseater.dev/path-kit\";\nimport { Array as Arr, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport type { Kind, Layers } from \"#/entities/kind/@x/layout.ts\";\nimport { memoize } from \"#/shared/lib/memo.ts\";\n\nimport { IGNORED, OUTSIDE, globsOf, locateRest } from \"./position.ts\";\nimport type { LayerGlobs, Position } from \"./position.ts\";\n\nexport interface Instance {\n readonly kind: Kind;\n readonly dir: string;\n}\n\nexport interface Located {\n readonly instance: Instance;\n readonly position: Position;\n}\n\nexport interface Layout {\n readonly files: readonly string[];\n readonly instances: readonly Instance[];\n readonly exists: (path: string) => boolean;\n readonly owners: (file: string) => readonly Instance[];\n readonly inner: (instance: Instance) => (path: string) => Option.Option<string>;\n readonly isEntry: (instance: Instance) => (inner: string) => boolean;\n readonly isOpen: (instance: Instance) => (rest: string) => boolean;\n readonly locate: (instance: Instance) => (path: string) => Position;\n readonly located: (path: string) => readonly Located[];\n}\n\nconst ROOT_PATH = \".\";\n\nconst dirPath = (dir: string): string =>\n pipe(\n Option.some(dir),\n Option.filter(Str.isNonEmpty),\n Option.getOrElse(() => ROOT_PATH),\n );\n\nconst markerDir =\n (marker: string) =>\n (file: string): Option.Option<string> =>\n pipe(\n Option.some(file),\n Option.filter((path) => baseName(path) === marker),\n Option.map((path) => parent(path)),\n );\n\nconst instancesOf =\n (files: readonly string[]) =>\n (kind: Kind): readonly Instance[] => {\n const wanted = Option.map(Option.fromNullishOr(kind.paths), matcher);\n const allowed = (dir: string): boolean =>\n Option.match(wanted, { onNone: () => true, onSome: (paths) => paths(dirPath(dir)) });\n const instanceAt = (file: string): Option.Option<Instance> =>\n pipe(\n markerDir(kind.marker)(file),\n Option.filter(allowed),\n Option.map((dir) => ({ kind, dir })),\n );\n return pipe(files, Arr.map(instanceAt), Arr.getSomes);\n };\n\ninterface Index {\n readonly instances: readonly Instance[];\n readonly byDir: Readonly<Record<string, readonly Instance[]>>;\n readonly globsFor: (kind: Kind) => Option.Option<LayerGlobs>;\n readonly isEntryDir: (dir: string) => boolean;\n readonly isPath: (path: string) => boolean;\n}\n\nconst globsByKind = (kinds: readonly Kind[]): ((kind: Kind) => Option.Option<LayerGlobs>) => {\n const globs = new Map(\n pipe(\n kinds,\n Arr.map((kind) =>\n Option.map(Option.fromNullishOr(kind.layers), (layers) => [kind, globsOf(layers)] as const),\n ),\n Arr.getSomes,\n ),\n );\n return (kind) => Option.fromNullishOr(globs.get(kind));\n};\n\nconst entryDirsOf = (\n kinds: readonly Kind[],\n files: readonly string[],\n): ((dir: string) => boolean) => {\n const entries = pipe(\n kinds,\n Arr.map((kind) => Option.fromNullishOr(kind.layers)),\n Arr.getSomes,\n Arr.map((layers) => globsOf(layers).entries),\n );\n const isEntryFile = (file: string): boolean =>\n pipe(\n entries,\n Arr.some((entry) => entry(baseName(file))),\n );\n const dirs = new Set(\n pipe(\n files,\n Arr.filter(isEntryFile),\n Arr.map((file) => parent(file)),\n ),\n );\n return (dir) => dirs.has(dir);\n};\n\nconst pathsOf = (files: readonly string[]): ((path: string) => boolean) => {\n const paths = new Set([...files, ...pipe(files, Arr.flatMap(ancestors))]);\n return (path) => paths.has(path);\n};\n\nconst indexOf = (kinds: readonly Kind[], files: readonly string[]): Index => {\n const instances = pipe(kinds, Arr.flatMap(instancesOf(files)));\n return {\n instances,\n byDir: Arr.groupBy(instances, ({ dir }) => dir),\n globsFor: globsByKind(kinds),\n isEntryDir: entryDirsOf(kinds, files),\n isPath: pathsOf(files),\n };\n};\n\nconst ownersIn =\n ({ byDir }: Readonly<Index>) =>\n (file: string): readonly Instance[] =>\n pipe(\n ancestors(file),\n Arr.findFirst((dir) => Rec.get(byDir, dir)),\n Option.getOrElse((): readonly Instance[] => []),\n );\n\nconst inner =\n (instance: Instance) =>\n (path: string): Option.Option<string> =>\n below(instance.dir)(path);\n\nconst scopeOf =\n ({ isEntryDir }: Readonly<Index>, instance: Instance) =>\n (layers: Layers, globs: LayerGlobs): ((rest: string) => Position) => {\n const base = join(instance.dir)(layers.dir);\n return locateRest({ layers, globs, isSlice: (sub) => isEntryDir(join(base)(sub)) });\n };\n\nconst locateIn =\n (index: Readonly<Index>) =>\n (instance: Instance) =>\n (path: string): Position => {\n const layerGlobs = index.globsFor(instance.kind);\n const layers = Option.fromNullishOr(instance.kind.layers);\n const within = inner(instance)(path);\n return pipe(\n Option.all({ layers, layerGlobs, within }),\n Option.filter((found) => found.layerGlobs.files(found.within)),\n Option.map((found) =>\n Option.match(below(found.layers.dir)(found.within), {\n onNone: () => OUTSIDE,\n onSome: scopeOf(index, instance)(found.layers, found.layerGlobs),\n }),\n ),\n Option.getOrElse(() => IGNORED),\n );\n };\n\nconst globMatches =\n ({ globsFor }: Readonly<Index>, pick: (layerGlobs: LayerGlobs) => Matcher) =>\n (instance: Instance) =>\n (path: string): boolean =>\n pipe(\n globsFor(instance.kind),\n Option.exists((layerGlobs) => pick(layerGlobs)(path)),\n );\n\nconst perInstance = (\n locate: (instance: Instance) => (path: string) => Position,\n): ((instance: Instance) => (path: string) => Position) => {\n const cache = new WeakMap<Instance, (path: string) => Position>();\n const store = (instance: Instance): ((path: string) => Position) => {\n const located = memoize(locate(instance));\n cache.set(instance, located);\n return located;\n };\n return (instance) =>\n Option.getOrElse(Option.fromNullishOr(cache.get(instance)), () => store(instance));\n};\n\nexport const makeLayout =\n (kinds: readonly Kind[]) =>\n (files: readonly string[]): Layout => {\n const index = indexOf(kinds, files);\n const owners = memoize(ownersIn(index));\n const locate = perInstance(locateIn(index));\n return {\n files,\n instances: index.instances,\n exists: (path) => Str.isEmpty(path) || index.isPath(path),\n owners,\n inner,\n isEntry: globMatches(index, ({ entries }) => entries),\n isOpen: globMatches(index, ({ open }) => open),\n locate,\n located: memoize((path) =>\n pipe(\n owners(path),\n Arr.map((instance) => ({ instance, position: locate(instance)(path) })),\n ),\n ),\n };\n };\n","import { baseName, below } from \"@masseater.dev/path-kit\";\nimport { Array as Arr, Equal, Option, String as Str, pipe } from \"effect\";\n\nimport { isLayer, isParted, isSliced } from \"#/entities/kind/index.ts\";\nimport type { Layers } from \"#/entities/kind/index.ts\";\nimport { asLayer } from \"#/entities/layout/index.ts\";\nimport type { Instance, LayerPosition, Layout, Located } from \"#/entities/layout/index.ts\";\nimport type { GraphEdge } from \"#/shared/config/index.ts\";\nimport type { Finding } from \"#/shared/lib/finding.ts\";\n\nexport const LAYER_IMPORT = \"layer-import\";\nexport const CROSS_SLICE = \"cross-slice\";\nexport const PUBLIC_API = \"public-api\";\nexport const WILDCARD_EXPORT = \"wildcard-export\";\nexport const LINK_TARGET = \"link-target\";\n\nconst MARKDOWN = /\\.md$/iu;\nconst SIBLING = \".\";\nconst NESTED = \"/\";\nconst ONE = 1;\n\ninterface Hop {\n readonly layers: Layers;\n readonly edge: GraphEdge;\n readonly source: LayerPosition;\n readonly target: LayerPosition;\n}\n\ninterface Reach {\n readonly instance: Instance;\n readonly from: LayerPosition;\n readonly target: string;\n}\n\nconst finding = (edge: GraphEdge, rule: string, message: string): Finding => ({\n path: edge.from,\n line: edge.line,\n column: edge.column,\n rule,\n message,\n});\n\nconst startsCross = (prefix: string, inner: string): boolean => {\n const rest = Str.slice(prefix.length)(inner);\n return (\n Str.startsWith(prefix)(inner) &&\n (Str.isEmpty(rest) || Str.startsWith(SIBLING)(rest) || Str.startsWith(NESTED)(rest))\n );\n};\n\nconst crossing = ({ layers, source, target }: Omit<Hop, \"edge\">): boolean =>\n pipe(\n Option.all({\n cross: Option.fromNullishOr(layers.cross),\n slice: source.slice,\n inner: target.inner,\n }),\n Option.exists(\n ({ cross, slice, inner }) =>\n startsCross(`${cross}/${slice}`, inner) ||\n startsCross(`${cross}/${baseName(slice)}`, inner),\n ),\n );\n\nconst otherSlice = ({ layers, source, target }: Omit<Hop, \"edge\">): boolean =>\n isSliced(layers)(target.layer) &&\n pipe(\n Option.all([source.slice, target.slice]),\n Option.exists(([from, to]) => from !== to),\n ) &&\n !crossing({ layers, source, target });\n\nconst indexIn = (layers: Layers, layer: string): Option.Option<number> =>\n Arr.findFirstIndex(layers.order, (name) => name === layer);\n\nconst upward = ({ layers, edge, source, target }: Hop): Finding =>\n finding(\n edge,\n LAYER_IMPORT,\n `uses the ${target.layer} layer from the ${source.layer} layer (${edge.specifier}). A layer may only use the layers below it: ${Arr.join(layers.order, \", \")}.`,\n );\n\nconst sideways = ({ edge, source, target }: Hop): Finding =>\n finding(\n edge,\n CROSS_SLICE,\n `uses the ${target.layer} slice ${Option.getOrElse(target.slice, () => \"\")} from the slice ${Option.getOrElse(source.slice, () => \"\")} (${edge.specifier}). Slices of one layer must not use each other; move what they share down a layer.`,\n );\n\nconst direction = (hop: Hop): Option.Option<Finding> =>\n pipe(\n Option.all({\n from: indexIn(hop.layers, hop.source.layer),\n to: indexIn(hop.layers, hop.target.layer),\n }),\n Option.flatMap(({ from, to }) => {\n if (to < from) {\n return Option.some(upward(hop));\n }\n if (to === from && otherSlice(hop)) {\n return Option.some(sideways(hop));\n }\n return Option.none();\n }),\n );\n\nconst wildcardFinding = (\n layout: Layout,\n edge: GraphEdge,\n { instance, position }: Located,\n): Option.Option<Finding> =>\n pipe(\n asLayer(position),\n Option.filter(() => edge.wildcard && layout.isEntry(instance)(baseName(edge.from))),\n Option.map(() =>\n finding(\n edge,\n WILDCARD_EXPORT,\n `re-exports everything from ${edge.specifier}. Name what the public API exports.`,\n ),\n ),\n );\n\nconst restOf = (layout: Layout, layers: Layers, { instance, target }: Reach): string =>\n pipe(\n layout.inner(instance)(target),\n Option.flatMap(below(layers.dir)),\n Option.getOrElse(() => \"\"),\n );\n\nconst hidden =\n (layout: Layout, reach: Reach) =>\n (to: LayerPosition, layers: Layers): boolean =>\n pipe(\n to.inner,\n Option.exists(\n (inner) =>\n !(reach.from.layer === to.layer && Equal.equals(reach.from.slice, to.slice)) &&\n isParted(layers)(to.layer) &&\n !layout.isEntry(reach.instance)(inner) &&\n !crossing({ layers, source: reach.from, target: to }) &&\n !layout.isOpen(reach.instance)(restOf(layout, layers, reach)),\n ),\n );\n\ninterface Target {\n readonly layers: Layers;\n readonly to: LayerPosition;\n}\n\nconst targetOf = (layout: Layout, { instance, target }: Reach): Option.Option<Target> => {\n const layers = Option.fromNullishOr(instance.kind.layers);\n const to = asLayer(layout.locate(instance)(target));\n return Option.all({ layers, to });\n};\n\nconst sliceName = ({ to }: Target): Option.Option<string> =>\n pipe(\n to.slice,\n Option.map((slice) => `${to.layer}/${slice}`),\n );\n\nconst publicApiFinding = (layout: Layout, edge: GraphEdge, reach: Reach): Option.Option<Finding> =>\n pipe(\n targetOf(layout, reach),\n Option.filter(({ layers, to }) => hidden(layout, reach)(to, layers)),\n Option.flatMap(sliceName),\n Option.map((slice) =>\n finding(\n edge,\n PUBLIC_API,\n `reaches into ${slice} past its public API (${edge.specifier}). Import the slice's entry file instead.`,\n ),\n ),\n );\n\nconst importFinding = (layout: Layout, edge: GraphEdge, reach: Reach): Option.Option<Finding> =>\n pipe(\n targetOf(layout, reach),\n Option.filter(() => Arr.contains(layout.owners(reach.target), reach.instance)),\n Option.flatMap(({ layers, to }) =>\n Option.orElse(direction({ layers, edge, source: reach.from, target: to }), () =>\n publicApiFinding(layout, edge, reach),\n ),\n ),\n );\n\nconst fileFindings = (layout: Layout, edge: GraphEdge, target: string): readonly Finding[] =>\n pipe(\n layout.located(edge.from),\n Arr.flatMap((located) => {\n const imported = pipe(\n asLayer(located.position),\n Option.flatMap((from) =>\n importFinding(layout, edge, { instance: located.instance, from, target }),\n ),\n );\n return Arr.appendAll(\n Option.toArray(wildcardFinding(layout, edge, located)),\n Option.toArray(imported),\n );\n }),\n );\n\nconst moduleTarget = (layers: Layers, target: readonly string[]): Option.Option<LayerPosition> =>\n pipe(\n Arr.head(target),\n Option.filter((layer) => isLayer(layers)(layer) && Option.isSome(Arr.get(target, ONE))),\n Option.map((layer): LayerPosition => ({\n type: \"layer\",\n layer,\n slice: Option.filter(Arr.get(target, ONE), () => isParted(layers)(layer)),\n inner: Option.none(),\n })),\n );\n\nconst moduleHop =\n (edge: GraphEdge, target: readonly string[]) =>\n (found: Omit<Hop, \"edge\" | \"target\">): Option.Option<Finding> =>\n pipe(\n moduleTarget(found.layers, target),\n Option.flatMap((to) => direction({ ...found, edge, target: to })),\n );\n\nconst moduleFindings = (\n layout: Layout,\n edge: GraphEdge,\n target: readonly string[],\n): readonly Finding[] =>\n pipe(\n layout.located(edge.from),\n Arr.flatMap(({ instance, position }) => {\n const layers = Option.fromNullishOr(instance.kind.layers);\n const source = asLayer(position);\n return pipe(\n Option.all({ layers, source }),\n Option.flatMap(moduleHop(edge, target)),\n Option.toArray,\n );\n }),\n );\n\nconst linkFindings = (layout: Layout, edge: GraphEdge, target: string): readonly Finding[] => {\n if (layout.exists(target)) {\n return [];\n }\n return [finding(edge, LINK_TARGET, `links to ${edge.specifier}, where no file is tracked.`)];\n};\n\nexport const checkImports =\n (edges: readonly GraphEdge[]) =>\n (layout: Layout): readonly Finding[] =>\n pipe(\n edges,\n Arr.flatMap((edge) => {\n if (edge.target.type === \"module\") {\n return moduleFindings(layout, edge, edge.target.value);\n }\n if (MARKDOWN.test(edge.from)) {\n return linkFindings(layout, edge, edge.target.value);\n }\n return fileFindings(layout, edge, edge.target.value);\n }),\n );\n","export interface Finding {\n readonly path: string;\n readonly line: number;\n readonly column: number;\n readonly rule: string;\n readonly message: string;\n}\n\nconst FIRST = 1;\n\nexport interface FileFinding {\n readonly path: string;\n readonly rule: string;\n readonly message: string;\n}\n\nexport const atFile = ({ path, rule, message }: FileFinding): Finding => ({\n path,\n line: FIRST,\n column: FIRST,\n rule,\n message,\n});\n","import { below, join, matcher } from \"@masseater.dev/path-kit\";\nimport type { Matcher } from \"@masseater.dev/path-kit\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nimport type { Kind } from \"#/entities/kind/index.ts\";\nimport type { Layout, Located } from \"#/entities/layout/index.ts\";\nimport { atFile } from \"#/shared/lib/finding.ts\";\nimport type { Finding } from \"#/shared/lib/finding.ts\";\n\nexport const PLACEMENT = \"placement\";\nexport const LOOSE_FILE = \"loose-file\";\nexport const LAYER_NAME = \"layer-name\";\n\ninterface Compiled {\n readonly files: Matcher;\n readonly allow: Matcher;\n readonly message: string;\n}\n\nconst compile = (kind: Kind): readonly Compiled[] =>\n pipe(\n kind.placements ?? [],\n Arr.map((placement) => ({\n files: matcher(placement.files),\n allow: matcher(placement.allow),\n message: placement.message ?? `is not a place a ${kind.name} allows for this file.`,\n })),\n );\n\nconst layersDir = (kind: Kind): string =>\n pipe(\n Option.fromNullishOr(kind.layers),\n Option.map(({ dir }) => dir),\n Option.getOrElse(() => \"\"),\n );\n\nconst layerMessage = (kind: Kind): string =>\n pipe(\n Option.fromNullishOr(kind.layers),\n Option.map(({ order }) => Arr.join(order, \", \")),\n Option.getOrElse(() => \"\"),\n (names) => `is not a layer. Use one of ${names}.`,\n );\n\nconst looseMessage = (kind: Kind): string =>\n `sits directly in ${layersDir(kind)}/. Put it in a layer.`;\n\nconst placementFindings =\n (compiled: (kind: Kind) => readonly Compiled[], path: string) =>\n (within: string, kind: Kind): readonly Finding[] =>\n pipe(\n compiled(kind),\n Arr.filter((placement) => placement.files(within) && !placement.allow(within)),\n Arr.map(({ message }) => atFile({ path, rule: PLACEMENT, message })),\n );\n\nconst positionFindings = (path: string, { instance, position }: Located): readonly Finding[] => {\n const { kind } = instance;\n if (position.type === \"loose\") {\n return [atFile({ path, rule: LOOSE_FILE, message: looseMessage(kind) })];\n }\n if (position.type !== \"unknownLayer\") {\n return [];\n }\n const base = join(instance.dir)(join(layersDir(kind))(position.layer));\n const reported = Option.match(below(base)(path), { onNone: () => path, onSome: () => base });\n return [atFile({ path: reported, rule: LAYER_NAME, message: layerMessage(kind) })];\n};\n\nconst findingsAt =\n (layout: Layout, compiled: (kind: Kind) => readonly Compiled[]) =>\n (path: string): readonly Finding[] =>\n pipe(\n layout.located(path),\n Arr.flatMap((located) => {\n const own = (within: string): readonly Finding[] =>\n Arr.appendAll(\n placementFindings(compiled, path)(within, located.instance.kind),\n positionFindings(path, located),\n );\n return Option.match(layout.inner(located.instance)(path), {\n onNone: (): readonly Finding[] => [],\n onSome: own,\n });\n }),\n );\n\nconst keyOf = ({ path, rule, message }: Finding): string => `${path}\\0${rule}\\0${message}`;\n\nexport const checkPlacement = (layout: Layout): readonly Finding[] => {\n const compiled = new Map(\n pipe(\n layout.instances,\n Arr.map(({ kind }) => [kind, compile(kind)] as const),\n ),\n );\n const lookup = (kind: Kind): readonly Compiled[] => compiled.get(kind) ?? [];\n const keyed = pipe(\n layout.files,\n Arr.flatMap(findingsAt(layout, lookup)),\n Arr.map((item) => [keyOf(item), item] as const),\n );\n return [...new Map(keyed).values()];\n};\n","import { Array as Arr, Option, Record as Rec, pipe } from \"effect\";\n\nimport type { Kind } from \"#/entities/kind/index.ts\";\nimport { makeLayout } from \"#/entities/layout/index.ts\";\nimport { definePlugin, defineRule } from \"#/entities/rule/index.ts\";\nimport {\n CROSS_SLICE,\n LAYER_IMPORT,\n LINK_TARGET,\n PUBLIC_API,\n WILDCARD_EXPORT,\n checkImports,\n} from \"#/features/check-imports/index.ts\";\nimport {\n LAYER_NAME,\n LOOSE_FILE,\n PLACEMENT,\n checkPlacement,\n} from \"#/features/check-placement/index.ts\";\nimport type { GraphEdge, Plugin, Rule, RuleEntry, WismConfig } from \"#/shared/config/index.ts\";\nimport type { Finding } from \"#/shared/lib/finding.ts\";\n\nexport const STRUCTURE_PLUGIN = \"structure\";\n\nconst DESCRIPTIONS: Readonly<Record<string, string>> = {\n [PLACEMENT]: \"Each file sits where its kind allows\",\n [LOOSE_FILE]: \"No module sits directly in the layers directory\",\n [LAYER_NAME]: \"Each directory under the layers directory is a layer\",\n [LAYER_IMPORT]: \"A layer only uses the layers below it\",\n [CROSS_SLICE]: \"Slices of one layer do not use each other\",\n [PUBLIC_API]: \"Other slices are used through their entry file\",\n [WILDCARD_EXPORT]: \"An entry file names what it exports\",\n [LINK_TARGET]: \"A Markdown link points at a tracked file\",\n};\n\nconst ERROR: RuleEntry = \"error\";\n\nexport const PRESETS = {\n fsd: [LAYER_NAME, LOOSE_FILE, LAYER_IMPORT, CROSS_SLICE, PUBLIC_API, WILDCARD_EXPORT],\n placement: [PLACEMENT],\n links: [LINK_TARGET],\n} as const satisfies Readonly<Record<string, readonly string[]>>;\n\nexport type PresetName = keyof typeof PRESETS;\n\nconst ALL: readonly PresetName[] = [\"fsd\", \"placement\", \"links\"];\n\nexport interface StructureOptions {\n readonly kinds: readonly Kind[];\n readonly presets?: readonly PresetName[];\n readonly ignores?: readonly string[];\n}\n\ntype Grouped = Readonly<Record<string, readonly Finding[]>>;\n\nconst analyze = (\n kinds: readonly Kind[],\n): ((files: readonly string[], edges: readonly GraphEdge[]) => Grouped) => {\n const cache = new WeakMap<readonly string[], Grouped>();\n const compute = (files: readonly string[], edges: readonly GraphEdge[]): Grouped => {\n const layout = makeLayout(kinds)(files);\n const grouped = Arr.groupBy(\n Arr.appendAll(checkPlacement(layout), checkImports(edges)(layout)),\n ({ rule }) => rule,\n );\n cache.set(files, grouped);\n return grouped;\n };\n return (files, edges) =>\n Option.getOrElse(Option.fromNullishOr(cache.get(files)), () => compute(files, edges));\n};\n\nexport const structurePlugin = (kinds: readonly Kind[]): Plugin => {\n const findings = analyze(kinds);\n const ruleOf = (description: string, name: string): Rule =>\n defineRule({\n meta: { description },\n check: ({ files, edges, report }) => {\n for (const { path, line, column, message } of findings(files, edges)[name] ?? []) {\n report({ path, line, column, message });\n }\n },\n });\n return definePlugin({ rules: pipe(DESCRIPTIONS, Rec.map(ruleOf)) });\n};\n\nconst rulesOf = (presets: readonly PresetName[]): Readonly<Record<string, RuleEntry>> =>\n pipe(\n presets,\n Arr.flatMap((name): readonly string[] => PRESETS[name]),\n Arr.dedupe,\n Arr.map((rule) => [`${STRUCTURE_PLUGIN}/${rule}`, ERROR] as const),\n Rec.fromEntries,\n );\n\nexport const structure = ({ kinds, presets = ALL, ignores }: StructureOptions): WismConfig => ({\n plugins: { [STRUCTURE_PLUGIN]: structurePlugin(kinds) },\n rules: rulesOf(presets),\n ...Option.match(Option.fromNullishOr(ignores), {\n onNone: () => ({}),\n onSome: (value) => ({ ignores: value }),\n }),\n});\n"],"ignoreList":[3,4,5,6,7,8,9,10,11],"mappings":";;;AAIA,MAAM,UACH,UACA,YACA,UACCA,QAAI,SAAS,KAAK,MAAM,KAAK,CAAC,GAAG,KAAK;AAE1C,MAAa,WAAW,QAAQ,WAAW,OAAO,MAAM;AAExD,MAAM,cAAc,QAAQ,WAAW,OAAO,SAAS;AAEvD,MAAa,YACV,YACA,UACC,SAAS,MAAM,CAAC,CAAC,KAAK,KAAK,YAAY,MAAM,CAAC,CAAC,KAAK;AAExD,MAAa,UAAU,QAAQ,WAAW,OAAO,KAAK;;ACftD,MAAa,aAAgC;CAC3C;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,SAA4B;CAAC;CAAS;CAAW;CAAY;AAAU;AAC7E,MAAM,UAA6B,CAAC,sCAAsC;AAC1E,MAAM,OAA0B,CAAC,SAAS;AAM1C,MAAMC,aAAW,EAAE,YACjB,OAAO,MAAM,OAAO,gBAAgB,KAAK,GAAG;CAC1C,eAAe,CAAC;CAChB,SAAS,WAAW,EAAE,OAAO,MAAM;AACrC,CAAC;AAEH,MAAa,aAAa,UAAyB,CAAC,OAAa;CAC/D,MAAM;CACN,QAAQ;CACR,GAAGA,UAAQ,OAAO;CAClB,YAAY,CACV;EACE,OAAO;EACP,OAAO;GAAC;GAAU;GAAU;GAA4B;GAAgB;EAAkB;EAC1F,SACE;CACJ,CACF;CACA,QAAQ;EACN,KAAK;EACL,OAAO;EACP,OAAO;EACP,QAAQ;EACR,W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