immosquare-cleaner 0.1.42 → 0.1.43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/immosquare-cleaner/version.rb +1 -1
- data/node_modules/.bin/ncu +1 -1
- data/node_modules/.bin/npm-check-updates +1 -1
- data/node_modules/.bin/rimraf +1 -1
- data/node_modules/@eslint/config-array/dist/cjs/index.cjs +5 -0
- data/node_modules/@eslint/config-array/dist/esm/index.js +5 -0
- data/node_modules/@eslint/config-array/package.json +1 -1
- data/node_modules/@eslint/js/package.json +1 -1
- data/node_modules/ansi-regex/index.d.ts +13 -9
- data/node_modules/ansi-regex/index.js +5 -3
- data/node_modules/ansi-regex/license +1 -1
- data/node_modules/ansi-regex/package.json +6 -9
- data/node_modules/ansi-regex/readme.md +8 -2
- data/node_modules/brace-expansion/README.md +0 -6
- data/node_modules/brace-expansion/index.js +84 -86
- data/node_modules/brace-expansion/package.json +4 -3
- data/node_modules/chalk/license +1 -1
- data/node_modules/chalk/package.json +23 -38
- data/node_modules/chalk/readme.md +85 -69
- data/node_modules/chalk/source/index.js +84 -80
- data/node_modules/eslint/lib/cli.js +0 -20
- data/node_modules/eslint/lib/languages/js/source-code/source-code.js +19 -0
- data/node_modules/eslint/lib/linter/apply-disable-directives.js +24 -12
- data/node_modules/eslint/lib/linter/linter.js +44 -20
- data/node_modules/eslint/lib/linter/report-translator.js +10 -10
- data/node_modules/eslint/lib/linter/rule-fixer.js +38 -15
- data/node_modules/eslint/lib/shared/flags.js +2 -2
- data/node_modules/eslint/package.json +5 -4
- data/node_modules/glob/LICENSE +7 -1
- data/node_modules/glob/README.md +284 -1120
- data/node_modules/glob/common.js +238 -0
- data/node_modules/glob/glob.js +790 -0
- data/node_modules/glob/package.json +34 -76
- data/node_modules/glob/sync.js +486 -0
- data/node_modules/lru-cache/LICENSE +1 -1
- data/node_modules/lru-cache/README.md +104 -1055
- data/node_modules/lru-cache/index.js +246 -1139
- data/node_modules/lru-cache/package.json +11 -75
- data/node_modules/minimatch/LICENSE +1 -1
- data/node_modules/minimatch/README.md +65 -289
- data/node_modules/minimatch/package.json +14 -67
- data/node_modules/npm-check-updates/README.md +9 -12
- data/node_modules/npm-check-updates/build/cli.js +21 -21
- data/node_modules/npm-check-updates/build/cli.js.map +1 -1
- data/node_modules/npm-check-updates/build/index-CWktU8PK.js +58 -0
- data/node_modules/npm-check-updates/build/index-CWktU8PK.js.map +1 -0
- data/node_modules/npm-check-updates/build/index.d.ts +1 -3
- data/node_modules/npm-check-updates/build/index.js +207 -223
- data/node_modules/npm-check-updates/build/index.js.map +1 -1
- data/node_modules/npm-check-updates/package.json +101 -105
- data/node_modules/rimraf/LICENSE +1 -1
- data/node_modules/rimraf/README.md +70 -188
- data/node_modules/rimraf/bin.js +50 -0
- data/node_modules/rimraf/package.json +16 -74
- data/node_modules/rimraf/rimraf.js +364 -0
- data/node_modules/semver/README.md +27 -221
- data/node_modules/semver/bin/semver.js +84 -107
- data/node_modules/semver/package.json +14 -63
- data/node_modules/semver/semver.js +1643 -0
- data/node_modules/strip-ansi/index.d.ts +4 -2
- data/node_modules/strip-ansi/index.js +3 -13
- data/node_modules/strip-ansi/license +1 -1
- data/node_modules/strip-ansi/package.json +7 -10
- data/node_modules/strip-ansi/readme.md +7 -2
- data/node_modules/strip-json-comments/index.d.ts +13 -18
- data/node_modules/strip-json-comments/index.js +38 -68
- data/node_modules/strip-json-comments/package.json +5 -13
- data/node_modules/strip-json-comments/readme.md +18 -15
- data/node_modules/yallist/package.json +1 -1
- data/node_modules/yallist/yallist.js +3 -3
- data/package.json +3 -3
- metadata +14 -736
- data/node_modules/@eslint/config-array/node_modules/minimatch/LICENSE +0 -15
- data/node_modules/@eslint/config-array/node_modules/minimatch/README.md +0 -230
- data/node_modules/@eslint/config-array/node_modules/minimatch/node_modules/brace-expansion/LICENSE +0 -21
- data/node_modules/@eslint/config-array/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -129
- data/node_modules/@eslint/config-array/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -201
- data/node_modules/@eslint/config-array/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -47
- data/node_modules/@eslint/config-array/node_modules/minimatch/package.json +0 -33
- data/node_modules/chalk/source/index.d.ts +0 -320
- data/node_modules/chalk/source/utilities.js +0 -33
- data/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
- data/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
- data/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
- data/node_modules/chalk/source/vendor/supports-color/browser.js +0 -30
- data/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
- data/node_modules/chalk/source/vendor/supports-color/index.js +0 -182
- data/node_modules/eslint/node_modules/chalk/license +0 -9
- data/node_modules/eslint/node_modules/chalk/package.json +0 -68
- data/node_modules/eslint/node_modules/chalk/readme.md +0 -341
- data/node_modules/eslint/node_modules/chalk/source/index.js +0 -229
- data/node_modules/eslint/node_modules/minimatch/LICENSE +0 -15
- data/node_modules/eslint/node_modules/minimatch/README.md +0 -230
- data/node_modules/eslint/node_modules/minimatch/minimatch.js +0 -947
- data/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/LICENSE +0 -21
- data/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -129
- data/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -201
- data/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -47
- data/node_modules/eslint/node_modules/minimatch/package.json +0 -33
- data/node_modules/eslint/node_modules/strip-ansi/index.d.ts +0 -17
- data/node_modules/eslint/node_modules/strip-ansi/index.js +0 -4
- data/node_modules/eslint/node_modules/strip-ansi/license +0 -9
- data/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/index.d.ts +0 -37
- data/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/index.js +0 -10
- data/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/license +0 -9
- data/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/package.json +0 -55
- data/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/readme.md +0 -78
- data/node_modules/eslint/node_modules/strip-ansi/package.json +0 -54
- data/node_modules/eslint/node_modules/strip-ansi/readme.md +0 -46
- data/node_modules/glob/dist/commonjs/glob.d.ts +0 -344
- data/node_modules/glob/dist/commonjs/glob.d.ts.map +0 -1
- data/node_modules/glob/dist/commonjs/glob.js +0 -243
- data/node_modules/glob/dist/commonjs/glob.js.map +0 -1
- data/node_modules/glob/dist/commonjs/has-magic.d.ts +0 -14
- data/node_modules/glob/dist/commonjs/has-magic.d.ts.map +0 -1
- data/node_modules/glob/dist/commonjs/has-magic.js +0 -27
- data/node_modules/glob/dist/commonjs/has-magic.js.map +0 -1
- data/node_modules/glob/dist/commonjs/ignore.d.ts +0 -20
- data/node_modules/glob/dist/commonjs/ignore.d.ts.map +0 -1
- data/node_modules/glob/dist/commonjs/ignore.js +0 -108
- data/node_modules/glob/dist/commonjs/ignore.js.map +0 -1
- data/node_modules/glob/dist/commonjs/index.d.ts +0 -96
- data/node_modules/glob/dist/commonjs/index.d.ts.map +0 -1
- data/node_modules/glob/dist/commonjs/index.js +0 -68
- data/node_modules/glob/dist/commonjs/index.js.map +0 -1
- data/node_modules/glob/dist/commonjs/package.json +0 -1
- data/node_modules/glob/dist/commonjs/pattern.d.ts +0 -77
- data/node_modules/glob/dist/commonjs/pattern.d.ts.map +0 -1
- data/node_modules/glob/dist/commonjs/pattern.js +0 -219
- data/node_modules/glob/dist/commonjs/pattern.js.map +0 -1
- data/node_modules/glob/dist/commonjs/processor.d.ts +0 -59
- data/node_modules/glob/dist/commonjs/processor.d.ts.map +0 -1
- data/node_modules/glob/dist/commonjs/processor.js +0 -302
- data/node_modules/glob/dist/commonjs/processor.js.map +0 -1
- data/node_modules/glob/dist/commonjs/walker.d.ts +0 -96
- data/node_modules/glob/dist/commonjs/walker.d.ts.map +0 -1
- data/node_modules/glob/dist/commonjs/walker.js +0 -358
- data/node_modules/glob/dist/commonjs/walker.js.map +0 -1
- data/node_modules/glob/dist/esm/bin.d.mts +0 -3
- data/node_modules/glob/dist/esm/bin.d.mts.map +0 -1
- data/node_modules/glob/dist/esm/bin.mjs +0 -275
- data/node_modules/glob/dist/esm/bin.mjs.map +0 -1
- data/node_modules/glob/dist/esm/glob.d.ts +0 -344
- data/node_modules/glob/dist/esm/glob.d.ts.map +0 -1
- data/node_modules/glob/dist/esm/glob.js +0 -239
- data/node_modules/glob/dist/esm/glob.js.map +0 -1
- data/node_modules/glob/dist/esm/has-magic.d.ts +0 -14
- data/node_modules/glob/dist/esm/has-magic.d.ts.map +0 -1
- data/node_modules/glob/dist/esm/has-magic.js +0 -23
- data/node_modules/glob/dist/esm/has-magic.js.map +0 -1
- data/node_modules/glob/dist/esm/ignore.d.ts +0 -20
- data/node_modules/glob/dist/esm/ignore.d.ts.map +0 -1
- data/node_modules/glob/dist/esm/ignore.js +0 -104
- data/node_modules/glob/dist/esm/ignore.js.map +0 -1
- data/node_modules/glob/dist/esm/index.d.ts +0 -96
- data/node_modules/glob/dist/esm/index.d.ts.map +0 -1
- data/node_modules/glob/dist/esm/index.js +0 -56
- data/node_modules/glob/dist/esm/index.js.map +0 -1
- data/node_modules/glob/dist/esm/package.json +0 -1
- data/node_modules/glob/dist/esm/pattern.d.ts +0 -77
- data/node_modules/glob/dist/esm/pattern.d.ts.map +0 -1
- data/node_modules/glob/dist/esm/pattern.js +0 -215
- data/node_modules/glob/dist/esm/pattern.js.map +0 -1
- data/node_modules/glob/dist/esm/processor.d.ts +0 -59
- data/node_modules/glob/dist/esm/processor.d.ts.map +0 -1
- data/node_modules/glob/dist/esm/processor.js +0 -295
- data/node_modules/glob/dist/esm/processor.js.map +0 -1
- data/node_modules/glob/dist/esm/walker.d.ts +0 -96
- data/node_modules/glob/dist/esm/walker.d.ts.map +0 -1
- data/node_modules/glob/dist/esm/walker.js +0 -352
- data/node_modules/glob/dist/esm/walker.js.map +0 -1
- data/node_modules/glob/node_modules/minimatch/LICENSE +0 -15
- data/node_modules/glob/node_modules/minimatch/README.md +0 -454
- data/node_modules/glob/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts +0 -2
- data/node_modules/glob/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/cjs/assert-valid-pattern.js +0 -14
- data/node_modules/glob/node_modules/minimatch/dist/cjs/assert-valid-pattern.js.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/cjs/ast.d.ts +0 -19
- data/node_modules/glob/node_modules/minimatch/dist/cjs/ast.d.ts.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/cjs/ast.js +0 -589
- data/node_modules/glob/node_modules/minimatch/dist/cjs/ast.js.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/cjs/brace-expressions.d.ts +0 -8
- data/node_modules/glob/node_modules/minimatch/dist/cjs/brace-expressions.d.ts.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/cjs/brace-expressions.js +0 -152
- data/node_modules/glob/node_modules/minimatch/dist/cjs/brace-expressions.js.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/cjs/escape.d.ts +0 -12
- data/node_modules/glob/node_modules/minimatch/dist/cjs/escape.d.ts.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/cjs/escape.js +0 -22
- data/node_modules/glob/node_modules/minimatch/dist/cjs/escape.js.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/cjs/index.d.ts +0 -94
- data/node_modules/glob/node_modules/minimatch/dist/cjs/index.d.ts.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/cjs/index.js +0 -1011
- data/node_modules/glob/node_modules/minimatch/dist/cjs/index.js.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/cjs/package.json +0 -3
- data/node_modules/glob/node_modules/minimatch/dist/cjs/unescape.d.ts +0 -17
- data/node_modules/glob/node_modules/minimatch/dist/cjs/unescape.d.ts.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/cjs/unescape.js +0 -24
- data/node_modules/glob/node_modules/minimatch/dist/cjs/unescape.js.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/mjs/assert-valid-pattern.d.ts +0 -2
- data/node_modules/glob/node_modules/minimatch/dist/mjs/assert-valid-pattern.d.ts.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/mjs/assert-valid-pattern.js +0 -10
- data/node_modules/glob/node_modules/minimatch/dist/mjs/assert-valid-pattern.js.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/mjs/ast.d.ts +0 -19
- data/node_modules/glob/node_modules/minimatch/dist/mjs/ast.d.ts.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/mjs/ast.js +0 -585
- data/node_modules/glob/node_modules/minimatch/dist/mjs/ast.js.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/mjs/brace-expressions.d.ts +0 -8
- data/node_modules/glob/node_modules/minimatch/dist/mjs/brace-expressions.d.ts.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/mjs/brace-expressions.js +0 -148
- data/node_modules/glob/node_modules/minimatch/dist/mjs/brace-expressions.js.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/mjs/escape.d.ts +0 -12
- data/node_modules/glob/node_modules/minimatch/dist/mjs/escape.d.ts.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/mjs/escape.js +0 -18
- data/node_modules/glob/node_modules/minimatch/dist/mjs/escape.js.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/mjs/index.d.ts +0 -94
- data/node_modules/glob/node_modules/minimatch/dist/mjs/index.d.ts.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/mjs/index.js +0 -995
- data/node_modules/glob/node_modules/minimatch/dist/mjs/index.js.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/mjs/package.json +0 -3
- data/node_modules/glob/node_modules/minimatch/dist/mjs/unescape.d.ts +0 -17
- data/node_modules/glob/node_modules/minimatch/dist/mjs/unescape.d.ts.map +0 -1
- data/node_modules/glob/node_modules/minimatch/dist/mjs/unescape.js +0 -20
- data/node_modules/glob/node_modules/minimatch/dist/mjs/unescape.js.map +0 -1
- data/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/LICENSE +0 -21
- data/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -135
- data/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -203
- data/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -46
- data/node_modules/glob/node_modules/minimatch/package.json +0 -86
- data/node_modules/glob/node_modules/minipass/LICENSE +0 -15
- data/node_modules/glob/node_modules/minipass/README.md +0 -825
- data/node_modules/glob/node_modules/minipass/dist/commonjs/index.d.ts +0 -549
- data/node_modules/glob/node_modules/minipass/dist/commonjs/index.d.ts.map +0 -1
- data/node_modules/glob/node_modules/minipass/dist/commonjs/index.js +0 -1028
- data/node_modules/glob/node_modules/minipass/dist/commonjs/index.js.map +0 -1
- data/node_modules/glob/node_modules/minipass/dist/commonjs/package.json +0 -1
- data/node_modules/glob/node_modules/minipass/dist/esm/index.d.ts +0 -549
- data/node_modules/glob/node_modules/minipass/dist/esm/index.d.ts.map +0 -1
- data/node_modules/glob/node_modules/minipass/dist/esm/index.js +0 -1018
- data/node_modules/glob/node_modules/minipass/dist/esm/index.js.map +0 -1
- data/node_modules/glob/node_modules/minipass/dist/esm/package.json +0 -1
- data/node_modules/glob/node_modules/minipass/package.json +0 -82
- data/node_modules/lru-cache/index.d.ts +0 -869
- data/node_modules/lru-cache/index.mjs +0 -1227
- data/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts +0 -2
- data/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts.map +0 -1
- data/node_modules/minimatch/dist/cjs/assert-valid-pattern.js +0 -14
- data/node_modules/minimatch/dist/cjs/assert-valid-pattern.js.map +0 -1
- data/node_modules/minimatch/dist/cjs/ast.d.ts +0 -19
- data/node_modules/minimatch/dist/cjs/ast.d.ts.map +0 -1
- data/node_modules/minimatch/dist/cjs/ast.js +0 -589
- data/node_modules/minimatch/dist/cjs/ast.js.map +0 -1
- data/node_modules/minimatch/dist/cjs/brace-expressions.d.ts +0 -8
- data/node_modules/minimatch/dist/cjs/brace-expressions.d.ts.map +0 -1
- data/node_modules/minimatch/dist/cjs/brace-expressions.js +0 -152
- data/node_modules/minimatch/dist/cjs/brace-expressions.js.map +0 -1
- data/node_modules/minimatch/dist/cjs/escape.d.ts +0 -12
- data/node_modules/minimatch/dist/cjs/escape.d.ts.map +0 -1
- data/node_modules/minimatch/dist/cjs/escape.js +0 -22
- data/node_modules/minimatch/dist/cjs/escape.js.map +0 -1
- data/node_modules/minimatch/dist/cjs/index.d.ts +0 -94
- data/node_modules/minimatch/dist/cjs/index.d.ts.map +0 -1
- data/node_modules/minimatch/dist/cjs/index.js +0 -1011
- data/node_modules/minimatch/dist/cjs/index.js.map +0 -1
- data/node_modules/minimatch/dist/cjs/package.json +0 -3
- data/node_modules/minimatch/dist/cjs/unescape.d.ts +0 -17
- data/node_modules/minimatch/dist/cjs/unescape.d.ts.map +0 -1
- data/node_modules/minimatch/dist/cjs/unescape.js +0 -24
- data/node_modules/minimatch/dist/cjs/unescape.js.map +0 -1
- data/node_modules/minimatch/dist/mjs/assert-valid-pattern.d.ts +0 -2
- data/node_modules/minimatch/dist/mjs/assert-valid-pattern.d.ts.map +0 -1
- data/node_modules/minimatch/dist/mjs/assert-valid-pattern.js +0 -10
- data/node_modules/minimatch/dist/mjs/assert-valid-pattern.js.map +0 -1
- data/node_modules/minimatch/dist/mjs/ast.d.ts +0 -19
- data/node_modules/minimatch/dist/mjs/ast.d.ts.map +0 -1
- data/node_modules/minimatch/dist/mjs/ast.js +0 -585
- data/node_modules/minimatch/dist/mjs/ast.js.map +0 -1
- data/node_modules/minimatch/dist/mjs/brace-expressions.d.ts +0 -8
- data/node_modules/minimatch/dist/mjs/brace-expressions.d.ts.map +0 -1
- data/node_modules/minimatch/dist/mjs/brace-expressions.js +0 -148
- data/node_modules/minimatch/dist/mjs/brace-expressions.js.map +0 -1
- data/node_modules/minimatch/dist/mjs/escape.d.ts +0 -12
- data/node_modules/minimatch/dist/mjs/escape.d.ts.map +0 -1
- data/node_modules/minimatch/dist/mjs/escape.js +0 -18
- data/node_modules/minimatch/dist/mjs/escape.js.map +0 -1
- data/node_modules/minimatch/dist/mjs/index.d.ts +0 -94
- data/node_modules/minimatch/dist/mjs/index.d.ts.map +0 -1
- data/node_modules/minimatch/dist/mjs/index.js +0 -995
- data/node_modules/minimatch/dist/mjs/index.js.map +0 -1
- data/node_modules/minimatch/dist/mjs/package.json +0 -3
- data/node_modules/minimatch/dist/mjs/unescape.d.ts +0 -17
- data/node_modules/minimatch/dist/mjs/unescape.d.ts.map +0 -1
- data/node_modules/minimatch/dist/mjs/unescape.js +0 -20
- data/node_modules/minimatch/dist/mjs/unescape.js.map +0 -1
- data/node_modules/npm-check-updates/build/index-5sFb3Tvv.js +0 -66
- data/node_modules/npm-check-updates/build/index-5sFb3Tvv.js.map +0 -1
- data/node_modules/npm-check-updates/build/package.json +0 -183
- data/node_modules/npm-check-updates/build/src/bin/cli.d.ts +0 -2
- data/node_modules/npm-check-updates/build/src/bin/cli.js +0 -182
- data/node_modules/npm-check-updates/build/src/bin/cli.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/cli-options.d.ts +0 -9
- data/node_modules/npm-check-updates/build/src/cli-options.js +0 -795
- data/node_modules/npm-check-updates/build/src/cli-options.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/index.d.ts +0 -17
- data/node_modules/npm-check-updates/build/src/index.js +0 -316
- data/node_modules/npm-check-updates/build/src/index.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/cache.d.ts +0 -17
- data/node_modules/npm-check-updates/build/src/lib/cache.js +0 -105
- data/node_modules/npm-check-updates/build/src/lib/cache.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/chalk.d.ts +0 -7
- data/node_modules/npm-check-updates/build/src/lib/chalk.js +0 -66
- data/node_modules/npm-check-updates/build/src/lib/chalk.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/determinePackageManager.d.ts +0 -8
- data/node_modules/npm-check-updates/build/src/lib/determinePackageManager.js +0 -32
- data/node_modules/npm-check-updates/build/src/lib/determinePackageManager.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/doctor.d.ts +0 -8
- data/node_modules/npm-check-updates/build/src/lib/doctor.js +0 -290
- data/node_modules/npm-check-updates/build/src/lib/doctor.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/exists.d.ts +0 -3
- data/node_modules/npm-check-updates/build/src/lib/exists.js +0 -10
- data/node_modules/npm-check-updates/build/src/lib/exists.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/figgy-pudding/index.d.ts +0 -2
- data/node_modules/npm-check-updates/build/src/lib/figgy-pudding/index.js +0 -112
- data/node_modules/npm-check-updates/build/src/lib/figgy-pudding/index.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/filterAndReject.d.ts +0 -12
- data/node_modules/npm-check-updates/build/src/lib/filterAndReject.js +0 -80
- data/node_modules/npm-check-updates/build/src/lib/filterAndReject.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/filterObject.d.ts +0 -4
- data/node_modules/npm-check-updates/build/src/lib/filterObject.js +0 -10
- data/node_modules/npm-check-updates/build/src/lib/filterObject.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/findLockfile.d.ts +0 -12
- data/node_modules/npm-check-updates/build/src/lib/findLockfile.js +0 -54
- data/node_modules/npm-check-updates/build/src/lib/findLockfile.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/findPackage.d.ts +0 -16
- data/node_modules/npm-check-updates/build/src/lib/findPackage.js +0 -78
- data/node_modules/npm-check-updates/build/src/lib/findPackage.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/getAllPackages.d.ts +0 -10
- data/node_modules/npm-check-updates/build/src/lib/getAllPackages.js +0 -126
- data/node_modules/npm-check-updates/build/src/lib/getAllPackages.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/getCurrentDependencies.d.ts +0 -15
- data/node_modules/npm-check-updates/build/src/lib/getCurrentDependencies.js +0 -76
- data/node_modules/npm-check-updates/build/src/lib/getCurrentDependencies.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/getIgnoredUpgrades.d.ts +0 -8
- data/node_modules/npm-check-updates/build/src/lib/getIgnoredUpgrades.js +0 -37
- data/node_modules/npm-check-updates/build/src/lib/getIgnoredUpgrades.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/getInstalledPackages.d.ts +0 -12
- data/node_modules/npm-check-updates/build/src/lib/getInstalledPackages.js +0 -35
- data/node_modules/npm-check-updates/build/src/lib/getInstalledPackages.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/getNcuRc.d.ts +0 -22
- data/node_modules/npm-check-updates/build/src/lib/getNcuRc.js +0 -60
- data/node_modules/npm-check-updates/build/src/lib/getNcuRc.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/getPackageManager.d.ts +0 -13
- data/node_modules/npm-check-updates/build/src/lib/getPackageManager.js +0 -30
- data/node_modules/npm-check-updates/build/src/lib/getPackageManager.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/getPeerDependencies.d.ts +0 -6
- data/node_modules/npm-check-updates/build/src/lib/getPeerDependencies.js +0 -31
- data/node_modules/npm-check-updates/build/src/lib/getPeerDependencies.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/getPeerDependenciesFromRegistry.d.ts +0 -12
- data/node_modules/npm-check-updates/build/src/lib/getPeerDependenciesFromRegistry.js +0 -35
- data/node_modules/npm-check-updates/build/src/lib/getPeerDependenciesFromRegistry.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/getPreferredWildcard.d.ts +0 -10
- data/node_modules/npm-check-updates/build/src/lib/getPreferredWildcard.js +0 -30
- data/node_modules/npm-check-updates/build/src/lib/getPreferredWildcard.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/getRepoUrl.d.ts +0 -11
- data/node_modules/npm-check-updates/build/src/lib/getRepoUrl.js +0 -81
- data/node_modules/npm-check-updates/build/src/lib/getRepoUrl.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/initOptions.d.ts +0 -7
- data/node_modules/npm-check-updates/build/src/lib/initOptions.js +0 -207
- data/node_modules/npm-check-updates/build/src/lib/initOptions.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/isUpgradeable.d.ts +0 -14
- data/node_modules/npm-check-updates/build/src/lib/isUpgradeable.js +0 -68
- data/node_modules/npm-check-updates/build/src/lib/isUpgradeable.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/keyValueBy.d.ts +0 -6
- data/node_modules/npm-check-updates/build/src/lib/keyValueBy.js +0 -23
- data/node_modules/npm-check-updates/build/src/lib/keyValueBy.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/libnpmconfig/index.d.ts +0 -3
- data/node_modules/npm-check-updates/build/src/lib/libnpmconfig/index.js +0 -108
- data/node_modules/npm-check-updates/build/src/lib/libnpmconfig/index.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/loadPackageInfoFromFile.d.ts +0 -5
- data/node_modules/npm-check-updates/build/src/lib/loadPackageInfoFromFile.js +0 -27
- data/node_modules/npm-check-updates/build/src/lib/loadPackageInfoFromFile.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/logging.d.ts +0 -77
- data/node_modules/npm-check-updates/build/src/lib/logging.js +0 -287
- data/node_modules/npm-check-updates/build/src/lib/logging.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/mergeOptions.d.ts +0 -69
- data/node_modules/npm-check-updates/build/src/lib/mergeOptions.js +0 -23
- data/node_modules/npm-check-updates/build/src/lib/mergeOptions.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/programError.d.ts +0 -6
- data/node_modules/npm-check-updates/build/src/lib/programError.js +0 -19
- data/node_modules/npm-check-updates/build/src/lib/programError.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/queryVersions.d.ts +0 -13
- data/node_modules/npm-check-updates/build/src/lib/queryVersions.js +0 -118
- data/node_modules/npm-check-updates/build/src/lib/queryVersions.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/resolveDepSections.d.ts +0 -4
- data/node_modules/npm-check-updates/build/src/lib/resolveDepSections.js +0 -20
- data/node_modules/npm-check-updates/build/src/lib/resolveDepSections.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/runGlobal.d.ts +0 -5
- data/node_modules/npm-check-updates/build/src/lib/runGlobal.js +0 -76
- data/node_modules/npm-check-updates/build/src/lib/runGlobal.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/runLocal.d.ts +0 -18
- data/node_modules/npm-check-updates/build/src/lib/runLocal.js +0 -239
- data/node_modules/npm-check-updates/build/src/lib/runLocal.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/table.d.ts +0 -7
- data/node_modules/npm-check-updates/build/src/lib/table.js +0 -27
- data/node_modules/npm-check-updates/build/src/lib/table.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/upgradeDependencies.d.ts +0 -14
- data/node_modules/npm-check-updates/build/src/lib/upgradeDependencies.js +0 -103
- data/node_modules/npm-check-updates/build/src/lib/upgradeDependencies.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/upgradePackageData.d.ts +0 -14
- data/node_modules/npm-check-updates/build/src/lib/upgradePackageData.js +0 -50
- data/node_modules/npm-check-updates/build/src/lib/upgradePackageData.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/upgradePackageDefinitions.d.ts +0 -13
- data/node_modules/npm-check-updates/build/src/lib/upgradePackageDefinitions.js +0 -58
- data/node_modules/npm-check-updates/build/src/lib/upgradePackageDefinitions.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/version-util.d.ts +0 -180
- data/node_modules/npm-check-updates/build/src/lib/version-util.js +0 -518
- data/node_modules/npm-check-updates/build/src/lib/version-util.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/lib/wrap.d.ts +0 -3
- data/node_modules/npm-check-updates/build/src/lib/wrap.js +0 -45
- data/node_modules/npm-check-updates/build/src/lib/wrap.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/package-managers/bun.d.ts +0 -18
- data/node_modules/npm-check-updates/build/src/package-managers/bun.js +0 -89
- data/node_modules/npm-check-updates/build/src/package-managers/bun.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/package-managers/filters.d.ts +0 -35
- data/node_modules/npm-check-updates/build/src/package-managers/filters.js +0 -96
- data/node_modules/npm-check-updates/build/src/package-managers/filters.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/package-managers/gitTags.d.ts +0 -16
- data/node_modules/npm-check-updates/build/src/package-managers/gitTags.js +0 -112
- data/node_modules/npm-check-updates/build/src/package-managers/gitTags.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/package-managers/index.d.ts +0 -4
- data/node_modules/npm-check-updates/build/src/package-managers/index.js +0 -40
- data/node_modules/npm-check-updates/build/src/package-managers/index.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/package-managers/npm.d.ts +0 -147
- data/node_modules/npm-check-updates/build/src/package-managers/npm.js +0 -688
- data/node_modules/npm-check-updates/build/src/package-managers/npm.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/package-managers/pnpm.d.ts +0 -25
- data/node_modules/npm-check-updates/build/src/package-managers/pnpm.js +0 -103
- data/node_modules/npm-check-updates/build/src/package-managers/pnpm.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/package-managers/staticRegistry.d.ts +0 -10
- data/node_modules/npm-check-updates/build/src/package-managers/staticRegistry.js +0 -52
- data/node_modules/npm-check-updates/build/src/package-managers/staticRegistry.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/package-managers/yarn.d.ts +0 -60
- data/node_modules/npm-check-updates/build/src/package-managers/yarn.js +0 -248
- data/node_modules/npm-check-updates/build/src/package-managers/yarn.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/scripts/build-options.d.ts +0 -1
- data/node_modules/npm-check-updates/build/src/scripts/build-options.js +0 -121
- data/node_modules/npm-check-updates/build/src/scripts/build-options.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/CLIOption.d.ts +0 -16
- data/node_modules/npm-check-updates/build/src/types/CLIOption.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/CLIOption.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/Cacher.d.ts +0 -10
- data/node_modules/npm-check-updates/build/src/types/Cacher.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/Cacher.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/ExtendedHelp.d.ts +0 -5
- data/node_modules/npm-check-updates/build/src/types/ExtendedHelp.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/ExtendedHelp.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/FilterFunction.d.ts +0 -3
- data/node_modules/npm-check-updates/build/src/types/FilterFunction.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/FilterFunction.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/FilterPattern.d.ts +0 -3
- data/node_modules/npm-check-updates/build/src/types/FilterPattern.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/FilterPattern.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/FilterResultsFunction.d.ts +0 -9
- data/node_modules/npm-check-updates/build/src/types/FilterResultsFunction.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/FilterResultsFunction.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/GetVersion.d.ts +0 -6
- data/node_modules/npm-check-updates/build/src/types/GetVersion.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/GetVersion.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/GroupFunction.d.ts +0 -4
- data/node_modules/npm-check-updates/build/src/types/GroupFunction.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/GroupFunction.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/IgnoredUpgrade.d.ts +0 -8
- data/node_modules/npm-check-updates/build/src/types/IgnoredUpgrade.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/IgnoredUpgrade.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/IndexType.d.ts +0 -4
- data/node_modules/npm-check-updates/build/src/types/IndexType.js +0 -4
- data/node_modules/npm-check-updates/build/src/types/IndexType.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/Maybe.d.ts +0 -2
- data/node_modules/npm-check-updates/build/src/types/Maybe.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/Maybe.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/MockedVersions.d.ts +0 -5
- data/node_modules/npm-check-updates/build/src/types/MockedVersions.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/MockedVersions.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/NpmConfig.d.ts +0 -4
- data/node_modules/npm-check-updates/build/src/types/NpmConfig.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/NpmConfig.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/NpmOptions.d.ts +0 -6
- data/node_modules/npm-check-updates/build/src/types/NpmOptions.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/NpmOptions.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/Options.d.ts +0 -17
- data/node_modules/npm-check-updates/build/src/types/Options.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/Options.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/PackageFile.d.ts +0 -24
- data/node_modules/npm-check-updates/build/src/types/PackageFile.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/PackageFile.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/PackageFileRepository.d.ts +0 -5
- data/node_modules/npm-check-updates/build/src/types/PackageFileRepository.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/PackageFileRepository.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/PackageInfo.d.ts +0 -8
- data/node_modules/npm-check-updates/build/src/types/PackageInfo.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/PackageInfo.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/PackageManager.d.ts +0 -18
- data/node_modules/npm-check-updates/build/src/types/PackageManager.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/PackageManager.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/PackageManagerName.d.ts +0 -2
- data/node_modules/npm-check-updates/build/src/types/PackageManagerName.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/PackageManagerName.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/Packument.d.ts +0 -13
- data/node_modules/npm-check-updates/build/src/types/Packument.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/Packument.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/RunOptions.d.ts +0 -137
- data/node_modules/npm-check-updates/build/src/types/RunOptions.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/RunOptions.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/SpawnOptions.d.ts +0 -6
- data/node_modules/npm-check-updates/build/src/types/SpawnOptions.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/SpawnOptions.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/StaticRegistry.d.ts +0 -4
- data/node_modules/npm-check-updates/build/src/types/StaticRegistry.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/StaticRegistry.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/Target.d.ts +0 -9
- data/node_modules/npm-check-updates/build/src/types/Target.js +0 -6
- data/node_modules/npm-check-updates/build/src/types/Target.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/TargetFunction.d.ts +0 -3
- data/node_modules/npm-check-updates/build/src/types/TargetFunction.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/TargetFunction.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/UpgradeGroup.d.ts +0 -1
- data/node_modules/npm-check-updates/build/src/types/UpgradeGroup.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/UpgradeGroup.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/Version.d.ts +0 -2
- data/node_modules/npm-check-updates/build/src/types/Version.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/Version.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/VersionLevel.d.ts +0 -2
- data/node_modules/npm-check-updates/build/src/types/VersionLevel.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/VersionLevel.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/VersionResult.d.ts +0 -7
- data/node_modules/npm-check-updates/build/src/types/VersionResult.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/VersionResult.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/VersionSpec.d.ts +0 -2
- data/node_modules/npm-check-updates/build/src/types/VersionSpec.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/VersionSpec.js.map +0 -1
- data/node_modules/npm-check-updates/node_modules/chalk/license +0 -9
- data/node_modules/npm-check-updates/node_modules/chalk/package.json +0 -83
- data/node_modules/npm-check-updates/node_modules/chalk/readme.md +0 -325
- data/node_modules/npm-check-updates/node_modules/chalk/source/index.d.ts +0 -320
- data/node_modules/npm-check-updates/node_modules/chalk/source/index.js +0 -225
- data/node_modules/npm-check-updates/node_modules/chalk/source/utilities.js +0 -33
- data/node_modules/npm-check-updates/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
- data/node_modules/npm-check-updates/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
- data/node_modules/npm-check-updates/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
- data/node_modules/npm-check-updates/node_modules/chalk/source/vendor/supports-color/browser.js +0 -30
- data/node_modules/npm-check-updates/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
- data/node_modules/npm-check-updates/node_modules/chalk/source/vendor/supports-color/index.js +0 -182
- data/node_modules/npm-check-updates/node_modules/minimatch/LICENSE +0 -15
- data/node_modules/npm-check-updates/node_modules/minimatch/README.md +0 -454
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts +0 -2
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/assert-valid-pattern.js +0 -14
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/assert-valid-pattern.js.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/ast.d.ts +0 -19
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/ast.d.ts.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/ast.js +0 -589
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/ast.js.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/brace-expressions.d.ts +0 -8
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/brace-expressions.d.ts.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/brace-expressions.js +0 -152
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/brace-expressions.js.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/escape.d.ts +0 -12
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/escape.d.ts.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/escape.js +0 -22
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/escape.js.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/index.d.ts +0 -94
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/index.d.ts.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/index.js +0 -1011
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/index.js.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/package.json +0 -3
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/unescape.d.ts +0 -17
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/unescape.d.ts.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/unescape.js +0 -24
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/cjs/unescape.js.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/assert-valid-pattern.d.ts +0 -2
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/assert-valid-pattern.d.ts.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/assert-valid-pattern.js +0 -10
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/assert-valid-pattern.js.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/ast.d.ts +0 -19
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/ast.d.ts.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/ast.js +0 -585
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/ast.js.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/brace-expressions.d.ts +0 -8
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/brace-expressions.d.ts.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/brace-expressions.js +0 -148
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/brace-expressions.js.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/escape.d.ts +0 -12
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/escape.d.ts.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/escape.js +0 -18
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/escape.js.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/index.d.ts +0 -94
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/index.d.ts.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/index.js +0 -995
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/index.js.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/package.json +0 -3
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/unescape.d.ts +0 -17
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/unescape.d.ts.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/unescape.js +0 -20
- data/node_modules/npm-check-updates/node_modules/minimatch/dist/mjs/unescape.js.map +0 -1
- data/node_modules/npm-check-updates/node_modules/minimatch/node_modules/brace-expansion/LICENSE +0 -21
- data/node_modules/npm-check-updates/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -135
- data/node_modules/npm-check-updates/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -203
- data/node_modules/npm-check-updates/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -46
- data/node_modules/npm-check-updates/node_modules/minimatch/package.json +0 -86
- data/node_modules/npm-check-updates/node_modules/strip-ansi/index.d.ts +0 -15
- data/node_modules/npm-check-updates/node_modules/strip-ansi/index.js +0 -14
- data/node_modules/npm-check-updates/node_modules/strip-ansi/license +0 -9
- data/node_modules/npm-check-updates/node_modules/strip-ansi/node_modules/ansi-regex/index.d.ts +0 -33
- data/node_modules/npm-check-updates/node_modules/strip-ansi/node_modules/ansi-regex/index.js +0 -8
- data/node_modules/npm-check-updates/node_modules/strip-ansi/node_modules/ansi-regex/license +0 -9
- data/node_modules/npm-check-updates/node_modules/strip-ansi/node_modules/ansi-regex/package.json +0 -58
- data/node_modules/npm-check-updates/node_modules/strip-ansi/node_modules/ansi-regex/readme.md +0 -72
- data/node_modules/npm-check-updates/node_modules/strip-ansi/package.json +0 -57
- data/node_modules/npm-check-updates/node_modules/strip-ansi/readme.md +0 -41
- data/node_modules/rimraf/dist/commonjs/default-tmp.d.ts +0 -3
- data/node_modules/rimraf/dist/commonjs/default-tmp.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/default-tmp.js +0 -61
- data/node_modules/rimraf/dist/commonjs/default-tmp.js.map +0 -1
- data/node_modules/rimraf/dist/commonjs/fix-eperm.d.ts +0 -3
- data/node_modules/rimraf/dist/commonjs/fix-eperm.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/fix-eperm.js +0 -58
- data/node_modules/rimraf/dist/commonjs/fix-eperm.js.map +0 -1
- data/node_modules/rimraf/dist/commonjs/fs.d.ts +0 -17
- data/node_modules/rimraf/dist/commonjs/fs.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/fs.js +0 -46
- data/node_modules/rimraf/dist/commonjs/fs.js.map +0 -1
- data/node_modules/rimraf/dist/commonjs/ignore-enoent.d.ts +0 -3
- data/node_modules/rimraf/dist/commonjs/ignore-enoent.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/ignore-enoent.js +0 -21
- data/node_modules/rimraf/dist/commonjs/ignore-enoent.js.map +0 -1
- data/node_modules/rimraf/dist/commonjs/index.d.ts +0 -50
- data/node_modules/rimraf/dist/commonjs/index.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/index.js +0 -76
- data/node_modules/rimraf/dist/commonjs/index.js.map +0 -1
- data/node_modules/rimraf/dist/commonjs/opt-arg.d.ts +0 -35
- data/node_modules/rimraf/dist/commonjs/opt-arg.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/opt-arg.js +0 -53
- data/node_modules/rimraf/dist/commonjs/opt-arg.js.map +0 -1
- data/node_modules/rimraf/dist/commonjs/package.json +0 -1
- data/node_modules/rimraf/dist/commonjs/path-arg.d.ts +0 -4
- data/node_modules/rimraf/dist/commonjs/path-arg.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/path-arg.js +0 -54
- data/node_modules/rimraf/dist/commonjs/path-arg.js.map +0 -1
- data/node_modules/rimraf/dist/commonjs/platform.d.ts +0 -3
- data/node_modules/rimraf/dist/commonjs/platform.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/platform.js +0 -4
- data/node_modules/rimraf/dist/commonjs/platform.js.map +0 -1
- data/node_modules/rimraf/dist/commonjs/readdir-or-error.d.ts +0 -5
- data/node_modules/rimraf/dist/commonjs/readdir-or-error.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/readdir-or-error.js +0 -19
- data/node_modules/rimraf/dist/commonjs/readdir-or-error.js.map +0 -1
- data/node_modules/rimraf/dist/commonjs/retry-busy.d.ts +0 -8
- data/node_modules/rimraf/dist/commonjs/retry-busy.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/retry-busy.js +0 -68
- data/node_modules/rimraf/dist/commonjs/retry-busy.js.map +0 -1
- data/node_modules/rimraf/dist/commonjs/rimraf-manual.d.ts +0 -3
- data/node_modules/rimraf/dist/commonjs/rimraf-manual.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/rimraf-manual.js +0 -12
- data/node_modules/rimraf/dist/commonjs/rimraf-manual.js.map +0 -1
- data/node_modules/rimraf/dist/commonjs/rimraf-move-remove.d.ts +0 -4
- data/node_modules/rimraf/dist/commonjs/rimraf-move-remove.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/rimraf-move-remove.js +0 -192
- data/node_modules/rimraf/dist/commonjs/rimraf-move-remove.js.map +0 -1
- data/node_modules/rimraf/dist/commonjs/rimraf-native.d.ts +0 -4
- data/node_modules/rimraf/dist/commonjs/rimraf-native.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/rimraf-native.js +0 -24
- data/node_modules/rimraf/dist/commonjs/rimraf-native.js.map +0 -1
- data/node_modules/rimraf/dist/commonjs/rimraf-posix.d.ts +0 -4
- data/node_modules/rimraf/dist/commonjs/rimraf-posix.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/rimraf-posix.js +0 -123
- data/node_modules/rimraf/dist/commonjs/rimraf-posix.js.map +0 -1
- data/node_modules/rimraf/dist/commonjs/rimraf-windows.d.ts +0 -4
- data/node_modules/rimraf/dist/commonjs/rimraf-windows.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/rimraf-windows.js +0 -182
- data/node_modules/rimraf/dist/commonjs/rimraf-windows.js.map +0 -1
- data/node_modules/rimraf/dist/commonjs/use-native.d.ts +0 -4
- data/node_modules/rimraf/dist/commonjs/use-native.d.ts.map +0 -1
- data/node_modules/rimraf/dist/commonjs/use-native.js +0 -22
- data/node_modules/rimraf/dist/commonjs/use-native.js.map +0 -1
- data/node_modules/rimraf/dist/esm/bin.d.mts +0 -8
- data/node_modules/rimraf/dist/esm/bin.d.mts.map +0 -1
- data/node_modules/rimraf/dist/esm/bin.mjs +0 -256
- data/node_modules/rimraf/dist/esm/bin.mjs.map +0 -1
- data/node_modules/rimraf/dist/esm/default-tmp.d.ts +0 -3
- data/node_modules/rimraf/dist/esm/default-tmp.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/default-tmp.js +0 -55
- data/node_modules/rimraf/dist/esm/default-tmp.js.map +0 -1
- data/node_modules/rimraf/dist/esm/fix-eperm.d.ts +0 -3
- data/node_modules/rimraf/dist/esm/fix-eperm.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/fix-eperm.js +0 -53
- data/node_modules/rimraf/dist/esm/fix-eperm.js.map +0 -1
- data/node_modules/rimraf/dist/esm/fs.d.ts +0 -17
- data/node_modules/rimraf/dist/esm/fs.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/fs.js +0 -31
- data/node_modules/rimraf/dist/esm/fs.js.map +0 -1
- data/node_modules/rimraf/dist/esm/ignore-enoent.d.ts +0 -3
- data/node_modules/rimraf/dist/esm/ignore-enoent.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/ignore-enoent.js +0 -16
- data/node_modules/rimraf/dist/esm/ignore-enoent.js.map +0 -1
- data/node_modules/rimraf/dist/esm/index.d.ts +0 -50
- data/node_modules/rimraf/dist/esm/index.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/index.js +0 -68
- data/node_modules/rimraf/dist/esm/index.js.map +0 -1
- data/node_modules/rimraf/dist/esm/opt-arg.d.ts +0 -35
- data/node_modules/rimraf/dist/esm/opt-arg.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/opt-arg.js +0 -46
- data/node_modules/rimraf/dist/esm/opt-arg.js.map +0 -1
- data/node_modules/rimraf/dist/esm/package.json +0 -1
- data/node_modules/rimraf/dist/esm/path-arg.d.ts +0 -4
- data/node_modules/rimraf/dist/esm/path-arg.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/path-arg.js +0 -49
- data/node_modules/rimraf/dist/esm/path-arg.js.map +0 -1
- data/node_modules/rimraf/dist/esm/platform.d.ts +0 -3
- data/node_modules/rimraf/dist/esm/platform.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/platform.js +0 -2
- data/node_modules/rimraf/dist/esm/platform.js.map +0 -1
- data/node_modules/rimraf/dist/esm/readdir-or-error.d.ts +0 -5
- data/node_modules/rimraf/dist/esm/readdir-or-error.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/readdir-or-error.js +0 -14
- data/node_modules/rimraf/dist/esm/readdir-or-error.js.map +0 -1
- data/node_modules/rimraf/dist/esm/retry-busy.d.ts +0 -8
- data/node_modules/rimraf/dist/esm/retry-busy.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/retry-busy.js +0 -63
- data/node_modules/rimraf/dist/esm/retry-busy.js.map +0 -1
- data/node_modules/rimraf/dist/esm/rimraf-manual.d.ts +0 -3
- data/node_modules/rimraf/dist/esm/rimraf-manual.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/rimraf-manual.js +0 -6
- data/node_modules/rimraf/dist/esm/rimraf-manual.js.map +0 -1
- data/node_modules/rimraf/dist/esm/rimraf-move-remove.d.ts +0 -4
- data/node_modules/rimraf/dist/esm/rimraf-move-remove.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/rimraf-move-remove.js +0 -187
- data/node_modules/rimraf/dist/esm/rimraf-move-remove.js.map +0 -1
- data/node_modules/rimraf/dist/esm/rimraf-native.d.ts +0 -4
- data/node_modules/rimraf/dist/esm/rimraf-native.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/rimraf-native.js +0 -19
- data/node_modules/rimraf/dist/esm/rimraf-native.js.map +0 -1
- data/node_modules/rimraf/dist/esm/rimraf-posix.d.ts +0 -4
- data/node_modules/rimraf/dist/esm/rimraf-posix.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/rimraf-posix.js +0 -118
- data/node_modules/rimraf/dist/esm/rimraf-posix.js.map +0 -1
- data/node_modules/rimraf/dist/esm/rimraf-windows.d.ts +0 -4
- data/node_modules/rimraf/dist/esm/rimraf-windows.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/rimraf-windows.js +0 -177
- data/node_modules/rimraf/dist/esm/rimraf-windows.js.map +0 -1
- data/node_modules/rimraf/dist/esm/use-native.d.ts +0 -4
- data/node_modules/rimraf/dist/esm/use-native.d.ts.map +0 -1
- data/node_modules/rimraf/dist/esm/use-native.js +0 -16
- data/node_modules/rimraf/dist/esm/use-native.js.map +0 -1
- data/node_modules/semver/classes/comparator.js +0 -141
- data/node_modules/semver/classes/index.js +0 -5
- data/node_modules/semver/classes/range.js +0 -539
- data/node_modules/semver/classes/semver.js +0 -302
- data/node_modules/semver/functions/clean.js +0 -6
- data/node_modules/semver/functions/cmp.js +0 -52
- data/node_modules/semver/functions/coerce.js +0 -52
- data/node_modules/semver/functions/compare-build.js +0 -7
- data/node_modules/semver/functions/compare-loose.js +0 -3
- data/node_modules/semver/functions/compare.js +0 -5
- data/node_modules/semver/functions/diff.js +0 -65
- data/node_modules/semver/functions/eq.js +0 -3
- data/node_modules/semver/functions/gt.js +0 -3
- data/node_modules/semver/functions/gte.js +0 -3
- data/node_modules/semver/functions/inc.js +0 -19
- data/node_modules/semver/functions/lt.js +0 -3
- data/node_modules/semver/functions/lte.js +0 -3
- data/node_modules/semver/functions/major.js +0 -3
- data/node_modules/semver/functions/minor.js +0 -3
- data/node_modules/semver/functions/neq.js +0 -3
- data/node_modules/semver/functions/parse.js +0 -16
- data/node_modules/semver/functions/patch.js +0 -3
- data/node_modules/semver/functions/prerelease.js +0 -6
- data/node_modules/semver/functions/rcompare.js +0 -3
- data/node_modules/semver/functions/rsort.js +0 -3
- data/node_modules/semver/functions/satisfies.js +0 -10
- data/node_modules/semver/functions/sort.js +0 -3
- data/node_modules/semver/functions/valid.js +0 -6
- data/node_modules/semver/index.js +0 -89
- data/node_modules/semver/internal/constants.js +0 -35
- data/node_modules/semver/internal/debug.js +0 -9
- data/node_modules/semver/internal/identifiers.js +0 -23
- data/node_modules/semver/internal/parse-options.js +0 -15
- data/node_modules/semver/internal/re.js +0 -212
- data/node_modules/semver/node_modules/lru-cache/LICENSE +0 -15
- data/node_modules/semver/node_modules/lru-cache/README.md +0 -166
- data/node_modules/semver/node_modules/lru-cache/index.js +0 -334
- data/node_modules/semver/node_modules/lru-cache/package.json +0 -34
- data/node_modules/semver/preload.js +0 -2
- data/node_modules/semver/ranges/gtr.js +0 -4
- data/node_modules/semver/ranges/intersects.js +0 -7
- data/node_modules/semver/ranges/ltr.js +0 -4
- data/node_modules/semver/ranges/max-satisfying.js +0 -25
- data/node_modules/semver/ranges/min-satisfying.js +0 -24
- data/node_modules/semver/ranges/min-version.js +0 -61
- data/node_modules/semver/ranges/outside.js +0 -80
- data/node_modules/semver/ranges/simplify.js +0 -47
- data/node_modules/semver/ranges/subset.js +0 -247
- data/node_modules/semver/ranges/to-comparators.js +0 -8
- data/node_modules/semver/ranges/valid.js +0 -11
- /data/node_modules/{eslint/node_modules/chalk → chalk}/index.d.ts +0 -0
- /data/node_modules/{eslint/node_modules/chalk → chalk}/source/templates.js +0 -0
- /data/node_modules/{eslint/node_modules/chalk → chalk}/source/util.js +0 -0
- /data/node_modules/{@eslint/config-array/node_modules/minimatch → minimatch}/minimatch.js +0 -0
@@ -1,1227 +1,334 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
'use strict'
|
2
|
+
|
3
|
+
// A linked list to keep track of recently-used-ness
|
4
|
+
const Yallist = require('yallist')
|
5
|
+
|
6
|
+
const MAX = Symbol('max')
|
7
|
+
const LENGTH = Symbol('length')
|
8
|
+
const LENGTH_CALCULATOR = Symbol('lengthCalculator')
|
9
|
+
const ALLOW_STALE = Symbol('allowStale')
|
10
|
+
const MAX_AGE = Symbol('maxAge')
|
11
|
+
const DISPOSE = Symbol('dispose')
|
12
|
+
const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet')
|
13
|
+
const LRU_LIST = Symbol('lruList')
|
14
|
+
const CACHE = Symbol('cache')
|
15
|
+
const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet')
|
16
|
+
|
17
|
+
const naiveLength = () => 1
|
18
|
+
|
19
|
+
// lruList is a yallist where the head is the youngest
|
20
|
+
// item, and the tail is the oldest. the list contains the Hit
|
21
|
+
// objects as the entries.
|
22
|
+
// Each Hit object has a reference to its Yallist.Node. This
|
23
|
+
// never changes.
|
24
|
+
//
|
25
|
+
// cache is a Map (or PseudoMap) that matches the keys to
|
26
|
+
// the Yallist.Node object.
|
27
|
+
class LRUCache {
|
28
|
+
constructor (options) {
|
29
|
+
if (typeof options === 'number')
|
30
|
+
options = { max: options }
|
7
31
|
|
8
|
-
|
32
|
+
if (!options)
|
33
|
+
options = {}
|
9
34
|
|
10
|
-
|
11
|
-
|
12
|
-
//
|
13
|
-
|
14
|
-
const AC = hasAbortController
|
15
|
-
? AbortController
|
16
|
-
: class AbortController {
|
17
|
-
constructor() {
|
18
|
-
this.signal = new AS()
|
19
|
-
}
|
20
|
-
abort(reason = new Error('This operation was aborted')) {
|
21
|
-
this.signal.reason = this.signal.reason || reason
|
22
|
-
this.signal.aborted = true
|
23
|
-
this.signal.dispatchEvent({
|
24
|
-
type: 'abort',
|
25
|
-
target: this.signal,
|
26
|
-
})
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
const hasAbortSignal = typeof AbortSignal === 'function'
|
31
|
-
// Some polyfills put this on the AC class, not global
|
32
|
-
const hasACAbortSignal = typeof AC.AbortSignal === 'function'
|
33
|
-
const AS = hasAbortSignal
|
34
|
-
? AbortSignal
|
35
|
-
: hasACAbortSignal
|
36
|
-
? AC.AbortController
|
37
|
-
: class AbortSignal {
|
38
|
-
constructor() {
|
39
|
-
this.reason = undefined
|
40
|
-
this.aborted = false
|
41
|
-
this._listeners = []
|
42
|
-
}
|
43
|
-
dispatchEvent(e) {
|
44
|
-
if (e.type === 'abort') {
|
45
|
-
this.aborted = true
|
46
|
-
this.onabort(e)
|
47
|
-
this._listeners.forEach(f => f(e), this)
|
48
|
-
}
|
49
|
-
}
|
50
|
-
onabort() {}
|
51
|
-
addEventListener(ev, fn) {
|
52
|
-
if (ev === 'abort') {
|
53
|
-
this._listeners.push(fn)
|
54
|
-
}
|
55
|
-
}
|
56
|
-
removeEventListener(ev, fn) {
|
57
|
-
if (ev === 'abort') {
|
58
|
-
this._listeners = this._listeners.filter(f => f !== fn)
|
59
|
-
}
|
60
|
-
}
|
61
|
-
}
|
35
|
+
if (options.max && (typeof options.max !== 'number' || options.max < 0))
|
36
|
+
throw new TypeError('max must be a non-negative number')
|
37
|
+
// Kind of weird to have a default max of Infinity, but oh well.
|
38
|
+
const max = this[MAX] = options.max || Infinity
|
62
39
|
|
63
|
-
const
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
const { prototype } = LRUCache
|
74
|
-
const { get } = Object.getOwnPropertyDescriptor(prototype, method)
|
75
|
-
warn(code, `${method} method`, `cache.${instead}()`, get)
|
76
|
-
}
|
77
|
-
}
|
78
|
-
const deprecatedProperty = (field, instead) => {
|
79
|
-
const code = `LRU_CACHE_PROPERTY_${field}`
|
80
|
-
if (shouldWarn(code)) {
|
81
|
-
const { prototype } = LRUCache
|
82
|
-
const { get } = Object.getOwnPropertyDescriptor(prototype, field)
|
83
|
-
warn(code, `${field} property`, `cache.${instead}`, get)
|
40
|
+
const lc = options.length || naiveLength
|
41
|
+
this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc
|
42
|
+
this[ALLOW_STALE] = options.stale || false
|
43
|
+
if (options.maxAge && typeof options.maxAge !== 'number')
|
44
|
+
throw new TypeError('maxAge must be a number')
|
45
|
+
this[MAX_AGE] = options.maxAge || 0
|
46
|
+
this[DISPOSE] = options.dispose
|
47
|
+
this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false
|
48
|
+
this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false
|
49
|
+
this.reset()
|
84
50
|
}
|
85
|
-
}
|
86
|
-
|
87
|
-
const emitWarning = (...a) => {
|
88
|
-
typeof process === 'object' &&
|
89
|
-
process &&
|
90
|
-
typeof process.emitWarning === 'function'
|
91
|
-
? process.emitWarning(...a)
|
92
|
-
: console.error(...a)
|
93
|
-
}
|
94
|
-
|
95
|
-
const shouldWarn = code => !warned.has(code)
|
96
51
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
}
|
102
|
-
|
103
|
-
const isPosInt = n => n && n === Math.floor(n) && n > 0 && isFinite(n)
|
52
|
+
// resize the cache when the max changes.
|
53
|
+
set max (mL) {
|
54
|
+
if (typeof mL !== 'number' || mL < 0)
|
55
|
+
throw new TypeError('max must be a non-negative number')
|
104
56
|
|
105
|
-
|
106
|
-
|
107
|
-
* And well before that point, you're caching the entire world, I mean,
|
108
|
-
* that's ~32GB of just integers for the next/prev links, plus whatever
|
109
|
-
* else to hold that many keys and values. Just filling the memory with
|
110
|
-
* zeroes at init time is brutal when you get that big.
|
111
|
-
* But why not be complete?
|
112
|
-
* Maybe in the future, these limits will have expanded. */
|
113
|
-
const getUintArray = max =>
|
114
|
-
!isPosInt(max)
|
115
|
-
? null
|
116
|
-
: max <= Math.pow(2, 8)
|
117
|
-
? Uint8Array
|
118
|
-
: max <= Math.pow(2, 16)
|
119
|
-
? Uint16Array
|
120
|
-
: max <= Math.pow(2, 32)
|
121
|
-
? Uint32Array
|
122
|
-
: max <= Number.MAX_SAFE_INTEGER
|
123
|
-
? ZeroArray
|
124
|
-
: null
|
125
|
-
|
126
|
-
class ZeroArray extends Array {
|
127
|
-
constructor(size) {
|
128
|
-
super(size)
|
129
|
-
this.fill(0)
|
57
|
+
this[MAX] = mL || Infinity
|
58
|
+
trim(this)
|
130
59
|
}
|
131
|
-
|
132
|
-
|
133
|
-
class Stack {
|
134
|
-
constructor(max) {
|
135
|
-
if (max === 0) {
|
136
|
-
return []
|
137
|
-
}
|
138
|
-
const UintArray = getUintArray(max)
|
139
|
-
this.heap = new UintArray(max)
|
140
|
-
this.length = 0
|
60
|
+
get max () {
|
61
|
+
return this[MAX]
|
141
62
|
}
|
142
|
-
|
143
|
-
|
63
|
+
|
64
|
+
set allowStale (allowStale) {
|
65
|
+
this[ALLOW_STALE] = !!allowStale
|
144
66
|
}
|
145
|
-
|
146
|
-
return this
|
67
|
+
get allowStale () {
|
68
|
+
return this[ALLOW_STALE]
|
147
69
|
}
|
148
|
-
}
|
149
|
-
|
150
|
-
class LRUCache {
|
151
|
-
constructor(options = {}) {
|
152
|
-
const {
|
153
|
-
max = 0,
|
154
|
-
ttl,
|
155
|
-
ttlResolution = 1,
|
156
|
-
ttlAutopurge,
|
157
|
-
updateAgeOnGet,
|
158
|
-
updateAgeOnHas,
|
159
|
-
allowStale,
|
160
|
-
dispose,
|
161
|
-
disposeAfter,
|
162
|
-
noDisposeOnSet,
|
163
|
-
noUpdateTTL,
|
164
|
-
maxSize = 0,
|
165
|
-
maxEntrySize = 0,
|
166
|
-
sizeCalculation,
|
167
|
-
fetchMethod,
|
168
|
-
fetchContext,
|
169
|
-
noDeleteOnFetchRejection,
|
170
|
-
noDeleteOnStaleGet,
|
171
|
-
allowStaleOnFetchRejection,
|
172
|
-
allowStaleOnFetchAbort,
|
173
|
-
ignoreFetchAbort,
|
174
|
-
} = options
|
175
|
-
|
176
|
-
// deprecated options, don't trigger a warning for getting them if
|
177
|
-
// the thing being passed in is another LRUCache we're copying.
|
178
|
-
const { length, maxAge, stale } =
|
179
|
-
options instanceof LRUCache ? {} : options
|
180
|
-
|
181
|
-
if (max !== 0 && !isPosInt(max)) {
|
182
|
-
throw new TypeError('max option must be a nonnegative integer')
|
183
|
-
}
|
184
|
-
|
185
|
-
const UintArray = max ? getUintArray(max) : Array
|
186
|
-
if (!UintArray) {
|
187
|
-
throw new Error('invalid max value: ' + max)
|
188
|
-
}
|
189
|
-
|
190
|
-
this.max = max
|
191
|
-
this.maxSize = maxSize
|
192
|
-
this.maxEntrySize = maxEntrySize || this.maxSize
|
193
|
-
this.sizeCalculation = sizeCalculation || length
|
194
|
-
if (this.sizeCalculation) {
|
195
|
-
if (!this.maxSize && !this.maxEntrySize) {
|
196
|
-
throw new TypeError(
|
197
|
-
'cannot set sizeCalculation without setting maxSize or maxEntrySize'
|
198
|
-
)
|
199
|
-
}
|
200
|
-
if (typeof this.sizeCalculation !== 'function') {
|
201
|
-
throw new TypeError('sizeCalculation set to non-function')
|
202
|
-
}
|
203
|
-
}
|
204
|
-
|
205
|
-
this.fetchMethod = fetchMethod || null
|
206
|
-
if (this.fetchMethod && typeof this.fetchMethod !== 'function') {
|
207
|
-
throw new TypeError(
|
208
|
-
'fetchMethod must be a function if specified'
|
209
|
-
)
|
210
|
-
}
|
211
70
|
|
212
|
-
|
213
|
-
if (
|
214
|
-
throw new TypeError(
|
215
|
-
'cannot set fetchContext without fetchMethod'
|
216
|
-
)
|
217
|
-
}
|
218
|
-
|
219
|
-
this.keyMap = new Map()
|
220
|
-
this.keyList = new Array(max).fill(null)
|
221
|
-
this.valList = new Array(max).fill(null)
|
222
|
-
this.next = new UintArray(max)
|
223
|
-
this.prev = new UintArray(max)
|
224
|
-
this.head = 0
|
225
|
-
this.tail = 0
|
226
|
-
this.free = new Stack(max)
|
227
|
-
this.initialFill = 1
|
228
|
-
this.size = 0
|
229
|
-
|
230
|
-
if (typeof dispose === 'function') {
|
231
|
-
this.dispose = dispose
|
232
|
-
}
|
233
|
-
if (typeof disposeAfter === 'function') {
|
234
|
-
this.disposeAfter = disposeAfter
|
235
|
-
this.disposed = []
|
236
|
-
} else {
|
237
|
-
this.disposeAfter = null
|
238
|
-
this.disposed = null
|
239
|
-
}
|
240
|
-
this.noDisposeOnSet = !!noDisposeOnSet
|
241
|
-
this.noUpdateTTL = !!noUpdateTTL
|
242
|
-
this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection
|
243
|
-
this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection
|
244
|
-
this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort
|
245
|
-
this.ignoreFetchAbort = !!ignoreFetchAbort
|
246
|
-
|
247
|
-
// NB: maxEntrySize is set to maxSize if it's set
|
248
|
-
if (this.maxEntrySize !== 0) {
|
249
|
-
if (this.maxSize !== 0) {
|
250
|
-
if (!isPosInt(this.maxSize)) {
|
251
|
-
throw new TypeError(
|
252
|
-
'maxSize must be a positive integer if specified'
|
253
|
-
)
|
254
|
-
}
|
255
|
-
}
|
256
|
-
if (!isPosInt(this.maxEntrySize)) {
|
257
|
-
throw new TypeError(
|
258
|
-
'maxEntrySize must be a positive integer if specified'
|
259
|
-
)
|
260
|
-
}
|
261
|
-
this.initializeSizeTracking()
|
262
|
-
}
|
263
|
-
|
264
|
-
this.allowStale = !!allowStale || !!stale
|
265
|
-
this.noDeleteOnStaleGet = !!noDeleteOnStaleGet
|
266
|
-
this.updateAgeOnGet = !!updateAgeOnGet
|
267
|
-
this.updateAgeOnHas = !!updateAgeOnHas
|
268
|
-
this.ttlResolution =
|
269
|
-
isPosInt(ttlResolution) || ttlResolution === 0
|
270
|
-
? ttlResolution
|
271
|
-
: 1
|
272
|
-
this.ttlAutopurge = !!ttlAutopurge
|
273
|
-
this.ttl = ttl || maxAge || 0
|
274
|
-
if (this.ttl) {
|
275
|
-
if (!isPosInt(this.ttl)) {
|
276
|
-
throw new TypeError(
|
277
|
-
'ttl must be a positive integer if specified'
|
278
|
-
)
|
279
|
-
}
|
280
|
-
this.initializeTTLTracking()
|
281
|
-
}
|
71
|
+
set maxAge (mA) {
|
72
|
+
if (typeof mA !== 'number')
|
73
|
+
throw new TypeError('maxAge must be a non-negative number')
|
282
74
|
|
283
|
-
|
284
|
-
|
285
|
-
throw new TypeError(
|
286
|
-
'At least one of max, maxSize, or ttl is required'
|
287
|
-
)
|
288
|
-
}
|
289
|
-
if (!this.ttlAutopurge && !this.max && !this.maxSize) {
|
290
|
-
const code = 'LRU_CACHE_UNBOUNDED'
|
291
|
-
if (shouldWarn(code)) {
|
292
|
-
warned.add(code)
|
293
|
-
const msg =
|
294
|
-
'TTL caching without ttlAutopurge, max, or maxSize can ' +
|
295
|
-
'result in unbounded memory consumption.'
|
296
|
-
emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)
|
297
|
-
}
|
298
|
-
}
|
299
|
-
|
300
|
-
if (stale) {
|
301
|
-
deprecatedOption('stale', 'allowStale')
|
302
|
-
}
|
303
|
-
if (maxAge) {
|
304
|
-
deprecatedOption('maxAge', 'ttl')
|
305
|
-
}
|
306
|
-
if (length) {
|
307
|
-
deprecatedOption('length', 'sizeCalculation')
|
308
|
-
}
|
75
|
+
this[MAX_AGE] = mA
|
76
|
+
trim(this)
|
309
77
|
}
|
310
|
-
|
311
|
-
|
312
|
-
return this.has(key, { updateAgeOnHas: false }) ? Infinity : 0
|
78
|
+
get maxAge () {
|
79
|
+
return this[MAX_AGE]
|
313
80
|
}
|
314
81
|
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
this.setItemTTL = (index, ttl, start = perf.now()) => {
|
320
|
-
this.starts[index] = ttl !== 0 ? start : 0
|
321
|
-
this.ttls[index] = ttl
|
322
|
-
if (ttl !== 0 && this.ttlAutopurge) {
|
323
|
-
const t = setTimeout(() => {
|
324
|
-
if (this.isStale(index)) {
|
325
|
-
this.delete(this.keyList[index])
|
326
|
-
}
|
327
|
-
}, ttl + 1)
|
328
|
-
/* istanbul ignore else - unref() not supported on all platforms */
|
329
|
-
if (t.unref) {
|
330
|
-
t.unref()
|
331
|
-
}
|
332
|
-
}
|
333
|
-
}
|
334
|
-
|
335
|
-
this.updateItemAge = index => {
|
336
|
-
this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0
|
337
|
-
}
|
338
|
-
|
339
|
-
this.statusTTL = (status, index) => {
|
340
|
-
if (status) {
|
341
|
-
status.ttl = this.ttls[index]
|
342
|
-
status.start = this.starts[index]
|
343
|
-
status.now = cachedNow || getNow()
|
344
|
-
status.remainingTTL = status.now + status.ttl - status.start
|
345
|
-
}
|
346
|
-
}
|
347
|
-
|
348
|
-
// debounce calls to perf.now() to 1s so we're not hitting
|
349
|
-
// that costly call repeatedly.
|
350
|
-
let cachedNow = 0
|
351
|
-
const getNow = () => {
|
352
|
-
const n = perf.now()
|
353
|
-
if (this.ttlResolution > 0) {
|
354
|
-
cachedNow = n
|
355
|
-
const t = setTimeout(
|
356
|
-
() => (cachedNow = 0),
|
357
|
-
this.ttlResolution
|
358
|
-
)
|
359
|
-
/* istanbul ignore else - not available on all platforms */
|
360
|
-
if (t.unref) {
|
361
|
-
t.unref()
|
362
|
-
}
|
363
|
-
}
|
364
|
-
return n
|
365
|
-
}
|
366
|
-
|
367
|
-
this.getRemainingTTL = key => {
|
368
|
-
const index = this.keyMap.get(key)
|
369
|
-
if (index === undefined) {
|
370
|
-
return 0
|
371
|
-
}
|
372
|
-
return this.ttls[index] === 0 || this.starts[index] === 0
|
373
|
-
? Infinity
|
374
|
-
: this.starts[index] +
|
375
|
-
this.ttls[index] -
|
376
|
-
(cachedNow || getNow())
|
377
|
-
}
|
82
|
+
// resize the cache when the lengthCalculator changes.
|
83
|
+
set lengthCalculator (lC) {
|
84
|
+
if (typeof lC !== 'function')
|
85
|
+
lC = naiveLength
|
378
86
|
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
)
|
87
|
+
if (lC !== this[LENGTH_CALCULATOR]) {
|
88
|
+
this[LENGTH_CALCULATOR] = lC
|
89
|
+
this[LENGTH] = 0
|
90
|
+
this[LRU_LIST].forEach(hit => {
|
91
|
+
hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key)
|
92
|
+
this[LENGTH] += hit.length
|
93
|
+
})
|
386
94
|
}
|
95
|
+
trim(this)
|
387
96
|
}
|
388
|
-
|
389
|
-
statusTTL(_status, _index) {}
|
390
|
-
setItemTTL(_index, _ttl, _start) {}
|
391
|
-
isStale(_index) {
|
392
|
-
return false
|
393
|
-
}
|
97
|
+
get lengthCalculator () { return this[LENGTH_CALCULATOR] }
|
394
98
|
|
395
|
-
|
396
|
-
|
397
|
-
this.sizes = new ZeroArray(this.max)
|
398
|
-
this.removeItemSize = index => {
|
399
|
-
this.calculatedSize -= this.sizes[index]
|
400
|
-
this.sizes[index] = 0
|
401
|
-
}
|
402
|
-
this.requireSize = (k, v, size, sizeCalculation) => {
|
403
|
-
// provisionally accept background fetches.
|
404
|
-
// actual value size will be checked when they return.
|
405
|
-
if (this.isBackgroundFetch(v)) {
|
406
|
-
return 0
|
407
|
-
}
|
408
|
-
if (!isPosInt(size)) {
|
409
|
-
if (sizeCalculation) {
|
410
|
-
if (typeof sizeCalculation !== 'function') {
|
411
|
-
throw new TypeError('sizeCalculation must be a function')
|
412
|
-
}
|
413
|
-
size = sizeCalculation(v, k)
|
414
|
-
if (!isPosInt(size)) {
|
415
|
-
throw new TypeError(
|
416
|
-
'sizeCalculation return invalid (expect positive integer)'
|
417
|
-
)
|
418
|
-
}
|
419
|
-
} else {
|
420
|
-
throw new TypeError(
|
421
|
-
'invalid size value (must be positive integer). ' +
|
422
|
-
'When maxSize or maxEntrySize is used, sizeCalculation or size ' +
|
423
|
-
'must be set.'
|
424
|
-
)
|
425
|
-
}
|
426
|
-
}
|
427
|
-
return size
|
428
|
-
}
|
429
|
-
this.addItemSize = (index, size, status) => {
|
430
|
-
this.sizes[index] = size
|
431
|
-
if (this.maxSize) {
|
432
|
-
const maxSize = this.maxSize - this.sizes[index]
|
433
|
-
while (this.calculatedSize > maxSize) {
|
434
|
-
this.evict(true)
|
435
|
-
}
|
436
|
-
}
|
437
|
-
this.calculatedSize += this.sizes[index]
|
438
|
-
if (status) {
|
439
|
-
status.entrySize = size
|
440
|
-
status.totalCalculatedSize = this.calculatedSize
|
441
|
-
}
|
442
|
-
}
|
443
|
-
}
|
444
|
-
removeItemSize(_index) {}
|
445
|
-
addItemSize(_index, _size) {}
|
446
|
-
requireSize(_k, _v, size, sizeCalculation) {
|
447
|
-
if (size || sizeCalculation) {
|
448
|
-
throw new TypeError(
|
449
|
-
'cannot set size without setting maxSize or maxEntrySize on cache'
|
450
|
-
)
|
451
|
-
}
|
452
|
-
}
|
99
|
+
get length () { return this[LENGTH] }
|
100
|
+
get itemCount () { return this[LRU_LIST].length }
|
453
101
|
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
if (allowStale || !this.isStale(i)) {
|
461
|
-
yield i
|
462
|
-
}
|
463
|
-
if (i === this.head) {
|
464
|
-
break
|
465
|
-
} else {
|
466
|
-
i = this.prev[i]
|
467
|
-
}
|
468
|
-
}
|
102
|
+
rforEach (fn, thisp) {
|
103
|
+
thisp = thisp || this
|
104
|
+
for (let walker = this[LRU_LIST].tail; walker !== null;) {
|
105
|
+
const prev = walker.prev
|
106
|
+
forEachStep(this, fn, walker, thisp)
|
107
|
+
walker = prev
|
469
108
|
}
|
470
109
|
}
|
471
110
|
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
if (allowStale || !this.isStale(i)) {
|
479
|
-
yield i
|
480
|
-
}
|
481
|
-
if (i === this.tail) {
|
482
|
-
break
|
483
|
-
} else {
|
484
|
-
i = this.next[i]
|
485
|
-
}
|
486
|
-
}
|
111
|
+
forEach (fn, thisp) {
|
112
|
+
thisp = thisp || this
|
113
|
+
for (let walker = this[LRU_LIST].head; walker !== null;) {
|
114
|
+
const next = walker.next
|
115
|
+
forEachStep(this, fn, walker, thisp)
|
116
|
+
walker = next
|
487
117
|
}
|
488
118
|
}
|
489
119
|
|
490
|
-
|
491
|
-
return (
|
492
|
-
index !== undefined &&
|
493
|
-
this.keyMap.get(this.keyList[index]) === index
|
494
|
-
)
|
120
|
+
keys () {
|
121
|
+
return this[LRU_LIST].toArray().map(k => k.key)
|
495
122
|
}
|
496
123
|
|
497
|
-
|
498
|
-
|
499
|
-
if (
|
500
|
-
this.valList[i] !== undefined &&
|
501
|
-
this.keyList[i] !== undefined &&
|
502
|
-
!this.isBackgroundFetch(this.valList[i])
|
503
|
-
) {
|
504
|
-
yield [this.keyList[i], this.valList[i]]
|
505
|
-
}
|
506
|
-
}
|
507
|
-
}
|
508
|
-
*rentries() {
|
509
|
-
for (const i of this.rindexes()) {
|
510
|
-
if (
|
511
|
-
this.valList[i] !== undefined &&
|
512
|
-
this.keyList[i] !== undefined &&
|
513
|
-
!this.isBackgroundFetch(this.valList[i])
|
514
|
-
) {
|
515
|
-
yield [this.keyList[i], this.valList[i]]
|
516
|
-
}
|
517
|
-
}
|
124
|
+
values () {
|
125
|
+
return this[LRU_LIST].toArray().map(k => k.value)
|
518
126
|
}
|
519
127
|
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
this
|
524
|
-
|
525
|
-
) {
|
526
|
-
yield this.keyList[i]
|
527
|
-
}
|
528
|
-
}
|
529
|
-
}
|
530
|
-
*rkeys() {
|
531
|
-
for (const i of this.rindexes()) {
|
532
|
-
if (
|
533
|
-
this.keyList[i] !== undefined &&
|
534
|
-
!this.isBackgroundFetch(this.valList[i])
|
535
|
-
) {
|
536
|
-
yield this.keyList[i]
|
537
|
-
}
|
128
|
+
reset () {
|
129
|
+
if (this[DISPOSE] &&
|
130
|
+
this[LRU_LIST] &&
|
131
|
+
this[LRU_LIST].length) {
|
132
|
+
this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value))
|
538
133
|
}
|
539
|
-
}
|
540
134
|
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
this.valList[i] !== undefined &&
|
545
|
-
!this.isBackgroundFetch(this.valList[i])
|
546
|
-
) {
|
547
|
-
yield this.valList[i]
|
548
|
-
}
|
549
|
-
}
|
550
|
-
}
|
551
|
-
*rvalues() {
|
552
|
-
for (const i of this.rindexes()) {
|
553
|
-
if (
|
554
|
-
this.valList[i] !== undefined &&
|
555
|
-
!this.isBackgroundFetch(this.valList[i])
|
556
|
-
) {
|
557
|
-
yield this.valList[i]
|
558
|
-
}
|
559
|
-
}
|
135
|
+
this[CACHE] = new Map() // hash of items by key
|
136
|
+
this[LRU_LIST] = new Yallist() // list of items in order of use recency
|
137
|
+
this[LENGTH] = 0 // length of items in the list
|
560
138
|
}
|
561
139
|
|
562
|
-
|
563
|
-
return this.
|
140
|
+
dump () {
|
141
|
+
return this[LRU_LIST].map(hit =>
|
142
|
+
isStale(this, hit) ? false : {
|
143
|
+
k: hit.key,
|
144
|
+
v: hit.value,
|
145
|
+
e: hit.now + (hit.maxAge || 0)
|
146
|
+
}).toArray().filter(h => h)
|
564
147
|
}
|
565
148
|
|
566
|
-
|
567
|
-
|
568
|
-
const v = this.valList[i]
|
569
|
-
const value = this.isBackgroundFetch(v)
|
570
|
-
? v.__staleWhileFetching
|
571
|
-
: v
|
572
|
-
if (value === undefined) continue
|
573
|
-
if (fn(value, this.keyList[i], this)) {
|
574
|
-
return this.get(this.keyList[i], getOptions)
|
575
|
-
}
|
576
|
-
}
|
149
|
+
dumpLru () {
|
150
|
+
return this[LRU_LIST]
|
577
151
|
}
|
578
152
|
|
579
|
-
|
580
|
-
|
581
|
-
const v = this.valList[i]
|
582
|
-
const value = this.isBackgroundFetch(v)
|
583
|
-
? v.__staleWhileFetching
|
584
|
-
: v
|
585
|
-
if (value === undefined) continue
|
586
|
-
fn.call(thisp, value, this.keyList[i], this)
|
587
|
-
}
|
588
|
-
}
|
153
|
+
set (key, value, maxAge) {
|
154
|
+
maxAge = maxAge || this[MAX_AGE]
|
589
155
|
|
590
|
-
|
591
|
-
|
592
|
-
const v = this.valList[i]
|
593
|
-
const value = this.isBackgroundFetch(v)
|
594
|
-
? v.__staleWhileFetching
|
595
|
-
: v
|
596
|
-
if (value === undefined) continue
|
597
|
-
fn.call(thisp, value, this.keyList[i], this)
|
598
|
-
}
|
599
|
-
}
|
156
|
+
if (maxAge && typeof maxAge !== 'number')
|
157
|
+
throw new TypeError('maxAge must be a number')
|
600
158
|
|
601
|
-
|
602
|
-
|
603
|
-
return this.purgeStale
|
604
|
-
}
|
159
|
+
const now = maxAge ? Date.now() : 0
|
160
|
+
const len = this[LENGTH_CALCULATOR](value, key)
|
605
161
|
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
this.delete(this.keyList[i])
|
611
|
-
deleted = true
|
162
|
+
if (this[CACHE].has(key)) {
|
163
|
+
if (len > this[MAX]) {
|
164
|
+
del(this, this[CACHE].get(key))
|
165
|
+
return false
|
612
166
|
}
|
613
|
-
}
|
614
|
-
return deleted
|
615
|
-
}
|
616
167
|
|
617
|
-
|
618
|
-
|
619
|
-
for (const i of this.indexes({ allowStale: true })) {
|
620
|
-
const key = this.keyList[i]
|
621
|
-
const v = this.valList[i]
|
622
|
-
const value = this.isBackgroundFetch(v)
|
623
|
-
? v.__staleWhileFetching
|
624
|
-
: v
|
625
|
-
if (value === undefined) continue
|
626
|
-
const entry = { value }
|
627
|
-
if (this.ttls) {
|
628
|
-
entry.ttl = this.ttls[i]
|
629
|
-
// always dump the start relative to a portable timestamp
|
630
|
-
// it's ok for this to be a bit slow, it's a rare operation.
|
631
|
-
const age = perf.now() - this.starts[i]
|
632
|
-
entry.start = Math.floor(Date.now() - age)
|
633
|
-
}
|
634
|
-
if (this.sizes) {
|
635
|
-
entry.size = this.sizes[i]
|
636
|
-
}
|
637
|
-
arr.unshift([key, entry])
|
638
|
-
}
|
639
|
-
return arr
|
640
|
-
}
|
168
|
+
const node = this[CACHE].get(key)
|
169
|
+
const item = node.value
|
641
170
|
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
// node's performance.now(), so calculate the offset.
|
648
|
-
// it's ok for this to be a bit slow, it's a rare operation.
|
649
|
-
const age = Date.now() - entry.start
|
650
|
-
entry.start = perf.now() - age
|
171
|
+
// dispose of the old one before overwriting
|
172
|
+
// split out into 2 ifs for better coverage tracking
|
173
|
+
if (this[DISPOSE]) {
|
174
|
+
if (!this[NO_DISPOSE_ON_SET])
|
175
|
+
this[DISPOSE](key, item.value)
|
651
176
|
}
|
652
|
-
this.set(key, entry.value, entry)
|
653
|
-
}
|
654
|
-
}
|
655
|
-
|
656
|
-
dispose(_v, _k, _reason) {}
|
657
177
|
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
sizeCalculation = this.sizeCalculation,
|
667
|
-
noUpdateTTL = this.noUpdateTTL,
|
668
|
-
status,
|
669
|
-
} = {}
|
670
|
-
) {
|
671
|
-
size = this.requireSize(k, v, size, sizeCalculation)
|
672
|
-
// if the item doesn't fit, don't do anything
|
673
|
-
// NB: maxEntrySize set to maxSize by default
|
674
|
-
if (this.maxEntrySize && size > this.maxEntrySize) {
|
675
|
-
if (status) {
|
676
|
-
status.set = 'miss'
|
677
|
-
status.maxEntrySizeExceeded = true
|
678
|
-
}
|
679
|
-
// have to delete, in case a background fetch is there already.
|
680
|
-
// in non-async cases, this is a no-op
|
681
|
-
this.delete(k)
|
682
|
-
return this
|
683
|
-
}
|
684
|
-
let index = this.size === 0 ? undefined : this.keyMap.get(k)
|
685
|
-
if (index === undefined) {
|
686
|
-
// addition
|
687
|
-
index = this.newIndex()
|
688
|
-
this.keyList[index] = k
|
689
|
-
this.valList[index] = v
|
690
|
-
this.keyMap.set(k, index)
|
691
|
-
this.next[this.tail] = index
|
692
|
-
this.prev[index] = this.tail
|
693
|
-
this.tail = index
|
694
|
-
this.size++
|
695
|
-
this.addItemSize(index, size, status)
|
696
|
-
if (status) {
|
697
|
-
status.set = 'add'
|
698
|
-
}
|
699
|
-
noUpdateTTL = false
|
700
|
-
} else {
|
701
|
-
// update
|
702
|
-
this.moveToTail(index)
|
703
|
-
const oldVal = this.valList[index]
|
704
|
-
if (v !== oldVal) {
|
705
|
-
if (this.isBackgroundFetch(oldVal)) {
|
706
|
-
oldVal.__abortController.abort(new Error('replaced'))
|
707
|
-
} else {
|
708
|
-
if (!noDisposeOnSet) {
|
709
|
-
this.dispose(oldVal, k, 'set')
|
710
|
-
if (this.disposeAfter) {
|
711
|
-
this.disposed.push([oldVal, k, 'set'])
|
712
|
-
}
|
713
|
-
}
|
714
|
-
}
|
715
|
-
this.removeItemSize(index)
|
716
|
-
this.valList[index] = v
|
717
|
-
this.addItemSize(index, size, status)
|
718
|
-
if (status) {
|
719
|
-
status.set = 'replace'
|
720
|
-
const oldValue =
|
721
|
-
oldVal && this.isBackgroundFetch(oldVal)
|
722
|
-
? oldVal.__staleWhileFetching
|
723
|
-
: oldVal
|
724
|
-
if (oldValue !== undefined) status.oldValue = oldValue
|
725
|
-
}
|
726
|
-
} else if (status) {
|
727
|
-
status.set = 'update'
|
728
|
-
}
|
729
|
-
}
|
730
|
-
if (ttl !== 0 && this.ttl === 0 && !this.ttls) {
|
731
|
-
this.initializeTTLTracking()
|
732
|
-
}
|
733
|
-
if (!noUpdateTTL) {
|
734
|
-
this.setItemTTL(index, ttl, start)
|
178
|
+
item.now = now
|
179
|
+
item.maxAge = maxAge
|
180
|
+
item.value = value
|
181
|
+
this[LENGTH] += len - item.length
|
182
|
+
item.length = len
|
183
|
+
this.get(key)
|
184
|
+
trim(this)
|
185
|
+
return true
|
735
186
|
}
|
736
|
-
this.statusTTL(status, index)
|
737
|
-
if (this.disposeAfter) {
|
738
|
-
while (this.disposed.length) {
|
739
|
-
this.disposeAfter(...this.disposed.shift())
|
740
|
-
}
|
741
|
-
}
|
742
|
-
return this
|
743
|
-
}
|
744
187
|
|
745
|
-
|
746
|
-
if (this.size === 0) {
|
747
|
-
return this.tail
|
748
|
-
}
|
749
|
-
if (this.size === this.max && this.max !== 0) {
|
750
|
-
return this.evict(false)
|
751
|
-
}
|
752
|
-
if (this.free.length !== 0) {
|
753
|
-
return this.free.pop()
|
754
|
-
}
|
755
|
-
// initial fill, just keep writing down the list
|
756
|
-
return this.initialFill++
|
757
|
-
}
|
188
|
+
const hit = new Entry(key, value, len, now, maxAge)
|
758
189
|
|
759
|
-
|
760
|
-
if (this
|
761
|
-
|
762
|
-
|
763
|
-
return val
|
764
|
-
}
|
765
|
-
}
|
190
|
+
// oversized objects fall out of cache automatically.
|
191
|
+
if (hit.length > this[MAX]) {
|
192
|
+
if (this[DISPOSE])
|
193
|
+
this[DISPOSE](key, value)
|
766
194
|
|
767
|
-
|
768
|
-
const head = this.head
|
769
|
-
const k = this.keyList[head]
|
770
|
-
const v = this.valList[head]
|
771
|
-
if (this.isBackgroundFetch(v)) {
|
772
|
-
v.__abortController.abort(new Error('evicted'))
|
773
|
-
} else {
|
774
|
-
this.dispose(v, k, 'evict')
|
775
|
-
if (this.disposeAfter) {
|
776
|
-
this.disposed.push([v, k, 'evict'])
|
777
|
-
}
|
778
|
-
}
|
779
|
-
this.removeItemSize(head)
|
780
|
-
// if we aren't about to use the index, then null these out
|
781
|
-
if (free) {
|
782
|
-
this.keyList[head] = null
|
783
|
-
this.valList[head] = null
|
784
|
-
this.free.push(head)
|
195
|
+
return false
|
785
196
|
}
|
786
|
-
this.head = this.next[head]
|
787
|
-
this.keyMap.delete(k)
|
788
|
-
this.size--
|
789
|
-
return head
|
790
|
-
}
|
791
197
|
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
this.updateItemAge(index)
|
798
|
-
}
|
799
|
-
if (status) status.has = 'hit'
|
800
|
-
this.statusTTL(status, index)
|
801
|
-
return true
|
802
|
-
} else if (status) {
|
803
|
-
status.has = 'stale'
|
804
|
-
this.statusTTL(status, index)
|
805
|
-
}
|
806
|
-
} else if (status) {
|
807
|
-
status.has = 'miss'
|
808
|
-
}
|
809
|
-
return false
|
198
|
+
this[LENGTH] += hit.length
|
199
|
+
this[LRU_LIST].unshift(hit)
|
200
|
+
this[CACHE].set(key, this[LRU_LIST].head)
|
201
|
+
trim(this)
|
202
|
+
return true
|
810
203
|
}
|
811
204
|
|
812
|
-
|
813
|
-
|
814
|
-
const
|
815
|
-
|
816
|
-
const v = this.valList[index]
|
817
|
-
// either stale and allowed, or forcing a refresh of non-stale value
|
818
|
-
return this.isBackgroundFetch(v) ? v.__staleWhileFetching : v
|
819
|
-
}
|
205
|
+
has (key) {
|
206
|
+
if (!this[CACHE].has(key)) return false
|
207
|
+
const hit = this[CACHE].get(key).value
|
208
|
+
return !isStale(this, hit)
|
820
209
|
}
|
821
210
|
|
822
|
-
|
823
|
-
|
824
|
-
if (this.isBackgroundFetch(v)) {
|
825
|
-
return v
|
826
|
-
}
|
827
|
-
const ac = new AC()
|
828
|
-
if (options.signal) {
|
829
|
-
options.signal.addEventListener('abort', () =>
|
830
|
-
ac.abort(options.signal.reason)
|
831
|
-
)
|
832
|
-
}
|
833
|
-
const fetchOpts = {
|
834
|
-
signal: ac.signal,
|
835
|
-
options,
|
836
|
-
context,
|
837
|
-
}
|
838
|
-
const cb = (v, updateCache = false) => {
|
839
|
-
const { aborted } = ac.signal
|
840
|
-
const ignoreAbort = options.ignoreFetchAbort && v !== undefined
|
841
|
-
if (options.status) {
|
842
|
-
if (aborted && !updateCache) {
|
843
|
-
options.status.fetchAborted = true
|
844
|
-
options.status.fetchError = ac.signal.reason
|
845
|
-
if (ignoreAbort) options.status.fetchAbortIgnored = true
|
846
|
-
} else {
|
847
|
-
options.status.fetchResolved = true
|
848
|
-
}
|
849
|
-
}
|
850
|
-
if (aborted && !ignoreAbort && !updateCache) {
|
851
|
-
return fetchFail(ac.signal.reason)
|
852
|
-
}
|
853
|
-
// either we didn't abort, and are still here, or we did, and ignored
|
854
|
-
if (this.valList[index] === p) {
|
855
|
-
if (v === undefined) {
|
856
|
-
if (p.__staleWhileFetching) {
|
857
|
-
this.valList[index] = p.__staleWhileFetching
|
858
|
-
} else {
|
859
|
-
this.delete(k)
|
860
|
-
}
|
861
|
-
} else {
|
862
|
-
if (options.status) options.status.fetchUpdated = true
|
863
|
-
this.set(k, v, fetchOpts.options)
|
864
|
-
}
|
865
|
-
}
|
866
|
-
return v
|
867
|
-
}
|
868
|
-
const eb = er => {
|
869
|
-
if (options.status) {
|
870
|
-
options.status.fetchRejected = true
|
871
|
-
options.status.fetchError = er
|
872
|
-
}
|
873
|
-
return fetchFail(er)
|
874
|
-
}
|
875
|
-
const fetchFail = er => {
|
876
|
-
const { aborted } = ac.signal
|
877
|
-
const allowStaleAborted =
|
878
|
-
aborted && options.allowStaleOnFetchAbort
|
879
|
-
const allowStale =
|
880
|
-
allowStaleAborted || options.allowStaleOnFetchRejection
|
881
|
-
const noDelete = allowStale || options.noDeleteOnFetchRejection
|
882
|
-
if (this.valList[index] === p) {
|
883
|
-
// if we allow stale on fetch rejections, then we need to ensure that
|
884
|
-
// the stale value is not removed from the cache when the fetch fails.
|
885
|
-
const del = !noDelete || p.__staleWhileFetching === undefined
|
886
|
-
if (del) {
|
887
|
-
this.delete(k)
|
888
|
-
} else if (!allowStaleAborted) {
|
889
|
-
// still replace the *promise* with the stale value,
|
890
|
-
// since we are done with the promise at this point.
|
891
|
-
// leave it untouched if we're still waiting for an
|
892
|
-
// aborted background fetch that hasn't yet returned.
|
893
|
-
this.valList[index] = p.__staleWhileFetching
|
894
|
-
}
|
895
|
-
}
|
896
|
-
if (allowStale) {
|
897
|
-
if (options.status && p.__staleWhileFetching !== undefined) {
|
898
|
-
options.status.returnedStale = true
|
899
|
-
}
|
900
|
-
return p.__staleWhileFetching
|
901
|
-
} else if (p.__returned === p) {
|
902
|
-
throw er
|
903
|
-
}
|
904
|
-
}
|
905
|
-
const pcall = (res, rej) => {
|
906
|
-
this.fetchMethod(k, v, fetchOpts).then(v => res(v), rej)
|
907
|
-
// ignored, we go until we finish, regardless.
|
908
|
-
// defer check until we are actually aborting,
|
909
|
-
// so fetchMethod can override.
|
910
|
-
ac.signal.addEventListener('abort', () => {
|
911
|
-
if (
|
912
|
-
!options.ignoreFetchAbort ||
|
913
|
-
options.allowStaleOnFetchAbort
|
914
|
-
) {
|
915
|
-
res()
|
916
|
-
// when it eventually resolves, update the cache.
|
917
|
-
if (options.allowStaleOnFetchAbort) {
|
918
|
-
res = v => cb(v, true)
|
919
|
-
}
|
920
|
-
}
|
921
|
-
})
|
922
|
-
}
|
923
|
-
if (options.status) options.status.fetchDispatched = true
|
924
|
-
const p = new Promise(pcall).then(cb, eb)
|
925
|
-
p.__abortController = ac
|
926
|
-
p.__staleWhileFetching = v
|
927
|
-
p.__returned = null
|
928
|
-
if (index === undefined) {
|
929
|
-
// internal, don't expose status.
|
930
|
-
this.set(k, p, { ...fetchOpts.options, status: undefined })
|
931
|
-
index = this.keyMap.get(k)
|
932
|
-
} else {
|
933
|
-
this.valList[index] = p
|
934
|
-
}
|
935
|
-
return p
|
211
|
+
get (key) {
|
212
|
+
return get(this, key, true)
|
936
213
|
}
|
937
214
|
|
938
|
-
|
939
|
-
return (
|
940
|
-
p &&
|
941
|
-
typeof p === 'object' &&
|
942
|
-
typeof p.then === 'function' &&
|
943
|
-
Object.prototype.hasOwnProperty.call(
|
944
|
-
p,
|
945
|
-
'__staleWhileFetching'
|
946
|
-
) &&
|
947
|
-
Object.prototype.hasOwnProperty.call(p, '__returned') &&
|
948
|
-
(p.__returned === p || p.__returned === null)
|
949
|
-
)
|
215
|
+
peek (key) {
|
216
|
+
return get(this, key, false)
|
950
217
|
}
|
951
218
|
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
// get options
|
957
|
-
allowStale = this.allowStale,
|
958
|
-
updateAgeOnGet = this.updateAgeOnGet,
|
959
|
-
noDeleteOnStaleGet = this.noDeleteOnStaleGet,
|
960
|
-
// set options
|
961
|
-
ttl = this.ttl,
|
962
|
-
noDisposeOnSet = this.noDisposeOnSet,
|
963
|
-
size = 0,
|
964
|
-
sizeCalculation = this.sizeCalculation,
|
965
|
-
noUpdateTTL = this.noUpdateTTL,
|
966
|
-
// fetch exclusive options
|
967
|
-
noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,
|
968
|
-
allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,
|
969
|
-
ignoreFetchAbort = this.ignoreFetchAbort,
|
970
|
-
allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,
|
971
|
-
fetchContext = this.fetchContext,
|
972
|
-
forceRefresh = false,
|
973
|
-
status,
|
974
|
-
signal,
|
975
|
-
} = {}
|
976
|
-
) {
|
977
|
-
if (!this.fetchMethod) {
|
978
|
-
if (status) status.fetch = 'get'
|
979
|
-
return this.get(k, {
|
980
|
-
allowStale,
|
981
|
-
updateAgeOnGet,
|
982
|
-
noDeleteOnStaleGet,
|
983
|
-
status,
|
984
|
-
})
|
985
|
-
}
|
986
|
-
|
987
|
-
const options = {
|
988
|
-
allowStale,
|
989
|
-
updateAgeOnGet,
|
990
|
-
noDeleteOnStaleGet,
|
991
|
-
ttl,
|
992
|
-
noDisposeOnSet,
|
993
|
-
size,
|
994
|
-
sizeCalculation,
|
995
|
-
noUpdateTTL,
|
996
|
-
noDeleteOnFetchRejection,
|
997
|
-
allowStaleOnFetchRejection,
|
998
|
-
allowStaleOnFetchAbort,
|
999
|
-
ignoreFetchAbort,
|
1000
|
-
status,
|
1001
|
-
signal,
|
1002
|
-
}
|
1003
|
-
|
1004
|
-
let index = this.keyMap.get(k)
|
1005
|
-
if (index === undefined) {
|
1006
|
-
if (status) status.fetch = 'miss'
|
1007
|
-
const p = this.backgroundFetch(k, index, options, fetchContext)
|
1008
|
-
return (p.__returned = p)
|
1009
|
-
} else {
|
1010
|
-
// in cache, maybe already fetching
|
1011
|
-
const v = this.valList[index]
|
1012
|
-
if (this.isBackgroundFetch(v)) {
|
1013
|
-
const stale =
|
1014
|
-
allowStale && v.__staleWhileFetching !== undefined
|
1015
|
-
if (status) {
|
1016
|
-
status.fetch = 'inflight'
|
1017
|
-
if (stale) status.returnedStale = true
|
1018
|
-
}
|
1019
|
-
return stale ? v.__staleWhileFetching : (v.__returned = v)
|
1020
|
-
}
|
1021
|
-
|
1022
|
-
// if we force a refresh, that means do NOT serve the cached value,
|
1023
|
-
// unless we are already in the process of refreshing the cache.
|
1024
|
-
const isStale = this.isStale(index)
|
1025
|
-
if (!forceRefresh && !isStale) {
|
1026
|
-
if (status) status.fetch = 'hit'
|
1027
|
-
this.moveToTail(index)
|
1028
|
-
if (updateAgeOnGet) {
|
1029
|
-
this.updateItemAge(index)
|
1030
|
-
}
|
1031
|
-
this.statusTTL(status, index)
|
1032
|
-
return v
|
1033
|
-
}
|
219
|
+
pop () {
|
220
|
+
const node = this[LRU_LIST].tail
|
221
|
+
if (!node)
|
222
|
+
return null
|
1034
223
|
|
1035
|
-
|
1036
|
-
|
1037
|
-
const p = this.backgroundFetch(k, index, options, fetchContext)
|
1038
|
-
const hasStale = p.__staleWhileFetching !== undefined
|
1039
|
-
const staleVal = hasStale && allowStale
|
1040
|
-
if (status) {
|
1041
|
-
status.fetch = hasStale && isStale ? 'stale' : 'refresh'
|
1042
|
-
if (staleVal && isStale) status.returnedStale = true
|
1043
|
-
}
|
1044
|
-
return staleVal ? p.__staleWhileFetching : (p.__returned = p)
|
1045
|
-
}
|
224
|
+
del(this, node)
|
225
|
+
return node.value
|
1046
226
|
}
|
1047
227
|
|
1048
|
-
|
1049
|
-
|
1050
|
-
{
|
1051
|
-
allowStale = this.allowStale,
|
1052
|
-
updateAgeOnGet = this.updateAgeOnGet,
|
1053
|
-
noDeleteOnStaleGet = this.noDeleteOnStaleGet,
|
1054
|
-
status,
|
1055
|
-
} = {}
|
1056
|
-
) {
|
1057
|
-
const index = this.keyMap.get(k)
|
1058
|
-
if (index !== undefined) {
|
1059
|
-
const value = this.valList[index]
|
1060
|
-
const fetching = this.isBackgroundFetch(value)
|
1061
|
-
this.statusTTL(status, index)
|
1062
|
-
if (this.isStale(index)) {
|
1063
|
-
if (status) status.get = 'stale'
|
1064
|
-
// delete only if not an in-flight background fetch
|
1065
|
-
if (!fetching) {
|
1066
|
-
if (!noDeleteOnStaleGet) {
|
1067
|
-
this.delete(k)
|
1068
|
-
}
|
1069
|
-
if (status) status.returnedStale = allowStale
|
1070
|
-
return allowStale ? value : undefined
|
1071
|
-
} else {
|
1072
|
-
if (status) {
|
1073
|
-
status.returnedStale =
|
1074
|
-
allowStale && value.__staleWhileFetching !== undefined
|
1075
|
-
}
|
1076
|
-
return allowStale ? value.__staleWhileFetching : undefined
|
1077
|
-
}
|
1078
|
-
} else {
|
1079
|
-
if (status) status.get = 'hit'
|
1080
|
-
// if we're currently fetching it, we don't actually have it yet
|
1081
|
-
// it's not stale, which means this isn't a staleWhileRefetching.
|
1082
|
-
// If it's not stale, and fetching, AND has a __staleWhileFetching
|
1083
|
-
// value, then that means the user fetched with {forceRefresh:true},
|
1084
|
-
// so it's safe to return that value.
|
1085
|
-
if (fetching) {
|
1086
|
-
return value.__staleWhileFetching
|
1087
|
-
}
|
1088
|
-
this.moveToTail(index)
|
1089
|
-
if (updateAgeOnGet) {
|
1090
|
-
this.updateItemAge(index)
|
1091
|
-
}
|
1092
|
-
return value
|
1093
|
-
}
|
1094
|
-
} else if (status) {
|
1095
|
-
status.get = 'miss'
|
1096
|
-
}
|
228
|
+
del (key) {
|
229
|
+
del(this, this[CACHE].get(key))
|
1097
230
|
}
|
1098
231
|
|
1099
|
-
|
1100
|
-
|
1101
|
-
this.
|
1102
|
-
}
|
232
|
+
load (arr) {
|
233
|
+
// reset the cache
|
234
|
+
this.reset()
|
1103
235
|
|
1104
|
-
|
1105
|
-
//
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
236
|
+
const now = Date.now()
|
237
|
+
// A previous serialized cache has the most recent items first
|
238
|
+
for (let l = arr.length - 1; l >= 0; l--) {
|
239
|
+
const hit = arr[l]
|
240
|
+
const expiresAt = hit.e || 0
|
241
|
+
if (expiresAt === 0)
|
242
|
+
// the item was created without expiration in a non aged cache
|
243
|
+
this.set(hit.k, hit.v)
|
244
|
+
else {
|
245
|
+
const maxAge = expiresAt - now
|
246
|
+
// dont add already expired items
|
247
|
+
if (maxAge > 0) {
|
248
|
+
this.set(hit.k, hit.v, maxAge)
|
249
|
+
}
|
1118
250
|
}
|
1119
|
-
this.connect(this.tail, index)
|
1120
|
-
this.tail = index
|
1121
251
|
}
|
1122
252
|
}
|
1123
253
|
|
1124
|
-
|
1125
|
-
|
1126
|
-
return this.delete
|
254
|
+
prune () {
|
255
|
+
this[CACHE].forEach((value, key) => get(this, key, false))
|
1127
256
|
}
|
257
|
+
}
|
1128
258
|
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
} else {
|
1143
|
-
this.dispose(v, k, 'delete')
|
1144
|
-
if (this.disposeAfter) {
|
1145
|
-
this.disposed.push([v, k, 'delete'])
|
1146
|
-
}
|
1147
|
-
}
|
1148
|
-
this.keyMap.delete(k)
|
1149
|
-
this.keyList[index] = null
|
1150
|
-
this.valList[index] = null
|
1151
|
-
if (index === this.tail) {
|
1152
|
-
this.tail = this.prev[index]
|
1153
|
-
} else if (index === this.head) {
|
1154
|
-
this.head = this.next[index]
|
1155
|
-
} else {
|
1156
|
-
this.next[this.prev[index]] = this.next[index]
|
1157
|
-
this.prev[this.next[index]] = this.prev[index]
|
1158
|
-
}
|
1159
|
-
this.size--
|
1160
|
-
this.free.push(index)
|
1161
|
-
}
|
1162
|
-
}
|
1163
|
-
}
|
1164
|
-
if (this.disposed) {
|
1165
|
-
while (this.disposed.length) {
|
1166
|
-
this.disposeAfter(...this.disposed.shift())
|
259
|
+
const get = (self, key, doUse) => {
|
260
|
+
const node = self[CACHE].get(key)
|
261
|
+
if (node) {
|
262
|
+
const hit = node.value
|
263
|
+
if (isStale(self, hit)) {
|
264
|
+
del(self, node)
|
265
|
+
if (!self[ALLOW_STALE])
|
266
|
+
return undefined
|
267
|
+
} else {
|
268
|
+
if (doUse) {
|
269
|
+
if (self[UPDATE_AGE_ON_GET])
|
270
|
+
node.value.now = Date.now()
|
271
|
+
self[LRU_LIST].unshiftNode(node)
|
1167
272
|
}
|
1168
273
|
}
|
1169
|
-
return
|
274
|
+
return hit.value
|
1170
275
|
}
|
276
|
+
}
|
1171
277
|
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
if (this.isBackgroundFetch(v)) {
|
1176
|
-
v.__abortController.abort(new Error('deleted'))
|
1177
|
-
} else {
|
1178
|
-
const k = this.keyList[index]
|
1179
|
-
this.dispose(v, k, 'delete')
|
1180
|
-
if (this.disposeAfter) {
|
1181
|
-
this.disposed.push([v, k, 'delete'])
|
1182
|
-
}
|
1183
|
-
}
|
1184
|
-
}
|
278
|
+
const isStale = (self, hit) => {
|
279
|
+
if (!hit || (!hit.maxAge && !self[MAX_AGE]))
|
280
|
+
return false
|
1185
281
|
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
this.size = 0
|
1202
|
-
if (this.disposed) {
|
1203
|
-
while (this.disposed.length) {
|
1204
|
-
this.disposeAfter(...this.disposed.shift())
|
1205
|
-
}
|
282
|
+
const diff = Date.now() - hit.now
|
283
|
+
return hit.maxAge ? diff > hit.maxAge
|
284
|
+
: self[MAX_AGE] && (diff > self[MAX_AGE])
|
285
|
+
}
|
286
|
+
|
287
|
+
const trim = self => {
|
288
|
+
if (self[LENGTH] > self[MAX]) {
|
289
|
+
for (let walker = self[LRU_LIST].tail;
|
290
|
+
self[LENGTH] > self[MAX] && walker !== null;) {
|
291
|
+
// We know that we're about to delete this one, and also
|
292
|
+
// what the next least recently used key will be, so just
|
293
|
+
// go ahead and set it now.
|
294
|
+
const prev = walker.prev
|
295
|
+
del(self, walker)
|
296
|
+
walker = prev
|
1206
297
|
}
|
1207
298
|
}
|
299
|
+
}
|
1208
300
|
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
301
|
+
const del = (self, node) => {
|
302
|
+
if (node) {
|
303
|
+
const hit = node.value
|
304
|
+
if (self[DISPOSE])
|
305
|
+
self[DISPOSE](hit.key, hit.value)
|
1213
306
|
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
307
|
+
self[LENGTH] -= hit.length
|
308
|
+
self[CACHE].delete(hit.key)
|
309
|
+
self[LRU_LIST].removeNode(node)
|
1217
310
|
}
|
311
|
+
}
|
1218
312
|
|
1219
|
-
|
1220
|
-
|
313
|
+
class Entry {
|
314
|
+
constructor (key, value, length, now, maxAge) {
|
315
|
+
this.key = key
|
316
|
+
this.value = value
|
317
|
+
this.length = length
|
318
|
+
this.now = now
|
319
|
+
this.maxAge = maxAge || 0
|
1221
320
|
}
|
1222
|
-
|
1223
|
-
|
321
|
+
}
|
322
|
+
|
323
|
+
const forEachStep = (self, fn, node, thisp) => {
|
324
|
+
let hit = node.value
|
325
|
+
if (isStale(self, hit)) {
|
326
|
+
del(self, node)
|
327
|
+
if (!self[ALLOW_STALE])
|
328
|
+
hit = undefined
|
1224
329
|
}
|
330
|
+
if (hit)
|
331
|
+
fn.call(thisp, hit.value, hit.key, self)
|
1225
332
|
}
|
1226
333
|
|
1227
334
|
module.exports = LRUCache
|