@happyvertical/smrt-core 0.51.11 → 0.51.16

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.
Files changed (67) hide show
  1. package/agents/schema-paths.md +23 -6
  2. package/dist/class.d.ts +1 -1
  3. package/dist/class.d.ts.map +1 -1
  4. package/dist/class.js +4 -2
  5. package/dist/class.js.map +1 -1
  6. package/dist/decorators/index.d.ts +19 -0
  7. package/dist/decorators/index.d.ts.map +1 -1
  8. package/dist/decorators/index.js.map +1 -1
  9. package/dist/index.js +1 -1
  10. package/dist/manifest/static-manifest.js +1 -1
  11. package/dist/manifest/static-manifest.js.map +1 -1
  12. package/dist/manifest/store.js +1 -1
  13. package/dist/manifest.json +1 -1
  14. package/dist/migrations/differ.d.ts +64 -5
  15. package/dist/migrations/differ.d.ts.map +1 -1
  16. package/dist/migrations/differ.js +274 -37
  17. package/dist/migrations/differ.js.map +1 -1
  18. package/dist/migrations/index.d.ts +1 -1
  19. package/dist/migrations/index.d.ts.map +1 -1
  20. package/dist/migrations/index.js +2 -2
  21. package/dist/migrations/sqlite-rebuild.d.ts +41 -0
  22. package/dist/migrations/sqlite-rebuild.d.ts.map +1 -1
  23. package/dist/migrations/sqlite-rebuild.js +68 -13
  24. package/dist/migrations/sqlite-rebuild.js.map +1 -1
  25. package/dist/migrations.js +2 -2
  26. package/dist/node_modules/.pnpm/{minimatch@10.2.5 → minimatch@10.2.6}/node_modules/minimatch/dist/esm/assert-valid-pattern.js +1 -1
  27. package/dist/node_modules/.pnpm/{minimatch@10.2.5 → minimatch@10.2.6}/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -1
  28. package/dist/node_modules/.pnpm/{minimatch@10.2.5 → minimatch@10.2.6}/node_modules/minimatch/dist/esm/ast.js +1 -1
  29. package/dist/node_modules/.pnpm/{minimatch@10.2.5 → minimatch@10.2.6}/node_modules/minimatch/dist/esm/ast.js.map +1 -1
  30. package/dist/node_modules/.pnpm/{minimatch@10.2.5 → minimatch@10.2.6}/node_modules/minimatch/dist/esm/brace-expressions.js +1 -1
  31. package/dist/node_modules/.pnpm/{minimatch@10.2.5 → minimatch@10.2.6}/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -1
  32. package/dist/node_modules/.pnpm/{minimatch@10.2.5 → minimatch@10.2.6}/node_modules/minimatch/dist/esm/escape.js +1 -1
  33. package/dist/node_modules/.pnpm/{minimatch@10.2.5 → minimatch@10.2.6}/node_modules/minimatch/dist/esm/escape.js.map +1 -1
  34. package/dist/node_modules/.pnpm/{minimatch@10.2.5 → minimatch@10.2.6}/node_modules/minimatch/dist/esm/index.js +1 -1
  35. package/dist/node_modules/.pnpm/{minimatch@10.2.5 → minimatch@10.2.6}/node_modules/minimatch/dist/esm/index.js.map +1 -1
  36. package/dist/node_modules/.pnpm/{minimatch@10.2.5 → minimatch@10.2.6}/node_modules/minimatch/dist/esm/unescape.js +1 -1
  37. package/dist/node_modules/.pnpm/{minimatch@10.2.5 → minimatch@10.2.6}/node_modules/minimatch/dist/esm/unescape.js.map +1 -1
  38. package/dist/registry/db-cache-key.d.ts +47 -0
  39. package/dist/registry/db-cache-key.d.ts.map +1 -0
  40. package/dist/registry/db-cache-key.js +201 -0
  41. package/dist/registry/db-cache-key.js.map +1 -0
  42. package/dist/registry/schema-builder.d.ts.map +1 -1
  43. package/dist/registry/schema-builder.js +6 -1
  44. package/dist/registry/schema-builder.js.map +1 -1
  45. package/dist/registry.d.ts +3 -0
  46. package/dist/registry.d.ts.map +1 -1
  47. package/dist/registry.js +5 -6
  48. package/dist/registry.js.map +1 -1
  49. package/dist/scanner/types.d.ts +2 -0
  50. package/dist/scanner/types.d.ts.map +1 -1
  51. package/dist/scanner/types.js.map +1 -1
  52. package/dist/schema/backfill.d.ts +16 -0
  53. package/dist/schema/backfill.d.ts.map +1 -0
  54. package/dist/schema/backfill.js +26 -0
  55. package/dist/schema/backfill.js.map +1 -0
  56. package/dist/schema/generator.d.ts.map +1 -1
  57. package/dist/schema/generator.js +3 -0
  58. package/dist/schema/generator.js.map +1 -1
  59. package/dist/schema/types.d.ts +12 -0
  60. package/dist/schema/types.d.ts.map +1 -1
  61. package/dist/smrt-knowledge.json +17 -17
  62. package/dist/vite-plugin/index.js +1 -1
  63. package/dist/vite-plugin/sync-apply-route.d.ts +7 -0
  64. package/dist/vite-plugin/sync-apply-route.d.ts.map +1 -1
  65. package/dist/vite-plugin/sync-apply-route.js +50 -3
  66. package/dist/vite-plugin/sync-apply-route.js.map +1 -1
  67. package/package.json +23 -23
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["#matchGlobstar","#matchOne","#matchGlobStarBodySections"],"sources":["../../../../../../../../../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/index.js"],"sourcesContent":["import { expand } from 'brace-expansion';\nimport { assertValidPattern } from './assert-valid-pattern.js';\nimport { AST } from './ast.js';\nimport { escape } from './escape.js';\nimport { unescape } from './unescape.js';\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 new Minimatch(pattern, options).match(p);\n};\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/;\nconst starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);\nconst starDotExtTestDot = (ext) => (f) => f.endsWith(ext);\nconst starDotExtTestNocase = (ext) => {\n ext = ext.toLowerCase();\n return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);\n};\nconst starDotExtTestNocaseDot = (ext) => {\n ext = ext.toLowerCase();\n return (f) => f.toLowerCase().endsWith(ext);\n};\nconst starDotStarRE = /^\\*+\\.\\*+$/;\nconst starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');\nconst starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');\nconst dotStarRE = /^\\.\\*+$/;\nconst dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');\nconst starRE = /^\\*+$/;\nconst starTest = (f) => f.length !== 0 && !f.startsWith('.');\nconst starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/;\nconst qmarksTestNocase = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestNocaseDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTest = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTestNoExt = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && !f.startsWith('.');\n};\nconst qmarksTestNoExtDot = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && f !== '.' && f !== '..';\n};\n/* c8 ignore start */\nconst defaultPlatform = (typeof process === 'object' && process ?\n (typeof process.env === 'object' &&\n process.env &&\n process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n 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;\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?';\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?';\nexport const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);\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 AST: class AST extends orig.AST {\n /* c8 ignore start */\n constructor(type, parent, options = {}) {\n super(type, parent, ext(def, options));\n }\n /* c8 ignore stop */\n static fromGlob(pattern, options = {}) {\n return orig.AST.fromGlob(pattern, ext(def, options));\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 makeRe: (pattern, options = {}) => orig.makeRe(pattern, 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 return expand(pattern, { max: options.braceExpandMax });\n};\nminimatch.braceExpand = braceExpand;\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nexport const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();\nminimatch.makeRe = makeRe;\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;\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/;\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\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 regexp;\n constructor(pattern, options = {}) {\n assertValidPattern(pattern);\n options = options || {};\n this.options = options;\n this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;\n this.pattern = pattern;\n this.platform = options.platform || defaultPlatform;\n this.isWindows = this.platform === 'win32';\n // avoid the annoying deprecation flag lol\n const awe = ('allowWindow' + 'sEscape');\n this.windowsPathsNoEscape =\n !!options.windowsPathsNoEscape || options[awe] === false;\n if (this.windowsPathsNoEscape) {\n this.pattern = this.pattern.replace(/\\\\/g, '/');\n }\n this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;\n this.regexp = null;\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 // make the set of regexps etc.\n this.make();\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 debug(..._) { }\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.braceExpand())];\n if (options.debug) {\n //oxlint-disable-next-line no-console\n this.debug = (...args) => console.error(...args);\n }\n this.debug(this.pattern, this.globSet);\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 regexps, 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 this.debug(this.pattern, this.globParts);\n // glob --> regexps\n let set = this.globParts.map((s, _, __) => {\n if (this.isWindows && this.windowsNoMagicRoot) {\n // check if it's a drive or unc path.\n const isUNC = s[0] === '' &&\n s[1] === '' &&\n (s[2] === '?' || !globMagic.test(s[2])) &&\n !globMagic.test(s[3]);\n const isDrive = /^[a-z]:/i.test(s[0]);\n if (isUNC) {\n return [\n ...s.slice(0, 4),\n ...s.slice(4).map(ss => this.parse(ss)),\n ];\n }\n else if (isDrive) {\n return [s[0], ...s.slice(1).map(ss => this.parse(ss))];\n }\n }\n return s.map(ss => this.parse(ss));\n });\n this.debug(this.pattern, set);\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 typeof p[3] === 'string' &&\n /^[a-z]:$/i.test(p[3])) {\n p[2] = '?';\n }\n }\n }\n this.debug(this.pattern, this.set);\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 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 (prev && prev !== '..' && prev !== '.' && 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 levelTwoFileOptimize(parts) {\n if (!Array.isArray(parts)) {\n parts = this.slashSplit(parts);\n }\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 let dd = 0;\n while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n const p = parts[dd - 1];\n if (p &&\n p !== '.' &&\n p !== '..' &&\n p !== '**' &&\n !(this.isWindows && /^[a-z]:$/i.test(p))) {\n didSomething = true;\n parts.splice(dd - 1, 2);\n dd -= 2;\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 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 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 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 let dd = 0;\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 -= 2;\n }\n }\n }\n } while (didSomething);\n return globParts;\n }\n // second phase: multi-pattern dedupes\n // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>\n // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>\n // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>\n //\n // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>\n // ^-- not valid because ** doens't follow symlinks\n secondPhasePreProcess(globParts) {\n for (let i = 0; i < globParts.length - 1; i++) {\n for (let j = i + 1; j < globParts.length; j++) {\n const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);\n if (matched) {\n globParts[i] = [];\n globParts[j] = matched;\n break;\n }\n }\n }\n return globParts.filter(gs => gs.length);\n }\n partsMatch(a, b, emptyGSMatch = false) {\n let ai = 0;\n let bi = 0;\n let result = [];\n let which = '';\n while (ai < a.length && bi < b.length) {\n if (a[ai] === b[bi]) {\n result.push(which === 'b' ? b[bi] : a[ai]);\n ai++;\n bi++;\n }\n else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n result.push(a[ai]);\n ai++;\n }\n else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n result.push(b[bi]);\n bi++;\n }\n else if (a[ai] === '*' &&\n b[bi] &&\n (this.options.dot || !b[bi].startsWith('.')) &&\n b[bi] !== '**') {\n if (which === 'b')\n return false;\n which = 'a';\n result.push(a[ai]);\n ai++;\n bi++;\n }\n else if (b[bi] === '*' &&\n a[ai] &&\n (this.options.dot || !a[ai].startsWith('.')) &&\n a[ai] !== '**') {\n if (which === 'a')\n return false;\n which = 'b';\n result.push(b[bi]);\n ai++;\n bi++;\n }\n else {\n return false;\n }\n }\n // if we fall out of the loop, it means they two are identical\n // as long as their lengths match\n return a.length === b.length && result;\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 // set partial to true to test if, for example,\n // \"/a/b\" matches the start of \"/*/b/*/d\"\n // Partial means, if you run out of file before you run\n // out of pattern, then that's fine, as long as all\n // the parts match.\n matchOne(file, pattern, partial = false) {\n let fileStartIndex = 0;\n let patternStartIndex = 0;\n // UNC paths like //?/X:/... can match X:/... and vice versa\n // Drive letters in absolute drive or unc paths are always compared\n // case-insensitively.\n 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 // start matching at the drive letter index of each\n if (fd.toLowerCase() === pd.toLowerCase()) {\n pattern[pdi] = fd;\n patternStartIndex = pdi;\n fileStartIndex = fdi;\n }\n }\n }\n // resolve and reduce . and .. portions in the file as well.\n // don't need to do the second phase, because it's only one string[]\n const { optimizationLevel = 1 } = this.options;\n if (optimizationLevel >= 2) {\n file = this.levelTwoFileOptimize(file);\n }\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 // split the pattern into head, tail, and middle of ** delimited parts\n const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);\n const lastgs = pattern.lastIndexOf(GLOBSTAR);\n // split the pattern up into globstar-delimited sections\n // the tail has to be at the end, and the others just have\n // to be found in order from the head.\n const [head, body, tail] = partial ?\n [\n pattern.slice(patternIndex, firstgs),\n pattern.slice(firstgs + 1),\n [],\n ]\n : [\n pattern.slice(patternIndex, firstgs),\n pattern.slice(firstgs + 1, lastgs),\n pattern.slice(lastgs + 1),\n ];\n // check the head, from the current file/pattern index.\n if (head.length) {\n const fileHead = file.slice(fileIndex, fileIndex + head.length);\n if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\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 // split the body up into sections, and note the minimum index it can\n // be found at (start with the length of all previous segments)\n // [section, before, after]\n const bodySegments = [[[], 0]];\n let currentBody = bodySegments[0];\n let nonGsParts = 0;\n const nonGsPartsSums = [0];\n for (const b of body) {\n if (b === GLOBSTAR) {\n nonGsPartsSums.push(nonGsParts);\n currentBody = [[], 0];\n bodySegments.push(currentBody);\n }\n else {\n currentBody[0].push(b);\n nonGsParts++;\n }\n }\n let i = bodySegments.length - 1;\n const fileLength = file.length - fileTailMatch;\n for (const b of bodySegments) {\n b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);\n }\n return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);\n }\n // return false for \"nope, not matching\"\n // return null for \"not matching, cannot keep trying\"\n #matchGlobStarBodySections(file, \n // pattern section, last possible position for it\n bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {\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 // just make sure that there's no bad dots\n for (let i = fileIndex; i < file.length; 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\n const [body, after] = bs;\n while (fileIndex <= after) {\n const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);\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, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);\n if (sub !== false) {\n return sub;\n }\n }\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 let fi;\n let pi;\n let pl;\n let fl;\n for (fi = fileIndex,\n pi = patternIndex,\n fl = file.length,\n pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {\n this.debug('matchOne loop');\n let p = pattern[pi];\n let f = file[fi];\n this.debug(pattern, p, f);\n // should be impossible.\n // some invalid regexp stuff in the set.\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 regexps.\n let hit;\n if (typeof p === 'string') {\n hit = f === p;\n this.debug('string match', p, f, hit);\n }\n else {\n hit = p.test(f);\n this.debug('pattern match', p, f, hit);\n }\n if (!hit)\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 \"\" matches against the\n // [^/]*? pattern, except in partial mode, where it might\n // 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 parse(pattern) {\n assertValidPattern(pattern);\n const options = this.options;\n // shortcuts\n if (pattern === '**')\n return GLOBSTAR;\n if (pattern === '')\n return '';\n // far and away, the most common glob pattern parts are\n // *, *.*, and *.<ext> Add a fast check method for those.\n let m;\n let fastTest = null;\n if ((m = pattern.match(starRE))) {\n fastTest = options.dot ? starTestDot : starTest;\n }\n else if ((m = pattern.match(starDotExtRE))) {\n fastTest = (options.nocase ?\n options.dot ?\n starDotExtTestNocaseDot\n : starDotExtTestNocase\n : options.dot ? starDotExtTestDot\n : starDotExtTest)(m[1]);\n }\n else if ((m = pattern.match(qmarksRE))) {\n fastTest = (options.nocase ?\n options.dot ?\n qmarksTestNocaseDot\n : qmarksTestNocase\n : options.dot ? qmarksTestDot\n : qmarksTest)(m);\n }\n else if ((m = pattern.match(starDotStarRE))) {\n fastTest = options.dot ? starDotStarTestDot : starDotStarTest;\n }\n else if ((m = pattern.match(dotStarRE))) {\n fastTest = dotStarTest;\n }\n const re = AST.fromGlob(pattern, this.options).toMMPattern();\n if (fastTest && typeof re === 'object') {\n // Avoids overriding in frozen environments\n Reflect.defineProperty(re, 'test', { value: fastTest });\n }\n return re;\n }\n makeRe() {\n if (this.regexp || this.regexp === false)\n return this.regexp;\n // at this point, this.set is a 2d array of partial\n // pattern strings, or \"**\".\n //\n // It's better to use .match(). This function shouldn't\n // be used, really, but it's pretty convenient sometimes,\n // when you just want to work with a regex.\n const set = this.set;\n if (!set.length) {\n this.regexp = false;\n return this.regexp;\n }\n const options = this.options;\n const twoStar = options.noglobstar ? star\n : options.dot ? twoStarDot\n : twoStarNoDot;\n const flags = new Set(options.nocase ? ['i'] : []);\n // regexpify non-globstar patterns\n // if ** is only item, then we just do one twoStar\n // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n // if ** is last, append (\\/twoStar|) to previous\n // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n // then filter out GLOBSTAR symbols\n let re = set\n .map(pattern => {\n const pp = pattern.map(p => {\n if (p instanceof RegExp) {\n for (const f of p.flags.split(''))\n flags.add(f);\n }\n return (typeof p === 'string' ? regExpEscape(p)\n : p === GLOBSTAR ? GLOBSTAR\n : p._src);\n });\n pp.forEach((p, i) => {\n const next = pp[i + 1];\n const prev = pp[i - 1];\n if (p !== GLOBSTAR || prev === GLOBSTAR) {\n return;\n }\n if (prev === undefined) {\n if (next !== undefined && next !== GLOBSTAR) {\n pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next;\n }\n else {\n pp[i] = twoStar;\n }\n }\n else if (next === undefined) {\n pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?';\n }\n else if (next !== GLOBSTAR) {\n pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next;\n pp[i + 1] = GLOBSTAR;\n }\n });\n const filtered = pp.filter(p => p !== GLOBSTAR);\n // For partial matches, we need to make the pattern match\n // any prefix of the full path. We do this by generating\n // alternative patterns that match progressively longer prefixes.\n if (this.partial && filtered.length >= 1) {\n const prefixes = [];\n for (let i = 1; i <= filtered.length; i++) {\n prefixes.push(filtered.slice(0, i).join('/'));\n }\n return '(?:' + prefixes.join('|') + ')';\n }\n return filtered.join('/');\n })\n .join('|');\n // need to wrap in parens if we had more than one thing with |,\n // otherwise only the first will be anchored to ^ and the last to $\n const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];\n // must match entire pattern\n // ending in a * or ** will make it less strict.\n re = '^' + open + re + close + '$';\n // In partial mode, '/' should always match as it's a valid prefix for any pattern\n if (this.partial) {\n re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$';\n }\n // can match anything, as long as it's not this.\n if (this.negate)\n re = '^(?!' + re + ').+$';\n try {\n this.regexp = new RegExp(re, [...flags].join(''));\n /* c8 ignore start */\n }\n catch {\n // should be impossible\n this.regexp = false;\n }\n /* c8 ignore stop */\n return this.regexp;\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 this.debug('match', f, this.pattern);\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 // windows: need to use /, not \\\n if (this.isWindows) {\n f = f.split('\\\\').join('/');\n }\n // treat the test path as a set of pathparts.\n const ff = this.slashSplit(f);\n this.debug(this.pattern, 'split', 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 this.debug(this.pattern, 'set', 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 (const pattern of set) {\n let file = ff;\n if (options.matchBase && pattern.length === 1) {\n file = [filename];\n }\n const hit = this.matchOne(file, 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 { AST } from './ast.js';\nexport { escape } from './escape.js';\nexport { unescape } from './unescape.js';\n/* c8 ignore stop */\nminimatch.AST = AST;\nminimatch.Minimatch =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AC,KAAK,GAAG;EAG9B,MAAM,KAAK,KAAK,WAAW,CAAC;EAC5B,KAAK,MAAM,KAAK,SAAS,SAAS,EAAE;EAKpC,MAAM,MAAM,KAAK;EACjB,KAAK,MAAM,KAAK,SAAS,OAAO,GAAG;EAEnC,IAAI,WAAW,GAAG,GAAG,SAAS;EAC9B,IAAI,CAAC,UACD,KAAK,IAAI,IAAI,GAAG,SAAS,GAAG,CAAC,YAAY,KAAK,GAAG,KAC7C,WAAW,GAAG;EAGtB,KAAK,MAAM,WAAW,KAAK;GACvB,IAAI,OAAO;GACX,IAAI,QAAQ,aAAa,QAAQ,WAAW,GACxC,OAAO,CAAC,QAAQ;GAGpB,IADY,KAAK,SAAS,MAAM,SAAS,OACnC,GAAG;IACL,IAAI,QAAQ,YACR,OAAO;IAEX,OAAO,CAAC,KAAK;GACjB;EACJ;EAGA,IAAI,QAAQ,YACR,OAAO;EAEX,OAAO,KAAK;CAChB;CACA,OAAO,SAAS,KAAK;EACjB,OAAO,UAAU,SAAS,GAAG,CAAC,CAAC;CACnC;AACJ;;AAMA,UAAU,MAAM;AAChB,UAAU,YAAY;AACtB,UAAU,SAAS;AACnB,UAAU,WAAW"}
1
+ {"version":3,"file":"index.js","names":["#matchGlobstar","#matchOne","#matchGlobStarBodySections"],"sources":["../../../../../../../../../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js"],"sourcesContent":["import { expand } from 'brace-expansion';\nimport { assertValidPattern } from './assert-valid-pattern.js';\nimport { AST } from './ast.js';\nimport { escape } from './escape.js';\nimport { unescape } from './unescape.js';\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 new Minimatch(pattern, options).match(p);\n};\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/;\nconst starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);\nconst starDotExtTestDot = (ext) => (f) => f.endsWith(ext);\nconst starDotExtTestNocase = (ext) => {\n ext = ext.toLowerCase();\n return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);\n};\nconst starDotExtTestNocaseDot = (ext) => {\n ext = ext.toLowerCase();\n return (f) => f.toLowerCase().endsWith(ext);\n};\nconst starDotStarRE = /^\\*+\\.\\*+$/;\nconst starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');\nconst starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');\nconst dotStarRE = /^\\.\\*+$/;\nconst dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');\nconst starRE = /^\\*+$/;\nconst starTest = (f) => f.length !== 0 && !f.startsWith('.');\nconst starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/;\nconst qmarksTestNocase = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestNocaseDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTest = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTestNoExt = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && !f.startsWith('.');\n};\nconst qmarksTestNoExtDot = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && f !== '.' && f !== '..';\n};\n/* c8 ignore start */\nconst defaultPlatform = (typeof process === 'object' && process ?\n (typeof process.env === 'object' &&\n process.env &&\n process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n 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;\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?';\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?';\nexport const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);\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 AST: class AST extends orig.AST {\n /* c8 ignore start */\n constructor(type, parent, options = {}) {\n super(type, parent, ext(def, options));\n }\n /* c8 ignore stop */\n static fromGlob(pattern, options = {}) {\n return orig.AST.fromGlob(pattern, ext(def, options));\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 makeRe: (pattern, options = {}) => orig.makeRe(pattern, 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 return expand(pattern, { max: options.braceExpandMax });\n};\nminimatch.braceExpand = braceExpand;\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nexport const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();\nminimatch.makeRe = makeRe;\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;\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/;\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\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 regexp;\n constructor(pattern, options = {}) {\n assertValidPattern(pattern);\n options = options || {};\n this.options = options;\n this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;\n this.pattern = pattern;\n this.platform = options.platform || defaultPlatform;\n this.isWindows = this.platform === 'win32';\n // avoid the annoying deprecation flag lol\n const awe = ('allowWindow' + 'sEscape');\n this.windowsPathsNoEscape =\n !!options.windowsPathsNoEscape || options[awe] === false;\n if (this.windowsPathsNoEscape) {\n this.pattern = this.pattern.replace(/\\\\/g, '/');\n }\n this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;\n this.regexp = null;\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 // make the set of regexps etc.\n this.make();\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 debug(..._) { }\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.braceExpand())];\n if (options.debug) {\n //oxlint-disable-next-line no-console\n this.debug = (...args) => console.error(...args);\n }\n this.debug(this.pattern, this.globSet);\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 regexps, 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 this.debug(this.pattern, this.globParts);\n // glob --> regexps\n let set = this.globParts.map((s, _, __) => {\n if (this.isWindows && this.windowsNoMagicRoot) {\n // check if it's a drive or unc path.\n const isUNC = s[0] === '' &&\n s[1] === '' &&\n (s[2] === '?' || !globMagic.test(s[2])) &&\n !globMagic.test(s[3]);\n const isDrive = /^[a-z]:/i.test(s[0]);\n if (isUNC) {\n return [\n ...s.slice(0, 4),\n ...s.slice(4).map(ss => this.parse(ss)),\n ];\n }\n else if (isDrive) {\n return [s[0], ...s.slice(1).map(ss => this.parse(ss))];\n }\n }\n return s.map(ss => this.parse(ss));\n });\n this.debug(this.pattern, set);\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 typeof p[3] === 'string' &&\n /^[a-z]:$/i.test(p[3])) {\n p[2] = '?';\n }\n }\n }\n this.debug(this.pattern, this.set);\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 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 (prev && prev !== '..' && prev !== '.' && 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 levelTwoFileOptimize(parts) {\n if (!Array.isArray(parts)) {\n parts = this.slashSplit(parts);\n }\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 let dd = 0;\n while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n const p = parts[dd - 1];\n if (p &&\n p !== '.' &&\n p !== '..' &&\n p !== '**' &&\n !(this.isWindows && /^[a-z]:$/i.test(p))) {\n didSomething = true;\n parts.splice(dd - 1, 2);\n dd -= 2;\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 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 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 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 let dd = 0;\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 -= 2;\n }\n }\n }\n } while (didSomething);\n return globParts;\n }\n // second phase: multi-pattern dedupes\n // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>\n // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>\n // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>\n //\n // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>\n // ^-- not valid because ** doens't follow symlinks\n secondPhasePreProcess(globParts) {\n for (let i = 0; i < globParts.length - 1; i++) {\n for (let j = i + 1; j < globParts.length; j++) {\n const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);\n if (matched) {\n globParts[i] = [];\n globParts[j] = matched;\n break;\n }\n }\n }\n return globParts.filter(gs => gs.length);\n }\n partsMatch(a, b, emptyGSMatch = false) {\n let ai = 0;\n let bi = 0;\n let result = [];\n let which = '';\n while (ai < a.length && bi < b.length) {\n if (a[ai] === b[bi]) {\n result.push(which === 'b' ? b[bi] : a[ai]);\n ai++;\n bi++;\n }\n else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n result.push(a[ai]);\n ai++;\n }\n else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n result.push(b[bi]);\n bi++;\n }\n else if (a[ai] === '*' &&\n b[bi] &&\n (this.options.dot || !b[bi].startsWith('.')) &&\n b[bi] !== '**') {\n if (which === 'b')\n return false;\n which = 'a';\n result.push(a[ai]);\n ai++;\n bi++;\n }\n else if (b[bi] === '*' &&\n a[ai] &&\n (this.options.dot || !a[ai].startsWith('.')) &&\n a[ai] !== '**') {\n if (which === 'a')\n return false;\n which = 'b';\n result.push(b[bi]);\n ai++;\n bi++;\n }\n else {\n return false;\n }\n }\n // if we fall out of the loop, it means they two are identical\n // as long as their lengths match\n return a.length === b.length && result;\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 // set partial to true to test if, for example,\n // \"/a/b\" matches the start of \"/*/b/*/d\"\n // Partial means, if you run out of file before you run\n // out of pattern, then that's fine, as long as all\n // the parts match.\n matchOne(file, pattern, partial = false) {\n let fileStartIndex = 0;\n let patternStartIndex = 0;\n // UNC paths like //?/X:/... can match X:/... and vice versa\n // Drive letters in absolute drive or unc paths are always compared\n // case-insensitively.\n 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 // start matching at the drive letter index of each\n if (fd.toLowerCase() === pd.toLowerCase()) {\n pattern[pdi] = fd;\n patternStartIndex = pdi;\n fileStartIndex = fdi;\n }\n }\n }\n // resolve and reduce . and .. portions in the file as well.\n // don't need to do the second phase, because it's only one string[]\n const { optimizationLevel = 1 } = this.options;\n if (optimizationLevel >= 2) {\n file = this.levelTwoFileOptimize(file);\n }\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 // split the pattern into head, tail, and middle of ** delimited parts\n const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);\n const lastgs = pattern.lastIndexOf(GLOBSTAR);\n // split the pattern up into globstar-delimited sections\n // the tail has to be at the end, and the others just have\n // to be found in order from the head.\n const [head, body, tail] = partial ?\n [\n pattern.slice(patternIndex, firstgs),\n pattern.slice(firstgs + 1),\n [],\n ]\n : [\n pattern.slice(patternIndex, firstgs),\n pattern.slice(firstgs + 1, lastgs),\n pattern.slice(lastgs + 1),\n ];\n // check the head, from the current file/pattern index.\n if (head.length) {\n const fileHead = file.slice(fileIndex, fileIndex + head.length);\n if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\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 // split the body up into sections, and note the minimum index it can\n // be found at (start with the length of all previous segments)\n // [section, before, after]\n const bodySegments = [[[], 0]];\n let currentBody = bodySegments[0];\n let nonGsParts = 0;\n const nonGsPartsSums = [0];\n for (const b of body) {\n if (b === GLOBSTAR) {\n nonGsPartsSums.push(nonGsParts);\n currentBody = [[], 0];\n bodySegments.push(currentBody);\n }\n else {\n currentBody[0].push(b);\n nonGsParts++;\n }\n }\n let i = bodySegments.length - 1;\n const fileLength = file.length - fileTailMatch;\n for (const b of bodySegments) {\n b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);\n }\n return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);\n }\n // return false for \"nope, not matching\"\n // return null for \"not matching, cannot keep trying\"\n #matchGlobStarBodySections(file, \n // pattern section, last possible position for it\n bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {\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 // just make sure that there's no bad dots\n for (let i = fileIndex; i < file.length; 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\n const [body, after] = bs;\n while (fileIndex <= after) {\n const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);\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, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);\n if (sub !== false) {\n return sub;\n }\n }\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 let fi;\n let pi;\n let pl;\n let fl;\n for (fi = fileIndex,\n pi = patternIndex,\n fl = file.length,\n pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {\n this.debug('matchOne loop');\n let p = pattern[pi];\n let f = file[fi];\n this.debug(pattern, p, f);\n // should be impossible.\n // some invalid regexp stuff in the set.\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 regexps.\n let hit;\n if (typeof p === 'string') {\n hit = f === p;\n this.debug('string match', p, f, hit);\n }\n else {\n hit = p.test(f);\n this.debug('pattern match', p, f, hit);\n }\n if (!hit)\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 \"\" matches against the\n // [^/]*? pattern, except in partial mode, where it might\n // 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 parse(pattern) {\n assertValidPattern(pattern);\n const options = this.options;\n // shortcuts\n if (pattern === '**')\n return GLOBSTAR;\n if (pattern === '')\n return '';\n // far and away, the most common glob pattern parts are\n // *, *.*, and *.<ext> Add a fast check method for those.\n let m;\n let fastTest = null;\n if ((m = pattern.match(starRE))) {\n fastTest = options.dot ? starTestDot : starTest;\n }\n else if ((m = pattern.match(starDotExtRE))) {\n fastTest = (options.nocase ?\n options.dot ?\n starDotExtTestNocaseDot\n : starDotExtTestNocase\n : options.dot ? starDotExtTestDot\n : starDotExtTest)(m[1]);\n }\n else if ((m = pattern.match(qmarksRE))) {\n fastTest = (options.nocase ?\n options.dot ?\n qmarksTestNocaseDot\n : qmarksTestNocase\n : options.dot ? qmarksTestDot\n : qmarksTest)(m);\n }\n else if ((m = pattern.match(starDotStarRE))) {\n fastTest = options.dot ? starDotStarTestDot : starDotStarTest;\n }\n else if ((m = pattern.match(dotStarRE))) {\n fastTest = dotStarTest;\n }\n const re = AST.fromGlob(pattern, this.options).toMMPattern();\n if (fastTest && typeof re === 'object') {\n // Avoids overriding in frozen environments\n Reflect.defineProperty(re, 'test', { value: fastTest });\n }\n return re;\n }\n makeRe() {\n if (this.regexp || this.regexp === false)\n return this.regexp;\n // at this point, this.set is a 2d array of partial\n // pattern strings, or \"**\".\n //\n // It's better to use .match(). This function shouldn't\n // be used, really, but it's pretty convenient sometimes,\n // when you just want to work with a regex.\n const set = this.set;\n if (!set.length) {\n this.regexp = false;\n return this.regexp;\n }\n const options = this.options;\n const twoStar = options.noglobstar ? star\n : options.dot ? twoStarDot\n : twoStarNoDot;\n const flags = new Set(options.nocase ? ['i'] : []);\n // regexpify non-globstar patterns\n // if ** is only item, then we just do one twoStar\n // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n // if ** is last, append (\\/twoStar|) to previous\n // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n // then filter out GLOBSTAR symbols\n let re = set\n .map(pattern => {\n const pp = pattern.map(p => {\n if (p instanceof RegExp) {\n for (const f of p.flags.split(''))\n flags.add(f);\n }\n return (typeof p === 'string' ? regExpEscape(p)\n : p === GLOBSTAR ? GLOBSTAR\n : p._src);\n });\n pp.forEach((p, i) => {\n const next = pp[i + 1];\n const prev = pp[i - 1];\n if (p !== GLOBSTAR || prev === GLOBSTAR) {\n return;\n }\n if (prev === undefined) {\n if (next !== undefined && next !== GLOBSTAR) {\n pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next;\n }\n else {\n pp[i] = twoStar;\n }\n }\n else if (next === undefined) {\n pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?';\n }\n else if (next !== GLOBSTAR) {\n pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next;\n pp[i + 1] = GLOBSTAR;\n }\n });\n const filtered = pp.filter(p => p !== GLOBSTAR);\n // For partial matches, we need to make the pattern match\n // any prefix of the full path. We do this by generating\n // alternative patterns that match progressively longer prefixes.\n if (this.partial && filtered.length >= 1) {\n const prefixes = [];\n for (let i = 1; i <= filtered.length; i++) {\n prefixes.push(filtered.slice(0, i).join('/'));\n }\n return '(?:' + prefixes.join('|') + ')';\n }\n return filtered.join('/');\n })\n .join('|');\n // need to wrap in parens if we had more than one thing with |,\n // otherwise only the first will be anchored to ^ and the last to $\n const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];\n // must match entire pattern\n // ending in a * or ** will make it less strict.\n re = '^' + open + re + close + '$';\n // In partial mode, '/' should always match as it's a valid prefix for any pattern\n if (this.partial) {\n re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$';\n }\n // can match anything, as long as it's not this.\n if (this.negate)\n re = '^(?!' + re + ').+$';\n try {\n this.regexp = new RegExp(re, [...flags].join(''));\n /* c8 ignore start */\n }\n catch {\n // should be impossible\n this.regexp = false;\n }\n /* c8 ignore stop */\n return this.regexp;\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 this.debug('match', f, this.pattern);\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 // windows: need to use /, not \\\n if (this.isWindows) {\n f = f.split('\\\\').join('/');\n }\n // treat the test path as a set of pathparts.\n const ff = this.slashSplit(f);\n this.debug(this.pattern, 'split', 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 this.debug(this.pattern, 'set', 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 (const pattern of set) {\n let file = ff;\n if (options.matchBase && pattern.length === 1) {\n file = [filename];\n }\n const hit = this.matchOne(file, 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 { AST } from './ast.js';\nexport { escape } from './escape.js';\nexport { unescape } from './unescape.js';\n/* c8 ignore stop */\nminimatch.AST = AST;\nminimatch.Minimatch = Minimatch;\nminimatch.escape = escape;\nminimatch.unescape = unescape;\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;AAKA,IAAa,aAAa,GAAG,SAAS,UAAU,CAAC,MAAM;CACnD,mBAAmB,OAAO;CAE1B,IAAI,CAAC,QAAQ,aAAa,QAAQ,OAAO,CAAC,MAAM,KAC5C,OAAO;CAEX,OAAO,IAAI,UAAU,SAAS,OAAO,CAAC,CAAC,MAAM,CAAC;AAClD;AAEA,IAAM,eAAe;AACrB,IAAM,kBAAkB,SAAS,MAAM,CAAC,EAAE,WAAW,GAAG,KAAK,EAAE,SAAS,GAAG;AAC3E,IAAM,qBAAqB,SAAS,MAAM,EAAE,SAAS,GAAG;AACxD,IAAM,wBAAwB,QAAQ;CAClC,MAAM,IAAI,YAAY;CACtB,QAAQ,MAAM,CAAC,EAAE,WAAW,GAAG,KAAK,EAAE,YAAY,CAAC,CAAC,SAAS,GAAG;AACpE;AACA,IAAM,2BAA2B,QAAQ;CACrC,MAAM,IAAI,YAAY;CACtB,QAAQ,MAAM,EAAE,YAAY,CAAC,CAAC,SAAS,GAAG;AAC9C;AACA,IAAM,gBAAgB;AACtB,IAAM,mBAAmB,MAAM,CAAC,EAAE,WAAW,GAAG,KAAK,EAAE,SAAS,GAAG;AACnE,IAAM,sBAAsB,MAAM,MAAM,OAAO,MAAM,Q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imatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js
2
2
  /**
3
3
  * Un-escape a string that has been escaped with {@link escape}.
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"unescape.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/unescape.js"],"sourcesContent":["/**\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 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"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,IAAa,YAAY,GAAG,EAAE,uBAAuB,OAAO,gBAAgB,SAAU,CAAC,MAAM;CACzF,IAAI,eACA,OAAO,uBACH,EAAE,QAAQ,iBAAiB,IAAI,IAC7B,EACG,QAAQ,4BAA4B,MAAM,CAAC,CAC3C,QAAQ,aAAa,IAAI;CAEtC,OAAO,uBACH,EAAE,QAAQ,mBAAmB,IAAI,IAC/B,EACG,QAAQ,8BAA8B,MAAM,CAAC,CAC7C,QAAQ,eAAe,IAAI;AACxC"}
1
+ {"version":3,"file":"unescape.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js"],"sourcesContent":["/**\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 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"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,IAAa,YAAY,GAAG,EAAE,uBAAuB,OAAO,gBAAgB,SAAU,CAAC,MAAM;CACzF,IAAI,eACA,OAAO,uBACH,EAAE,QAAQ,iBAAiB,IAAI,IAC7B,EACG,QAAQ,4BAA4B,MAAM,CAAC,CAC3C,QAAQ,aAAa,IAAI;CAEtC,OAAO,uBACH,EAAE,QAAQ,mBAAmB,IAAI,IAC/B,EACG,QAAQ,8BAA8B,MAAM,CAAC,CAC7C,QAAQ,eAAe,IAAI;AACxC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Stable cache identity for the collection cache's `db` option (#2306).
3
+ *
4
+ * `ObjectRegistry.getCollection()` derives its cache key partly from
5
+ * `options.db`, which accepts all three `DatabaseConfig` shapes. Real
6
+ * `DatabaseInterface` instances are keyed by object identity (issue #384),
7
+ * string URLs by value, but plain config objects used to fall into the
8
+ * identity path too — so semantically equivalent fresh `{ type, url }`
9
+ * objects missed the cache entirely and churned the LRU with duplicate
10
+ * initialization work.
11
+ *
12
+ * This module derives a stable, value-based key for config objects:
13
+ *
14
+ * - Real instances (anything with a callable `query()`) keep identity keys.
15
+ * - `:memory:` databases stay per-instance isolated — two in-memory
16
+ * databases that share the URL string are different databases, so sharing
17
+ * a cached collection between them would be a correctness bug.
18
+ * - The key derives from the *bounded* PostgreSQL URL
19
+ * (`applyPostgresRuntimeTimeouts`, #2377) so two configs that differ only
20
+ * in runtime timeouts — and therefore in the pool `resolveDatabase()`
21
+ * would hand the collection — cannot collide in the cache.
22
+ * - `authToken` participates through a SHA-256 digest, never as cleartext:
23
+ * cache keys are not credentials storage, and a leaked log line must not
24
+ * carry a bearer token. URL-embedded credentials (`postgres://user:pass@…`)
25
+ * get the same treatment: the userinfo is replaced by a digest so the key
26
+ * stays deterministic without carrying a password.
27
+ * - Remaining properties are canonicalized deterministically: sorted keys,
28
+ * nested containers recursed, and every string value runs through the
29
+ * same URL-credential redaction (not just `url`) so a
30
+ * `connectionString`-style option cannot smuggle a password into the
31
+ * key; opaque values (functions, symbols, bigints, non-plain objects
32
+ * such as pre-created `client` handles) are reduced to a
33
+ * reference-identity digest so property order and identity noise cannot
34
+ * split equivalent configs — while two distinct live objects can never
35
+ * merge into one cache entry.
36
+ *
37
+ * @see https://github.com/happyvertical/smrt/issues/2306
38
+ * @packageDocumentation
39
+ */
40
+ /**
41
+ * Resolve the collection-cache key fragment for a `db` option value.
42
+ *
43
+ * Returns `undefined` for a missing db, matching the historical shape of the
44
+ * cache key (absent db serializes as `null` in the JSON part of the key).
45
+ */
46
+ export declare function resolveCollectionDbCacheKey(db: unknown): string | undefined;
47
+ //# sourceMappingURL=db-cache-key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db-cache-key.d.ts","sourceRoot":"","sources":["../../src/registry/db-cache-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAqMH;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CA2E3E"}
@@ -0,0 +1,201 @@
1
+ import { applyPostgresRuntimeTimeouts } from "../postgres-timeouts.js";
2
+ import { getDbInstanceIds, getNextDbId, setNextDbId } from "./shared-state.js";
3
+ import { isDatabaseInterface } from "../database.js";
4
+ import { createHash } from "node:crypto";
5
+ //#region src/registry/db-cache-key.ts
6
+ /**
7
+ * Stable cache identity for the collection cache's `db` option (#2306).
8
+ *
9
+ * `ObjectRegistry.getCollection()` derives its cache key partly from
10
+ * `options.db`, which accepts all three `DatabaseConfig` shapes. Real
11
+ * `DatabaseInterface` instances are keyed by object identity (issue #384),
12
+ * string URLs by value, but plain config objects used to fall into the
13
+ * identity path too — so semantically equivalent fresh `{ type, url }`
14
+ * objects missed the cache entirely and churned the LRU with duplicate
15
+ * initialization work.
16
+ *
17
+ * This module derives a stable, value-based key for config objects:
18
+ *
19
+ * - Real instances (anything with a callable `query()`) keep identity keys.
20
+ * - `:memory:` databases stay per-instance isolated — two in-memory
21
+ * databases that share the URL string are different databases, so sharing
22
+ * a cached collection between them would be a correctness bug.
23
+ * - The key derives from the *bounded* PostgreSQL URL
24
+ * (`applyPostgresRuntimeTimeouts`, #2377) so two configs that differ only
25
+ * in runtime timeouts — and therefore in the pool `resolveDatabase()`
26
+ * would hand the collection — cannot collide in the cache.
27
+ * - `authToken` participates through a SHA-256 digest, never as cleartext:
28
+ * cache keys are not credentials storage, and a leaked log line must not
29
+ * carry a bearer token. URL-embedded credentials (`postgres://user:pass@…`)
30
+ * get the same treatment: the userinfo is replaced by a digest so the key
31
+ * stays deterministic without carrying a password.
32
+ * - Remaining properties are canonicalized deterministically: sorted keys,
33
+ * nested containers recursed, and every string value runs through the
34
+ * same URL-credential redaction (not just `url`) so a
35
+ * `connectionString`-style option cannot smuggle a password into the
36
+ * key; opaque values (functions, symbols, bigints, non-plain objects
37
+ * such as pre-created `client` handles) are reduced to a
38
+ * reference-identity digest so property order and identity noise cannot
39
+ * split equivalent configs — while two distinct live objects can never
40
+ * merge into one cache entry.
41
+ *
42
+ * @see https://github.com/happyvertical/smrt/issues/2306
43
+ * @packageDocumentation
44
+ */
45
+ /** Secret-ish values hashed into the key instead of embedded in it. */
46
+ var HASHED_DB_KEYS = /* @__PURE__ */ new Set(["authToken"]);
47
+ /**
48
+ * Reference-identity registry for opaque callable options. Two calls passing
49
+ * the SAME function share one cache scope; two distinct functions — even
50
+ * with identical source text, since `String(fn)` cannot tell them apart —
51
+ * stay separate. The conservative direction: an adapter-specific callback
52
+ * may close over state the collection initialization observes, so a value
53
+ * key that merged distinct functions would be a correctness risk, while
54
+ * splitting them only costs a cache entry.
55
+ */
56
+ var opaqueFunctionIds = /* @__PURE__ */ new WeakMap();
57
+ var nextOpaqueFunctionId = 1;
58
+ /**
59
+ * Reference-identity registry for opaque non-plain objects (PR #2922
60
+ * review). A pre-created adapter `client` (e.g. a pg `Pool` passed through
61
+ * a config object, `class.ts` Format 3) typically exposes its API on the
62
+ * prototype with few or no own enumerable keys — canonicalizing it as a
63
+ * plain record would reduce two distinct clients to the same `{}` and hand
64
+ * both configs a collection bound to the wrong client. Non-plain objects
65
+ * therefore key by reference: the same handle shares the entry, distinct
66
+ * handles never merge (splitting only costs a cache entry).
67
+ */
68
+ var opaqueObjectIds = /* @__PURE__ */ new WeakMap();
69
+ var nextOpaqueObjectId = 1;
70
+ /**
71
+ * True for values safe to canonicalize by structure: plain records
72
+ * (`{...}`, `Object.create(null)`) and arrays. Class instances, Maps,
73
+ * Sets, and other builtins carry behavior/identity on the prototype and
74
+ * must not be flattened to their enumerable keys.
75
+ */
76
+ function isPlainStructure(value) {
77
+ if (Array.isArray(value)) return true;
78
+ const proto = Object.getPrototypeOf(value);
79
+ return proto === Object.prototype || proto === null;
80
+ }
81
+ /**
82
+ * Reference-identity key fragment for opaque non-plain objects (see
83
+ * {@link opaqueObjectIds}).
84
+ */
85
+ function objectIdentityDigest(value) {
86
+ let id = opaqueObjectIds.get(value);
87
+ if (id === void 0) {
88
+ id = nextOpaqueObjectId++;
89
+ opaqueObjectIds.set(value, id);
90
+ }
91
+ return `objref:${id}`;
92
+ }
93
+ /**
94
+ * Redact URL-embedded credentials (PR #2922 review). A PostgreSQL URL such
95
+ * as `postgres://user:secret@host/db` would otherwise land verbatim in the
96
+ * cache key, contradicting this module's contract that keys never carry
97
+ * secrets. The userinfo is replaced by a truncated SHA-256 digest:
98
+ * deterministic (equal credentials → equal keys), distinguishing
99
+ * (different credentials → different keys), and irreversible.
100
+ * Non-URL strings (file paths, `:memory:`) pass through untouched.
101
+ */
102
+ function redactUrlCredentials(url) {
103
+ let parsed;
104
+ try {
105
+ parsed = new URL(url);
106
+ } catch {
107
+ return url;
108
+ }
109
+ if (!parsed.username && !parsed.password) return url;
110
+ const fingerprint = createHash("sha256").update(`${parsed.username}:${parsed.password}`).digest("hex").slice(0, 32);
111
+ parsed.username = `cred-${fingerprint}`;
112
+ parsed.password = "";
113
+ return parsed.toString();
114
+ }
115
+ /**
116
+ * Render an opaque value (symbol, bigint, over-deep object) as a stable
117
+ * textual digest. Distinct-but-textually-identical symbols remain possible
118
+ * here; symbols as database options are vanishingly rare and the collision
119
+ * only merges two configs that agree on every other property.
120
+ */
121
+ function digest(value) {
122
+ const source = typeof value === "symbol" ? value.toString() : typeof value === "bigint" ? `${value}n` : String(value);
123
+ return `opaque:${createHash("sha256").update(source).digest("hex")}`;
124
+ }
125
+ /**
126
+ * Reference-identity key fragment for callable options (see
127
+ * {@link opaqueFunctionIds}).
128
+ */
129
+ function functionDigest(value) {
130
+ let id = opaqueFunctionIds.get(value);
131
+ if (id === void 0) {
132
+ id = nextOpaqueFunctionId++;
133
+ opaqueFunctionIds.set(value, id);
134
+ }
135
+ return `fnref:${id}`;
136
+ }
137
+ /**
138
+ * Canonicalize a config-object value into a JSON-safe representation with
139
+ * deterministic key order and hashed secrets.
140
+ */
141
+ function canonicalizeValue(key, value, depth) {
142
+ if (value === null || value === void 0) return null;
143
+ if (HASHED_DB_KEYS.has(key) && typeof value === "string" && value !== "") return `sha256:${createHash("sha256").update(value).digest("hex")}`;
144
+ if (typeof value === "string" && value !== "") return redactUrlCredentials(value);
145
+ const t = typeof value;
146
+ if (t === "string" || t === "number" || t === "boolean") return value;
147
+ if (t === "function") return functionDigest(value);
148
+ if (t === "bigint" || t === "symbol") return digest(value);
149
+ if (Array.isArray(value)) return value.map((item) => canonicalizeValue(key, item, depth + 1));
150
+ if (t === "object") {
151
+ if (isDatabaseInterface(value)) return instanceKey(value);
152
+ if (!isPlainStructure(value)) return objectIdentityDigest(value);
153
+ if (depth >= 8) return digest(value);
154
+ const out = {};
155
+ for (const k of Object.keys(value).sort()) out[k] = canonicalizeValue(k, value[k], depth + 1);
156
+ return out;
157
+ }
158
+ return digest(value);
159
+ }
160
+ /**
161
+ * Identity key for a live `DatabaseInterface` instance (issue #384): the
162
+ * registry's `dbInstanceIds` WeakMap assigns each instance a stable
163
+ * per-process ID. Also used for `:memory:` config objects, which must stay
164
+ * per-call-site isolated.
165
+ */
166
+ function instanceKey(db) {
167
+ const ids = getDbInstanceIds();
168
+ if (!ids.has(db)) {
169
+ ids.set(db, getNextDbId());
170
+ setNextDbId(getNextDbId() + 1);
171
+ }
172
+ return `instance:${ids.get(db)}`;
173
+ }
174
+ /**
175
+ * Resolve the collection-cache key fragment for a `db` option value.
176
+ *
177
+ * Returns `undefined` for a missing db, matching the historical shape of the
178
+ * cache key (absent db serializes as `null` in the JSON part of the key).
179
+ */
180
+ function resolveCollectionDbCacheKey(db) {
181
+ if (db === void 0 || db === null) return void 0;
182
+ if (typeof db === "string") return `string:${redactUrlCredentials(db)}`;
183
+ if (typeof db !== "object") return void 0;
184
+ if (isDatabaseInterface(db)) return instanceKey(db);
185
+ const config = db;
186
+ const rawUrl = typeof config.url === "string" ? config.url : "";
187
+ const canUseMemory = !config.type || config.type === "sqlite" || config.type === "json";
188
+ if (rawUrl === ":memory:" || rawUrl === "memory" || rawUrl === "file::memory:" || !rawUrl && canUseMemory) return instanceKey(db);
189
+ const bounded = applyPostgresRuntimeTimeouts({
190
+ ...config,
191
+ ...rawUrl ? { url: rawUrl } : {}
192
+ });
193
+ if ("client" in config && config.client != null && !("client" in bounded)) bounded.client = config.client;
194
+ const canonical = {};
195
+ for (const k of Object.keys(bounded).sort()) canonical[k] = canonicalizeValue(k, bounded[k], 0);
196
+ return `config:${JSON.stringify(canonical)}`;
197
+ }
198
+ //#endregion
199
+ export { resolveCollectionDbCacheKey };
200
+
201
+ //# sourceMappingURL=db-cache-key.js.map