@bleedingdev/modern-js-utils 3.9.0-ultramodern.9 → 3.9.3-ultramodern.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cli/applyOptionsChain.js +1 -1
- package/dist/cjs/cli/get/config.js +1 -1
- package/dist/cjs/cli/is/config.js +1 -1
- package/dist/cjs/cli/require.js +3 -7
- package/dist/cjs/compiled.js +28 -34
- package/dist/cjs/fast-glob.js +50 -0
- package/dist/cjs/watch-options.js +18 -0
- package/dist/compiled/address/LICENSE.txt +22 -0
- package/dist/compiled/address/declaration-licenses/address/LICENSE.txt +22 -0
- package/dist/compiled/address/index.d.mts +50 -0
- package/dist/compiled/address/index.d.ts +50 -0
- package/dist/compiled/address/index.js +189 -136
- package/dist/compiled/address/index.mjs +187 -0
- package/dist/compiled/address/licenses-cjs.txt +24 -0
- package/dist/compiled/address/licenses-esm.txt +24 -0
- package/dist/compiled/address/package.json +1 -1
- package/dist/compiled/address/provenance.json +22 -0
- package/dist/compiled/browserslist/LICENSE +20 -0
- package/dist/compiled/browserslist/declaration-licenses/browserslist/LICENSE +20 -0
- package/dist/compiled/browserslist/index.d.ts +51 -5
- package/dist/compiled/browserslist/index.js +1763 -820
- package/dist/compiled/browserslist/licenses-cjs.txt +286 -0
- package/dist/compiled/browserslist/package.json +1 -1
- package/dist/compiled/browserslist/provenance.json +19 -0
- package/dist/compiled/chalk/declaration-licenses/chalk/license +9 -0
- package/dist/compiled/chalk/index.d.mts +677 -0
- package/dist/compiled/chalk/index.d.ts +619 -357
- package/dist/compiled/chalk/index.js +734 -2343
- package/dist/compiled/chalk/index.mjs +761 -0
- package/dist/compiled/chalk/license +1 -1
- package/dist/compiled/chalk/licenses-cjs.txt +11 -0
- package/dist/compiled/chalk/licenses-esm.txt +11 -0
- package/dist/compiled/chalk/package.json +1 -1
- package/dist/compiled/chalk/provenance.json +19 -0
- package/dist/compiled/chokidar/LICENSE +21 -0
- package/dist/compiled/chokidar/declaration-licenses/chokidar/LICENSE +21 -0
- package/dist/compiled/chokidar/declaration-licenses/readdirp/LICENSE +21 -0
- package/dist/compiled/chokidar/index.d.mts +385 -0
- package/dist/compiled/chokidar/index.d.ts +385 -0
- package/dist/compiled/chokidar/index.js +1437 -4099
- package/dist/compiled/chokidar/index.js.LICENSE.txt +1 -41
- package/dist/compiled/chokidar/index.mjs +1492 -0
- package/dist/compiled/chokidar/index.mjs.LICENSE.txt +1 -0
- package/dist/compiled/chokidar/licenses-cjs.txt +48 -0
- package/dist/compiled/chokidar/licenses-esm.txt +48 -0
- package/dist/compiled/chokidar/package.json +1 -1
- package/dist/compiled/chokidar/provenance.json +27 -0
- package/dist/compiled/commander/declaration-licenses/commander/LICENSE +22 -0
- package/dist/compiled/commander/index.d.mts +1116 -0
- package/dist/compiled/commander/index.d.ts +1116 -0
- package/dist/compiled/commander/index.js +1738 -1499
- package/dist/compiled/commander/index.mjs +1778 -2
- package/dist/compiled/commander/licenses-cjs.txt +24 -0
- package/dist/compiled/commander/licenses-esm.txt +24 -0
- package/dist/compiled/commander/package.json +1 -1
- package/dist/compiled/commander/provenance.json +22 -0
- package/dist/compiled/debug/declaration-licenses/@types_ms/LICENSE +21 -0
- package/dist/compiled/debug/index.d.ts +79 -16
- package/dist/compiled/debug/index.js +172 -106
- package/dist/compiled/debug/licenses-cjs.txt +60 -0
- package/dist/compiled/debug/package.json +1 -1
- package/dist/compiled/debug/provenance.json +27 -0
- package/dist/compiled/dotenv-expand/declaration-licenses/dotenv-expand/LICENSE +24 -0
- package/dist/compiled/dotenv-expand/index.d.ts +48 -10
- package/dist/compiled/dotenv-expand/index.js +65 -41
- package/dist/compiled/dotenv-expand/licenses-cjs.txt +25 -0
- package/dist/compiled/dotenv-expand/package.json +1 -1
- package/dist/compiled/dotenv-expand/provenance.json +22 -0
- package/dist/compiled/execa/declaration-licenses/execa/license +9 -0
- package/dist/compiled/execa/index.d.mts +2451 -0
- package/dist/compiled/execa/index.d.ts +2301 -414
- package/dist/compiled/execa/index.js +6485 -1681
- package/dist/compiled/execa/index.mjs +6541 -0
- package/dist/compiled/execa/licenses-cjs.txt +443 -0
- package/dist/compiled/execa/licenses-esm.txt +443 -0
- package/dist/compiled/execa/package.json +1 -1
- package/dist/compiled/execa/provenance.json +19 -0
- package/dist/compiled/filesize/LICENSE +28 -0
- package/dist/compiled/filesize/declaration-licenses/filesize/LICENSE +28 -0
- package/dist/compiled/filesize/index.d.mts +98 -0
- package/dist/compiled/filesize/index.d.ts +98 -0
- package/dist/compiled/filesize/index.js +425 -185
- package/dist/compiled/filesize/index.js.LICENSE.txt +2 -2
- package/dist/compiled/filesize/index.mjs +450 -0
- package/dist/compiled/filesize/index.mjs.LICENSE.txt +7 -0
- package/dist/compiled/filesize/licenses-cjs.txt +29 -0
- package/dist/compiled/filesize/licenses-esm.txt +29 -0
- package/dist/compiled/filesize/package.json +1 -1
- package/dist/compiled/filesize/provenance.json +22 -0
- package/dist/compiled/fs-extra/LICENSE +15 -0
- package/dist/compiled/fs-extra/declaration-licenses/@types_fs-extra/LICENSE +21 -0
- package/dist/compiled/fs-extra/declaration-licenses/@types_jsonfile/LICENSE +21 -0
- package/dist/compiled/fs-extra/index.d.ts +997 -496
- package/dist/compiled/fs-extra/index.js +1142 -1355
- package/dist/compiled/fs-extra/licenses-cjs.txt +79 -0
- package/dist/compiled/fs-extra/package.json +1 -1
- package/dist/compiled/fs-extra/provenance.json +27 -0
- package/dist/compiled/glob/LICENSE.md +63 -0
- package/dist/compiled/glob/declaration-licenses/glob/LICENSE.md +63 -0
- package/dist/compiled/glob/declaration-licenses/lru-cache/LICENSE.md +55 -0
- package/dist/compiled/glob/declaration-licenses/minimatch/LICENSE.md +55 -0
- package/dist/compiled/glob/declaration-licenses/minipass/LICENSE.md +55 -0
- package/dist/compiled/glob/declaration-licenses/path-scurry/LICENSE.md +55 -0
- package/dist/compiled/glob/index.d.mts +3823 -0
- package/dist/compiled/glob/index.d.ts +3823 -91
- package/dist/compiled/glob/index.js +3612 -1937
- package/dist/compiled/glob/index.mjs +3467 -0
- package/dist/compiled/glob/licenses-cjs.txt +65 -0
- package/dist/compiled/glob/licenses-esm.txt +65 -0
- package/dist/compiled/glob/package.json +1 -1
- package/dist/compiled/glob/provenance.json +42 -0
- package/dist/compiled/globby/declaration-licenses/globby/license +9 -0
- package/dist/compiled/globby/index.d.mts +422 -0
- package/dist/compiled/globby/index.d.ts +364 -128
- package/dist/compiled/globby/index.js +4417 -521
- package/dist/compiled/globby/index.js.LICENSE.txt +20 -0
- package/dist/compiled/globby/index.mjs +4572 -0
- package/dist/compiled/globby/index.mjs.LICENSE.txt +20 -0
- package/dist/compiled/globby/license +1 -1
- package/dist/compiled/globby/licenses-cjs.txt +237 -0
- package/dist/compiled/globby/licenses-esm.txt +237 -0
- package/dist/compiled/globby/package.json +1 -1
- package/dist/compiled/globby/provenance.json +19 -0
- package/dist/compiled/gzip-size/declaration-licenses/gzip-size/license +9 -0
- package/dist/compiled/gzip-size/index.d.mts +106 -0
- package/dist/compiled/gzip-size/index.d.ts +91 -81
- package/dist/compiled/gzip-size/index.js +117 -94
- package/dist/compiled/gzip-size/index.mjs +170 -0
- package/dist/compiled/gzip-size/licenses-cjs.txt +33 -0
- package/dist/compiled/gzip-size/licenses-esm.txt +33 -0
- package/dist/compiled/gzip-size/package.json +1 -1
- package/dist/compiled/gzip-size/provenance.json +19 -0
- package/dist/compiled/import-lazy/declaration-licenses/import-lazy/license +9 -0
- package/dist/compiled/import-lazy/index.d.ts +2 -2
- package/dist/compiled/import-lazy/index.js +18 -19
- package/dist/compiled/import-lazy/licenses-cjs.txt +11 -0
- package/dist/compiled/import-lazy/package.json +1 -1
- package/dist/compiled/import-lazy/provenance.json +19 -0
- package/dist/compiled/inquirer/LICENSE +22 -0
- package/dist/compiled/inquirer/declaration-licenses/@inquirer_checkbox/LICENSE +22 -0
- package/dist/compiled/inquirer/declaration-licenses/@inquirer_confirm/LICENSE +22 -0
- package/dist/compiled/inquirer/declaration-licenses/@inquirer_core/LICENSE +22 -0
- package/dist/compiled/inquirer/declaration-licenses/@inquirer_editor/LICENSE +22 -0
- package/dist/compiled/inquirer/declaration-licenses/@inquirer_expand/LICENSE +22 -0
- package/dist/compiled/inquirer/declaration-licenses/@inquirer_external-editor/LICENSE +22 -0
- package/dist/compiled/inquirer/declaration-licenses/@inquirer_input/LICENSE +22 -0
- package/dist/compiled/inquirer/declaration-licenses/@inquirer_number/LICENSE +22 -0
- package/dist/compiled/inquirer/declaration-licenses/@inquirer_password/LICENSE +22 -0
- package/dist/compiled/inquirer/declaration-licenses/@inquirer_prompts/LICENSE +22 -0
- package/dist/compiled/inquirer/declaration-licenses/@inquirer_rawlist/LICENSE +22 -0
- package/dist/compiled/inquirer/declaration-licenses/@inquirer_search/LICENSE +22 -0
- package/dist/compiled/inquirer/declaration-licenses/@inquirer_select/LICENSE +22 -0
- package/dist/compiled/inquirer/declaration-licenses/@inquirer_type/LICENSE +22 -0
- package/dist/compiled/inquirer/declaration-licenses/inquirer/LICENSE +22 -0
- package/dist/compiled/inquirer/index.d.mts +790 -0
- package/dist/compiled/inquirer/index.d.ts +727 -934
- package/dist/compiled/inquirer/index.js +5975 -14467
- package/dist/compiled/inquirer/index.mjs +11624 -0
- package/dist/compiled/inquirer/licenses-cjs.txt +619 -0
- package/dist/compiled/inquirer/licenses-esm.txt +619 -0
- package/dist/compiled/inquirer/package.json +1 -1
- package/dist/compiled/inquirer/provenance.json +92 -0
- package/dist/compiled/js-yaml/declaration-licenses/js-yaml/LICENSE +21 -0
- package/dist/compiled/js-yaml/index.d.mts +1126 -0
- package/dist/compiled/js-yaml/index.d.ts +1114 -142
- package/dist/compiled/js-yaml/index.js +20 -21
- package/dist/compiled/js-yaml/index.js.LICENSE.txt +1 -1
- package/dist/compiled/js-yaml/index.mjs +5 -4
- package/dist/compiled/js-yaml/index.mjs.LICENSE.txt +1 -1
- package/dist/compiled/js-yaml/licenses-cjs.txt +23 -0
- package/dist/compiled/js-yaml/licenses-esm.txt +23 -0
- package/dist/compiled/js-yaml/package.json +1 -1
- package/dist/compiled/js-yaml/provenance.json +19 -0
- package/dist/compiled/json5/LICENSE.md +23 -0
- package/dist/compiled/json5/declaration-licenses/json5/LICENSE.md +23 -0
- package/dist/compiled/json5/index.d.ts +103 -0
- package/dist/compiled/json5/index.js +11 -11
- package/dist/compiled/json5/licenses-cjs.txt +25 -0
- package/dist/compiled/json5/package.json +1 -1
- package/dist/compiled/json5/provenance.json +22 -0
- package/dist/compiled/lodash/add.d.ts +2 -0
- package/dist/compiled/lodash/after.d.ts +2 -0
- package/dist/compiled/lodash/ary.d.ts +2 -0
- package/dist/compiled/lodash/assign.d.ts +2 -0
- package/dist/compiled/lodash/assignIn.d.ts +2 -0
- package/dist/compiled/lodash/assignInWith.d.ts +2 -0
- package/dist/compiled/lodash/assignWith.d.ts +2 -0
- package/dist/compiled/lodash/at.d.ts +2 -0
- package/dist/compiled/lodash/attempt.d.ts +2 -0
- package/dist/compiled/lodash/before.d.ts +2 -0
- package/dist/compiled/lodash/bind.d.ts +2 -0
- package/dist/compiled/lodash/bindAll.d.ts +2 -0
- package/dist/compiled/lodash/bindKey.d.ts +2 -0
- package/dist/compiled/lodash/camelCase.d.ts +2 -0
- package/dist/compiled/lodash/capitalize.d.ts +2 -0
- package/dist/compiled/lodash/castArray.d.ts +2 -0
- package/dist/compiled/lodash/ceil.d.ts +2 -0
- package/dist/compiled/lodash/chain.d.ts +2 -0
- package/dist/compiled/lodash/chunk.d.ts +2 -0
- package/dist/compiled/lodash/clamp.d.ts +2 -0
- package/dist/compiled/lodash/clone.d.ts +2 -0
- package/dist/compiled/lodash/cloneDeep.d.ts +2 -0
- package/dist/compiled/lodash/cloneDeepWith.d.ts +2 -0
- package/dist/compiled/lodash/cloneWith.d.ts +2 -0
- package/dist/compiled/lodash/common/array.d.ts +56 -22
- package/dist/compiled/lodash/common/collection.d.ts +9 -1
- package/dist/compiled/lodash/common/common.d.ts +17 -10
- package/dist/compiled/lodash/common/function.d.ts +10 -1
- package/dist/compiled/lodash/common/lang.d.ts +8 -5
- package/dist/compiled/lodash/common/math.d.ts +3 -1
- package/dist/compiled/lodash/common/object.d.ts +141 -17
- package/dist/compiled/lodash/common/seq.d.ts +2 -2
- package/dist/compiled/lodash/common/string.d.ts +17 -17
- package/dist/compiled/lodash/compact.d.ts +2 -0
- package/dist/compiled/lodash/concat.d.ts +2 -0
- package/dist/compiled/lodash/cond.d.ts +2 -0
- package/dist/compiled/lodash/conforms.d.ts +2 -0
- package/dist/compiled/lodash/conformsTo.d.ts +2 -0
- package/dist/compiled/lodash/constant.d.ts +2 -0
- package/dist/compiled/lodash/countBy.d.ts +2 -0
- package/dist/compiled/lodash/create.d.ts +2 -0
- package/dist/compiled/lodash/curry.d.ts +2 -0
- package/dist/compiled/lodash/curryRight.d.ts +2 -0
- package/dist/compiled/lodash/debounce.d.ts +2 -0
- package/dist/compiled/lodash/deburr.d.ts +2 -0
- package/dist/compiled/lodash/declaration-licenses/@types_lodash/LICENSE +21 -0
- package/dist/compiled/lodash/defaultTo.d.ts +2 -0
- package/dist/compiled/lodash/defaults.d.ts +2 -0
- package/dist/compiled/lodash/defaultsDeep.d.ts +2 -0
- package/dist/compiled/lodash/defer.d.ts +2 -0
- package/dist/compiled/lodash/delay.d.ts +2 -0
- package/dist/compiled/lodash/difference.d.ts +2 -0
- package/dist/compiled/lodash/differenceBy.d.ts +2 -0
- package/dist/compiled/lodash/differenceWith.d.ts +2 -0
- package/dist/compiled/lodash/divide.d.ts +2 -0
- package/dist/compiled/lodash/drop.d.ts +2 -0
- package/dist/compiled/lodash/dropRight.d.ts +2 -0
- package/dist/compiled/lodash/dropRightWhile.d.ts +2 -0
- package/dist/compiled/lodash/dropWhile.d.ts +2 -0
- package/dist/compiled/lodash/each.d.ts +2 -0
- package/dist/compiled/lodash/eachRight.d.ts +2 -0
- package/dist/compiled/lodash/endsWith.d.ts +2 -0
- package/dist/compiled/lodash/entries.d.ts +2 -0
- package/dist/compiled/lodash/entriesIn.d.ts +2 -0
- package/dist/compiled/lodash/eq.d.ts +2 -0
- package/dist/compiled/lodash/escape.d.ts +2 -0
- package/dist/compiled/lodash/escapeRegExp.d.ts +2 -0
- package/dist/compiled/lodash/every.d.ts +2 -0
- package/dist/compiled/lodash/extend.d.ts +2 -0
- package/dist/compiled/lodash/extendWith.d.ts +2 -0
- package/dist/compiled/lodash/fill.d.ts +2 -0
- package/dist/compiled/lodash/filter.d.ts +2 -0
- package/dist/compiled/lodash/find.d.ts +2 -0
- package/dist/compiled/lodash/findIndex.d.ts +2 -0
- package/dist/compiled/lodash/findKey.d.ts +2 -0
- package/dist/compiled/lodash/findLast.d.ts +2 -0
- package/dist/compiled/lodash/findLastIndex.d.ts +2 -0
- package/dist/compiled/lodash/findLastKey.d.ts +2 -0
- package/dist/compiled/lodash/first.d.ts +2 -0
- package/dist/compiled/lodash/flatMap.d.ts +2 -0
- package/dist/compiled/lodash/flatMapDeep.d.ts +2 -0
- package/dist/compiled/lodash/flatMapDepth.d.ts +2 -0
- package/dist/compiled/lodash/flatten.d.ts +2 -0
- package/dist/compiled/lodash/flattenDeep.d.ts +2 -0
- package/dist/compiled/lodash/flattenDepth.d.ts +2 -0
- package/dist/compiled/lodash/flip.d.ts +2 -0
- package/dist/compiled/lodash/floor.d.ts +2 -0
- package/dist/compiled/lodash/flow.d.ts +2 -0
- package/dist/compiled/lodash/flowRight.d.ts +2 -0
- package/dist/compiled/lodash/forEach.d.ts +2 -0
- package/dist/compiled/lodash/forEachRight.d.ts +2 -0
- package/dist/compiled/lodash/forIn.d.ts +2 -0
- package/dist/compiled/lodash/forInRight.d.ts +2 -0
- package/dist/compiled/lodash/forOwn.d.ts +2 -0
- package/dist/compiled/lodash/forOwnRight.d.ts +2 -0
- package/dist/compiled/lodash/fp/F.d.ts +2 -0
- package/dist/compiled/lodash/fp/T.d.ts +2 -0
- package/dist/compiled/lodash/fp/__.d.ts +3 -0
- package/dist/compiled/lodash/fp/add.d.ts +2 -0
- package/dist/compiled/lodash/fp/after.d.ts +2 -0
- package/dist/compiled/lodash/fp/all.d.ts +2 -0
- package/dist/compiled/lodash/fp/allPass.d.ts +2 -0
- package/dist/compiled/lodash/fp/always.d.ts +2 -0
- package/dist/compiled/lodash/fp/any.d.ts +2 -0
- package/dist/compiled/lodash/fp/anyPass.d.ts +2 -0
- package/dist/compiled/lodash/fp/apply.d.ts +2 -0
- package/dist/compiled/lodash/fp/ary.d.ts +2 -0
- package/dist/compiled/lodash/fp/assign.d.ts +2 -0
- package/dist/compiled/lodash/fp/assignAll.d.ts +2 -0
- package/dist/compiled/lodash/fp/assignAllWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/assignIn.d.ts +2 -0
- package/dist/compiled/lodash/fp/assignInAll.d.ts +2 -0
- package/dist/compiled/lodash/fp/assignInAllWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/assignInWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/assignWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/assoc.d.ts +2 -0
- package/dist/compiled/lodash/fp/assocPath.d.ts +2 -0
- package/dist/compiled/lodash/fp/at.d.ts +2 -0
- package/dist/compiled/lodash/fp/attempt.d.ts +2 -0
- package/dist/compiled/lodash/fp/before.d.ts +2 -0
- package/dist/compiled/lodash/fp/bind.d.ts +2 -0
- package/dist/compiled/lodash/fp/bindAll.d.ts +2 -0
- package/dist/compiled/lodash/fp/bindKey.d.ts +2 -0
- package/dist/compiled/lodash/fp/camelCase.d.ts +2 -0
- package/dist/compiled/lodash/fp/capitalize.d.ts +2 -0
- package/dist/compiled/lodash/fp/castArray.d.ts +2 -0
- package/dist/compiled/lodash/fp/ceil.d.ts +2 -0
- package/dist/compiled/lodash/fp/chunk.d.ts +2 -0
- package/dist/compiled/lodash/fp/clamp.d.ts +2 -0
- package/dist/compiled/lodash/fp/clone.d.ts +2 -0
- package/dist/compiled/lodash/fp/cloneDeep.d.ts +2 -0
- package/dist/compiled/lodash/fp/cloneDeepWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/cloneWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/compact.d.ts +2 -0
- package/dist/compiled/lodash/fp/complement.d.ts +2 -0
- package/dist/compiled/lodash/fp/compose.d.ts +2 -0
- package/dist/compiled/lodash/fp/concat.d.ts +2 -0
- package/dist/compiled/lodash/fp/cond.d.ts +2 -0
- package/dist/compiled/lodash/fp/conforms.d.ts +2 -0
- package/dist/compiled/lodash/fp/conformsTo.d.ts +2 -0
- package/dist/compiled/lodash/fp/constant.d.ts +2 -0
- package/dist/compiled/lodash/fp/contains.d.ts +2 -0
- package/dist/compiled/lodash/fp/convert.d.ts +15 -0
- package/dist/compiled/lodash/fp/countBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/create.d.ts +2 -0
- package/dist/compiled/lodash/fp/curry.d.ts +2 -0
- package/dist/compiled/lodash/fp/curryN.d.ts +2 -0
- package/dist/compiled/lodash/fp/curryRight.d.ts +2 -0
- package/dist/compiled/lodash/fp/curryRightN.d.ts +2 -0
- package/dist/compiled/lodash/fp/debounce.d.ts +2 -0
- package/dist/compiled/lodash/fp/deburr.d.ts +2 -0
- package/dist/compiled/lodash/fp/defaultTo.d.ts +2 -0
- package/dist/compiled/lodash/fp/defaults.d.ts +2 -0
- package/dist/compiled/lodash/fp/defaultsAll.d.ts +2 -0
- package/dist/compiled/lodash/fp/defaultsDeep.d.ts +2 -0
- package/dist/compiled/lodash/fp/defaultsDeepAll.d.ts +2 -0
- package/dist/compiled/lodash/fp/defer.d.ts +2 -0
- package/dist/compiled/lodash/fp/delay.d.ts +2 -0
- package/dist/compiled/lodash/fp/difference.d.ts +2 -0
- package/dist/compiled/lodash/fp/differenceBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/differenceWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/dissoc.d.ts +2 -0
- package/dist/compiled/lodash/fp/dissocPath.d.ts +2 -0
- package/dist/compiled/lodash/fp/divide.d.ts +2 -0
- package/dist/compiled/lodash/fp/drop.d.ts +2 -0
- package/dist/compiled/lodash/fp/dropLast.d.ts +2 -0
- package/dist/compiled/lodash/fp/dropLastWhile.d.ts +2 -0
- package/dist/compiled/lodash/fp/dropRight.d.ts +2 -0
- package/dist/compiled/lodash/fp/dropRightWhile.d.ts +2 -0
- package/dist/compiled/lodash/fp/dropWhile.d.ts +2 -0
- package/dist/compiled/lodash/fp/each.d.ts +2 -0
- package/dist/compiled/lodash/fp/eachRight.d.ts +2 -0
- package/dist/compiled/lodash/fp/endsWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/entries.d.ts +2 -0
- package/dist/compiled/lodash/fp/entriesIn.d.ts +2 -0
- package/dist/compiled/lodash/fp/eq.d.ts +2 -0
- package/dist/compiled/lodash/fp/equals.d.ts +2 -0
- package/dist/compiled/lodash/fp/escape.d.ts +2 -0
- package/dist/compiled/lodash/fp/escapeRegExp.d.ts +2 -0
- package/dist/compiled/lodash/fp/every.d.ts +2 -0
- package/dist/compiled/lodash/fp/extend.d.ts +2 -0
- package/dist/compiled/lodash/fp/extendAll.d.ts +2 -0
- package/dist/compiled/lodash/fp/extendAllWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/extendWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/fill.d.ts +2 -0
- package/dist/compiled/lodash/fp/filter.d.ts +2 -0
- package/dist/compiled/lodash/fp/find.d.ts +2 -0
- package/dist/compiled/lodash/fp/findFrom.d.ts +2 -0
- package/dist/compiled/lodash/fp/findIndex.d.ts +2 -0
- package/dist/compiled/lodash/fp/findIndexFrom.d.ts +2 -0
- package/dist/compiled/lodash/fp/findKey.d.ts +2 -0
- package/dist/compiled/lodash/fp/findLast.d.ts +2 -0
- package/dist/compiled/lodash/fp/findLastFrom.d.ts +2 -0
- package/dist/compiled/lodash/fp/findLastIndex.d.ts +2 -0
- package/dist/compiled/lodash/fp/findLastIndexFrom.d.ts +2 -0
- package/dist/compiled/lodash/fp/findLastKey.d.ts +2 -0
- package/dist/compiled/lodash/fp/first.d.ts +2 -0
- package/dist/compiled/lodash/fp/flatMap.d.ts +2 -0
- package/dist/compiled/lodash/fp/flatMapDeep.d.ts +2 -0
- package/dist/compiled/lodash/fp/flatMapDepth.d.ts +2 -0
- package/dist/compiled/lodash/fp/flatten.d.ts +2 -0
- package/dist/compiled/lodash/fp/flattenDeep.d.ts +2 -0
- package/dist/compiled/lodash/fp/flattenDepth.d.ts +2 -0
- package/dist/compiled/lodash/fp/flip.d.ts +2 -0
- package/dist/compiled/lodash/fp/floor.d.ts +2 -0
- package/dist/compiled/lodash/fp/flow.d.ts +2 -0
- package/dist/compiled/lodash/fp/flowRight.d.ts +2 -0
- package/dist/compiled/lodash/fp/forEach.d.ts +2 -0
- package/dist/compiled/lodash/fp/forEachRight.d.ts +2 -0
- package/dist/compiled/lodash/fp/forIn.d.ts +2 -0
- package/dist/compiled/lodash/fp/forInRight.d.ts +2 -0
- package/dist/compiled/lodash/fp/forOwn.d.ts +2 -0
- package/dist/compiled/lodash/fp/forOwnRight.d.ts +2 -0
- package/dist/compiled/lodash/fp/fromPairs.d.ts +2 -0
- package/dist/compiled/lodash/fp/functions.d.ts +2 -0
- package/dist/compiled/lodash/fp/functionsIn.d.ts +2 -0
- package/dist/compiled/lodash/fp/get.d.ts +2 -0
- package/dist/compiled/lodash/fp/getOr.d.ts +2 -0
- package/dist/compiled/lodash/fp/groupBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/gt.d.ts +2 -0
- package/dist/compiled/lodash/fp/gte.d.ts +2 -0
- package/dist/compiled/lodash/fp/has.d.ts +2 -0
- package/dist/compiled/lodash/fp/hasIn.d.ts +2 -0
- package/dist/compiled/lodash/fp/head.d.ts +2 -0
- package/dist/compiled/lodash/fp/identical.d.ts +2 -0
- package/dist/compiled/lodash/fp/identity.d.ts +2 -0
- package/dist/compiled/lodash/fp/inRange.d.ts +2 -0
- package/dist/compiled/lodash/fp/includes.d.ts +2 -0
- package/dist/compiled/lodash/fp/includesFrom.d.ts +2 -0
- package/dist/compiled/lodash/fp/indexBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/indexOf.d.ts +2 -0
- package/dist/compiled/lodash/fp/indexOfFrom.d.ts +2 -0
- package/dist/compiled/lodash/fp/init.d.ts +2 -0
- package/dist/compiled/lodash/fp/initial.d.ts +2 -0
- package/dist/compiled/lodash/fp/intersection.d.ts +2 -0
- package/dist/compiled/lodash/fp/intersectionBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/intersectionWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/invert.d.ts +2 -0
- package/dist/compiled/lodash/fp/invertBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/invertObj.d.ts +2 -0
- package/dist/compiled/lodash/fp/invoke.d.ts +2 -0
- package/dist/compiled/lodash/fp/invokeArgs.d.ts +2 -0
- package/dist/compiled/lodash/fp/invokeArgsMap.d.ts +2 -0
- package/dist/compiled/lodash/fp/invokeMap.d.ts +2 -0
- package/dist/compiled/lodash/fp/isArguments.d.ts +2 -0
- package/dist/compiled/lodash/fp/isArray.d.ts +2 -0
- package/dist/compiled/lodash/fp/isArrayBuffer.d.ts +2 -0
- package/dist/compiled/lodash/fp/isArrayLike.d.ts +2 -0
- package/dist/compiled/lodash/fp/isArrayLikeObject.d.ts +2 -0
- package/dist/compiled/lodash/fp/isBoolean.d.ts +2 -0
- package/dist/compiled/lodash/fp/isBuffer.d.ts +2 -0
- package/dist/compiled/lodash/fp/isDate.d.ts +2 -0
- package/dist/compiled/lodash/fp/isElement.d.ts +2 -0
- package/dist/compiled/lodash/fp/isEmpty.d.ts +2 -0
- package/dist/compiled/lodash/fp/isEqual.d.ts +2 -0
- package/dist/compiled/lodash/fp/isEqualWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/isError.d.ts +2 -0
- package/dist/compiled/lodash/fp/isFinite.d.ts +2 -0
- package/dist/compiled/lodash/fp/isFunction.d.ts +2 -0
- package/dist/compiled/lodash/fp/isInteger.d.ts +2 -0
- package/dist/compiled/lodash/fp/isLength.d.ts +2 -0
- package/dist/compiled/lodash/fp/isMap.d.ts +2 -0
- package/dist/compiled/lodash/fp/isMatch.d.ts +2 -0
- package/dist/compiled/lodash/fp/isMatchWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/isNaN.d.ts +2 -0
- package/dist/compiled/lodash/fp/isNative.d.ts +2 -0
- package/dist/compiled/lodash/fp/isNil.d.ts +2 -0
- package/dist/compiled/lodash/fp/isNull.d.ts +2 -0
- package/dist/compiled/lodash/fp/isNumber.d.ts +2 -0
- package/dist/compiled/lodash/fp/isObject.d.ts +2 -0
- package/dist/compiled/lodash/fp/isObjectLike.d.ts +2 -0
- package/dist/compiled/lodash/fp/isPlainObject.d.ts +2 -0
- package/dist/compiled/lodash/fp/isRegExp.d.ts +2 -0
- package/dist/compiled/lodash/fp/isSafeInteger.d.ts +2 -0
- package/dist/compiled/lodash/fp/isSet.d.ts +2 -0
- package/dist/compiled/lodash/fp/isString.d.ts +2 -0
- package/dist/compiled/lodash/fp/isSymbol.d.ts +2 -0
- package/dist/compiled/lodash/fp/isTypedArray.d.ts +2 -0
- package/dist/compiled/lodash/fp/isUndefined.d.ts +2 -0
- package/dist/compiled/lodash/fp/isWeakMap.d.ts +2 -0
- package/dist/compiled/lodash/fp/isWeakSet.d.ts +2 -0
- package/dist/compiled/lodash/fp/iteratee.d.ts +2 -0
- package/dist/compiled/lodash/fp/join.d.ts +2 -0
- package/dist/compiled/lodash/fp/juxt.d.ts +2 -0
- package/dist/compiled/lodash/fp/kebabCase.d.ts +2 -0
- package/dist/compiled/lodash/fp/keyBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/keys.d.ts +2 -0
- package/dist/compiled/lodash/fp/keysIn.d.ts +2 -0
- package/dist/compiled/lodash/fp/last.d.ts +2 -0
- package/dist/compiled/lodash/fp/lastIndexOf.d.ts +2 -0
- package/dist/compiled/lodash/fp/lastIndexOfFrom.d.ts +2 -0
- package/dist/compiled/lodash/fp/lowerCase.d.ts +2 -0
- package/dist/compiled/lodash/fp/lowerFirst.d.ts +2 -0
- package/dist/compiled/lodash/fp/lt.d.ts +2 -0
- package/dist/compiled/lodash/fp/lte.d.ts +2 -0
- package/dist/compiled/lodash/fp/map.d.ts +2 -0
- package/dist/compiled/lodash/fp/mapKeys.d.ts +2 -0
- package/dist/compiled/lodash/fp/mapValues.d.ts +2 -0
- package/dist/compiled/lodash/fp/matches.d.ts +2 -0
- package/dist/compiled/lodash/fp/matchesProperty.d.ts +2 -0
- package/dist/compiled/lodash/fp/max.d.ts +2 -0
- package/dist/compiled/lodash/fp/maxBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/mean.d.ts +2 -0
- package/dist/compiled/lodash/fp/meanBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/memoize.d.ts +2 -0
- package/dist/compiled/lodash/fp/merge.d.ts +2 -0
- package/dist/compiled/lodash/fp/mergeAll.d.ts +2 -0
- package/dist/compiled/lodash/fp/mergeAllWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/mergeWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/method.d.ts +2 -0
- package/dist/compiled/lodash/fp/methodOf.d.ts +2 -0
- package/dist/compiled/lodash/fp/min.d.ts +2 -0
- package/dist/compiled/lodash/fp/minBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/multiply.d.ts +2 -0
- package/dist/compiled/lodash/fp/nAry.d.ts +2 -0
- package/dist/compiled/lodash/fp/negate.d.ts +2 -0
- package/dist/compiled/lodash/fp/noConflict.d.ts +2 -0
- package/dist/compiled/lodash/fp/noop.d.ts +2 -0
- package/dist/compiled/lodash/fp/now.d.ts +2 -0
- package/dist/compiled/lodash/fp/nth.d.ts +2 -0
- package/dist/compiled/lodash/fp/nthArg.d.ts +2 -0
- package/dist/compiled/lodash/fp/omit.d.ts +2 -0
- package/dist/compiled/lodash/fp/omitAll.d.ts +2 -0
- package/dist/compiled/lodash/fp/omitBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/once.d.ts +2 -0
- package/dist/compiled/lodash/fp/orderBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/over.d.ts +2 -0
- package/dist/compiled/lodash/fp/overArgs.d.ts +2 -0
- package/dist/compiled/lodash/fp/overEvery.d.ts +2 -0
- package/dist/compiled/lodash/fp/overSome.d.ts +2 -0
- package/dist/compiled/lodash/fp/pad.d.ts +2 -0
- package/dist/compiled/lodash/fp/padChars.d.ts +2 -0
- package/dist/compiled/lodash/fp/padCharsEnd.d.ts +2 -0
- package/dist/compiled/lodash/fp/padCharsStart.d.ts +2 -0
- package/dist/compiled/lodash/fp/padEnd.d.ts +2 -0
- package/dist/compiled/lodash/fp/padStart.d.ts +2 -0
- package/dist/compiled/lodash/fp/parseInt.d.ts +2 -0
- package/dist/compiled/lodash/fp/partial.d.ts +2 -0
- package/dist/compiled/lodash/fp/partialRight.d.ts +2 -0
- package/dist/compiled/lodash/fp/partition.d.ts +2 -0
- package/dist/compiled/lodash/fp/path.d.ts +2 -0
- package/dist/compiled/lodash/fp/pathEq.d.ts +2 -0
- package/dist/compiled/lodash/fp/pathOr.d.ts +2 -0
- package/dist/compiled/lodash/fp/paths.d.ts +2 -0
- package/dist/compiled/lodash/fp/pick.d.ts +2 -0
- package/dist/compiled/lodash/fp/pickAll.d.ts +2 -0
- package/dist/compiled/lodash/fp/pickBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/pipe.d.ts +2 -0
- package/dist/compiled/lodash/fp/placeholder.d.ts +3 -0
- package/dist/compiled/lodash/fp/pluck.d.ts +2 -0
- package/dist/compiled/lodash/fp/prop.d.ts +2 -0
- package/dist/compiled/lodash/fp/propEq.d.ts +2 -0
- package/dist/compiled/lodash/fp/propOr.d.ts +2 -0
- package/dist/compiled/lodash/fp/property.d.ts +2 -0
- package/dist/compiled/lodash/fp/propertyOf.d.ts +2 -0
- package/dist/compiled/lodash/fp/props.d.ts +2 -0
- package/dist/compiled/lodash/fp/pull.d.ts +2 -0
- package/dist/compiled/lodash/fp/pullAll.d.ts +2 -0
- package/dist/compiled/lodash/fp/pullAllBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/pullAllWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/pullAt.d.ts +2 -0
- package/dist/compiled/lodash/fp/random.d.ts +2 -0
- package/dist/compiled/lodash/fp/range.d.ts +2 -0
- package/dist/compiled/lodash/fp/rangeRight.d.ts +2 -0
- package/dist/compiled/lodash/fp/rangeStep.d.ts +2 -0
- package/dist/compiled/lodash/fp/rangeStepRight.d.ts +2 -0
- package/dist/compiled/lodash/fp/rearg.d.ts +2 -0
- package/dist/compiled/lodash/fp/reduce.d.ts +2 -0
- package/dist/compiled/lodash/fp/reduceRight.d.ts +2 -0
- package/dist/compiled/lodash/fp/reject.d.ts +2 -0
- package/dist/compiled/lodash/fp/remove.d.ts +2 -0
- package/dist/compiled/lodash/fp/repeat.d.ts +2 -0
- package/dist/compiled/lodash/fp/replace.d.ts +2 -0
- package/dist/compiled/lodash/fp/rest.d.ts +2 -0
- package/dist/compiled/lodash/fp/restFrom.d.ts +2 -0
- package/dist/compiled/lodash/fp/result.d.ts +2 -0
- package/dist/compiled/lodash/fp/reverse.d.ts +2 -0
- package/dist/compiled/lodash/fp/round.d.ts +2 -0
- package/dist/compiled/lodash/fp/runInContext.d.ts +2 -0
- package/dist/compiled/lodash/fp/sample.d.ts +2 -0
- package/dist/compiled/lodash/fp/sampleSize.d.ts +2 -0
- package/dist/compiled/lodash/fp/set.d.ts +2 -0
- package/dist/compiled/lodash/fp/setWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/shuffle.d.ts +2 -0
- package/dist/compiled/lodash/fp/size.d.ts +2 -0
- package/dist/compiled/lodash/fp/slice.d.ts +2 -0
- package/dist/compiled/lodash/fp/snakeCase.d.ts +2 -0
- package/dist/compiled/lodash/fp/some.d.ts +2 -0
- package/dist/compiled/lodash/fp/sortBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/sortedIndex.d.ts +2 -0
- package/dist/compiled/lodash/fp/sortedIndexBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/sortedIndexOf.d.ts +2 -0
- package/dist/compiled/lodash/fp/sortedLastIndex.d.ts +2 -0
- package/dist/compiled/lodash/fp/sortedLastIndexBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/sortedLastIndexOf.d.ts +2 -0
- package/dist/compiled/lodash/fp/sortedUniq.d.ts +2 -0
- package/dist/compiled/lodash/fp/sortedUniqBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/split.d.ts +2 -0
- package/dist/compiled/lodash/fp/spread.d.ts +2 -0
- package/dist/compiled/lodash/fp/spreadFrom.d.ts +2 -0
- package/dist/compiled/lodash/fp/startCase.d.ts +2 -0
- package/dist/compiled/lodash/fp/startsWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/stubArray.d.ts +2 -0
- package/dist/compiled/lodash/fp/stubFalse.d.ts +2 -0
- package/dist/compiled/lodash/fp/stubObject.d.ts +2 -0
- package/dist/compiled/lodash/fp/stubString.d.ts +2 -0
- package/dist/compiled/lodash/fp/stubTrue.d.ts +2 -0
- package/dist/compiled/lodash/fp/subtract.d.ts +2 -0
- package/dist/compiled/lodash/fp/sum.d.ts +2 -0
- package/dist/compiled/lodash/fp/sumBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/symmetricDifference.d.ts +2 -0
- package/dist/compiled/lodash/fp/symmetricDifferenceBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/symmetricDifferenceWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/tail.d.ts +2 -0
- package/dist/compiled/lodash/fp/take.d.ts +2 -0
- package/dist/compiled/lodash/fp/takeLast.d.ts +2 -0
- package/dist/compiled/lodash/fp/takeLastWhile.d.ts +2 -0
- package/dist/compiled/lodash/fp/takeRight.d.ts +2 -0
- package/dist/compiled/lodash/fp/takeRightWhile.d.ts +2 -0
- package/dist/compiled/lodash/fp/takeWhile.d.ts +2 -0
- package/dist/compiled/lodash/fp/tap.d.ts +2 -0
- package/dist/compiled/lodash/fp/template.d.ts +2 -0
- package/dist/compiled/lodash/fp/throttle.d.ts +2 -0
- package/dist/compiled/lodash/fp/thru.d.ts +2 -0
- package/dist/compiled/lodash/fp/times.d.ts +2 -0
- package/dist/compiled/lodash/fp/toArray.d.ts +2 -0
- package/dist/compiled/lodash/fp/toFinite.d.ts +2 -0
- package/dist/compiled/lodash/fp/toInteger.d.ts +2 -0
- package/dist/compiled/lodash/fp/toLength.d.ts +2 -0
- package/dist/compiled/lodash/fp/toLower.d.ts +2 -0
- package/dist/compiled/lodash/fp/toNumber.d.ts +2 -0
- package/dist/compiled/lodash/fp/toPairs.d.ts +2 -0
- package/dist/compiled/lodash/fp/toPairsIn.d.ts +2 -0
- package/dist/compiled/lodash/fp/toPath.d.ts +2 -0
- package/dist/compiled/lodash/fp/toPlainObject.d.ts +2 -0
- package/dist/compiled/lodash/fp/toSafeInteger.d.ts +2 -0
- package/dist/compiled/lodash/fp/toString.d.ts +2 -0
- package/dist/compiled/lodash/fp/toUpper.d.ts +2 -0
- package/dist/compiled/lodash/fp/transform.d.ts +2 -0
- package/dist/compiled/lodash/fp/trim.d.ts +2 -0
- package/dist/compiled/lodash/fp/trimChars.d.ts +2 -0
- package/dist/compiled/lodash/fp/trimCharsEnd.d.ts +2 -0
- package/dist/compiled/lodash/fp/trimCharsStart.d.ts +2 -0
- package/dist/compiled/lodash/fp/trimEnd.d.ts +2 -0
- package/dist/compiled/lodash/fp/trimStart.d.ts +2 -0
- package/dist/compiled/lodash/fp/truncate.d.ts +2 -0
- package/dist/compiled/lodash/fp/unapply.d.ts +2 -0
- package/dist/compiled/lodash/fp/unary.d.ts +2 -0
- package/dist/compiled/lodash/fp/unescape.d.ts +2 -0
- package/dist/compiled/lodash/fp/union.d.ts +2 -0
- package/dist/compiled/lodash/fp/unionBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/unionWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/uniq.d.ts +2 -0
- package/dist/compiled/lodash/fp/uniqBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/uniqWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/uniqueId.d.ts +2 -0
- package/dist/compiled/lodash/fp/unnest.d.ts +2 -0
- package/dist/compiled/lodash/fp/unset.d.ts +2 -0
- package/dist/compiled/lodash/fp/unzip.d.ts +2 -0
- package/dist/compiled/lodash/fp/unzipWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/update.d.ts +2 -0
- package/dist/compiled/lodash/fp/updateWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/upperCase.d.ts +2 -0
- package/dist/compiled/lodash/fp/upperFirst.d.ts +2 -0
- package/dist/compiled/lodash/fp/useWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/values.d.ts +2 -0
- package/dist/compiled/lodash/fp/valuesIn.d.ts +2 -0
- package/dist/compiled/lodash/fp/where.d.ts +2 -0
- package/dist/compiled/lodash/fp/whereEq.d.ts +2 -0
- package/dist/compiled/lodash/fp/without.d.ts +2 -0
- package/dist/compiled/lodash/fp/words.d.ts +2 -0
- package/dist/compiled/lodash/fp/wrap.d.ts +2 -0
- package/dist/compiled/lodash/fp/xor.d.ts +2 -0
- package/dist/compiled/lodash/fp/xorBy.d.ts +2 -0
- package/dist/compiled/lodash/fp/xorWith.d.ts +2 -0
- package/dist/compiled/lodash/fp/zip.d.ts +2 -0
- package/dist/compiled/lodash/fp/zipAll.d.ts +2 -0
- package/dist/compiled/lodash/fp/zipObj.d.ts +2 -0
- package/dist/compiled/lodash/fp/zipObject.d.ts +2 -0
- package/dist/compiled/lodash/fp/zipObjectDeep.d.ts +2 -0
- package/dist/compiled/lodash/fp/zipWith.d.ts +2 -0
- package/dist/compiled/lodash/fp.d.ts +4962 -0
- package/dist/compiled/lodash/fromPairs.d.ts +2 -0
- package/dist/compiled/lodash/functions.d.ts +2 -0
- package/dist/compiled/lodash/functionsIn.d.ts +2 -0
- package/dist/compiled/lodash/get.d.ts +2 -0
- package/dist/compiled/lodash/groupBy.d.ts +2 -0
- package/dist/compiled/lodash/gt.d.ts +2 -0
- package/dist/compiled/lodash/gte.d.ts +2 -0
- package/dist/compiled/lodash/has.d.ts +2 -0
- package/dist/compiled/lodash/hasIn.d.ts +2 -0
- package/dist/compiled/lodash/head.d.ts +2 -0
- package/dist/compiled/lodash/identity.d.ts +2 -0
- package/dist/compiled/lodash/inRange.d.ts +2 -0
- package/dist/compiled/lodash/includes.d.ts +2 -0
- package/dist/compiled/lodash/index.d.ts +1 -16
- package/dist/compiled/lodash/indexOf.d.ts +2 -0
- package/dist/compiled/lodash/initial.d.ts +2 -0
- package/dist/compiled/lodash/intersection.d.ts +2 -0
- package/dist/compiled/lodash/intersectionBy.d.ts +2 -0
- package/dist/compiled/lodash/intersectionWith.d.ts +2 -0
- package/dist/compiled/lodash/invert.d.ts +2 -0
- package/dist/compiled/lodash/invertBy.d.ts +2 -0
- package/dist/compiled/lodash/invoke.d.ts +2 -0
- package/dist/compiled/lodash/invokeMap.d.ts +2 -0
- package/dist/compiled/lodash/isArguments.d.ts +2 -0
- package/dist/compiled/lodash/isArray.d.ts +2 -0
- package/dist/compiled/lodash/isArrayBuffer.d.ts +2 -0
- package/dist/compiled/lodash/isArrayLike.d.ts +2 -0
- package/dist/compiled/lodash/isArrayLikeObject.d.ts +2 -0
- package/dist/compiled/lodash/isBoolean.d.ts +2 -0
- package/dist/compiled/lodash/isBuffer.d.ts +2 -0
- package/dist/compiled/lodash/isDate.d.ts +2 -0
- package/dist/compiled/lodash/isElement.d.ts +2 -0
- package/dist/compiled/lodash/isEmpty.d.ts +2 -0
- package/dist/compiled/lodash/isEqual.d.ts +2 -0
- package/dist/compiled/lodash/isEqualWith.d.ts +2 -0
- package/dist/compiled/lodash/isError.d.ts +2 -0
- package/dist/compiled/lodash/isFinite.d.ts +2 -0
- package/dist/compiled/lodash/isFunction.d.ts +2 -0
- package/dist/compiled/lodash/isInteger.d.ts +2 -0
- package/dist/compiled/lodash/isLength.d.ts +2 -0
- package/dist/compiled/lodash/isMap.d.ts +2 -0
- package/dist/compiled/lodash/isMatch.d.ts +2 -0
- package/dist/compiled/lodash/isMatchWith.d.ts +2 -0
- package/dist/compiled/lodash/isNaN.d.ts +2 -0
- package/dist/compiled/lodash/isNative.d.ts +2 -0
- package/dist/compiled/lodash/isNil.d.ts +2 -0
- package/dist/compiled/lodash/isNull.d.ts +2 -0
- package/dist/compiled/lodash/isNumber.d.ts +2 -0
- package/dist/compiled/lodash/isObject.d.ts +2 -0
- package/dist/compiled/lodash/isObjectLike.d.ts +2 -0
- package/dist/compiled/lodash/isPlainObject.d.ts +2 -0
- package/dist/compiled/lodash/isRegExp.d.ts +2 -0
- package/dist/compiled/lodash/isSafeInteger.d.ts +2 -0
- package/dist/compiled/lodash/isSet.d.ts +2 -0
- package/dist/compiled/lodash/isString.d.ts +2 -0
- package/dist/compiled/lodash/isSymbol.d.ts +2 -0
- package/dist/compiled/lodash/isTypedArray.d.ts +2 -0
- package/dist/compiled/lodash/isUndefined.d.ts +2 -0
- package/dist/compiled/lodash/isWeakMap.d.ts +2 -0
- package/dist/compiled/lodash/isWeakSet.d.ts +2 -0
- package/dist/compiled/lodash/iteratee.d.ts +2 -0
- package/dist/compiled/lodash/join.d.ts +2 -0
- package/dist/compiled/lodash/kebabCase.d.ts +2 -0
- package/dist/compiled/lodash/keyBy.d.ts +2 -0
- package/dist/compiled/lodash/keys.d.ts +2 -0
- package/dist/compiled/lodash/keysIn.d.ts +2 -0
- package/dist/compiled/lodash/last.d.ts +2 -0
- package/dist/compiled/lodash/lastIndexOf.d.ts +2 -0
- package/dist/compiled/lodash/licenses-cjs.txt +49 -0
- package/dist/compiled/lodash/lowerCase.d.ts +2 -0
- package/dist/compiled/lodash/lowerFirst.d.ts +2 -0
- package/dist/compiled/lodash/lt.d.ts +2 -0
- package/dist/compiled/lodash/lte.d.ts +2 -0
- package/dist/compiled/lodash/map.d.ts +2 -0
- package/dist/compiled/lodash/mapKeys.d.ts +2 -0
- package/dist/compiled/lodash/mapValues.d.ts +2 -0
- package/dist/compiled/lodash/matches.d.ts +2 -0
- package/dist/compiled/lodash/matchesProperty.d.ts +2 -0
- package/dist/compiled/lodash/max.d.ts +2 -0
- package/dist/compiled/lodash/maxBy.d.ts +2 -0
- package/dist/compiled/lodash/mean.d.ts +2 -0
- package/dist/compiled/lodash/meanBy.d.ts +2 -0
- package/dist/compiled/lodash/memoize.d.ts +2 -0
- package/dist/compiled/lodash/merge.d.ts +2 -0
- package/dist/compiled/lodash/mergeWith.d.ts +2 -0
- package/dist/compiled/lodash/method.d.ts +2 -0
- package/dist/compiled/lodash/methodOf.d.ts +2 -0
- package/dist/compiled/lodash/min.d.ts +2 -0
- package/dist/compiled/lodash/minBy.d.ts +2 -0
- package/dist/compiled/lodash/mixin.d.ts +2 -0
- package/dist/compiled/lodash/multiply.d.ts +2 -0
- package/dist/compiled/lodash/negate.d.ts +2 -0
- package/dist/compiled/lodash/noConflict.d.ts +2 -0
- package/dist/compiled/lodash/noop.d.ts +2 -0
- package/dist/compiled/lodash/now.d.ts +2 -0
- package/dist/compiled/lodash/nth.d.ts +2 -0
- package/dist/compiled/lodash/nthArg.d.ts +2 -0
- package/dist/compiled/lodash/omit.d.ts +2 -0
- package/dist/compiled/lodash/omitBy.d.ts +2 -0
- package/dist/compiled/lodash/once.d.ts +2 -0
- package/dist/compiled/lodash/orderBy.d.ts +2 -0
- package/dist/compiled/lodash/over.d.ts +2 -0
- package/dist/compiled/lodash/overArgs.d.ts +2 -0
- package/dist/compiled/lodash/overEvery.d.ts +2 -0
- package/dist/compiled/lodash/overSome.d.ts +2 -0
- package/dist/compiled/lodash/package.json +1 -1
- package/dist/compiled/lodash/pad.d.ts +2 -0
- package/dist/compiled/lodash/padEnd.d.ts +2 -0
- package/dist/compiled/lodash/padStart.d.ts +2 -0
- package/dist/compiled/lodash/parseInt.d.ts +2 -0
- package/dist/compiled/lodash/partial.d.ts +2 -0
- package/dist/compiled/lodash/partialRight.d.ts +2 -0
- package/dist/compiled/lodash/partition.d.ts +2 -0
- package/dist/compiled/lodash/pick.d.ts +2 -0
- package/dist/compiled/lodash/pickBy.d.ts +2 -0
- package/dist/compiled/lodash/property.d.ts +2 -0
- package/dist/compiled/lodash/propertyOf.d.ts +2 -0
- package/dist/compiled/lodash/provenance.json +19 -0
- package/dist/compiled/lodash/pull.d.ts +2 -0
- package/dist/compiled/lodash/pullAll.d.ts +2 -0
- package/dist/compiled/lodash/pullAllBy.d.ts +2 -0
- package/dist/compiled/lodash/pullAllWith.d.ts +2 -0
- package/dist/compiled/lodash/pullAt.d.ts +2 -0
- package/dist/compiled/lodash/random.d.ts +2 -0
- package/dist/compiled/lodash/range.d.ts +2 -0
- package/dist/compiled/lodash/rangeRight.d.ts +2 -0
- package/dist/compiled/lodash/rearg.d.ts +2 -0
- package/dist/compiled/lodash/reduce.d.ts +2 -0
- package/dist/compiled/lodash/reduceRight.d.ts +2 -0
- package/dist/compiled/lodash/reject.d.ts +2 -0
- package/dist/compiled/lodash/remove.d.ts +2 -0
- package/dist/compiled/lodash/repeat.d.ts +2 -0
- package/dist/compiled/lodash/replace.d.ts +2 -0
- package/dist/compiled/lodash/rest.d.ts +2 -0
- package/dist/compiled/lodash/result.d.ts +2 -0
- package/dist/compiled/lodash/reverse.d.ts +2 -0
- package/dist/compiled/lodash/round.d.ts +2 -0
- package/dist/compiled/lodash/runInContext.d.ts +2 -0
- package/dist/compiled/lodash/sample.d.ts +2 -0
- package/dist/compiled/lodash/sampleSize.d.ts +2 -0
- package/dist/compiled/lodash/set.d.ts +2 -0
- package/dist/compiled/lodash/setWith.d.ts +2 -0
- package/dist/compiled/lodash/shuffle.d.ts +2 -0
- package/dist/compiled/lodash/size.d.ts +2 -0
- package/dist/compiled/lodash/slice.d.ts +2 -0
- package/dist/compiled/lodash/snakeCase.d.ts +2 -0
- package/dist/compiled/lodash/some.d.ts +2 -0
- package/dist/compiled/lodash/sortBy.d.ts +2 -0
- package/dist/compiled/lodash/sortedIndex.d.ts +2 -0
- package/dist/compiled/lodash/sortedIndexBy.d.ts +2 -0
- package/dist/compiled/lodash/sortedIndexOf.d.ts +2 -0
- package/dist/compiled/lodash/sortedLastIndex.d.ts +2 -0
- package/dist/compiled/lodash/sortedLastIndexBy.d.ts +2 -0
- package/dist/compiled/lodash/sortedLastIndexOf.d.ts +2 -0
- package/dist/compiled/lodash/sortedUniq.d.ts +2 -0
- package/dist/compiled/lodash/sortedUniqBy.d.ts +2 -0
- package/dist/compiled/lodash/split.d.ts +2 -0
- package/dist/compiled/lodash/spread.d.ts +2 -0
- package/dist/compiled/lodash/startCase.d.ts +2 -0
- package/dist/compiled/lodash/startsWith.d.ts +2 -0
- package/dist/compiled/lodash/stubArray.d.ts +2 -0
- package/dist/compiled/lodash/stubFalse.d.ts +2 -0
- package/dist/compiled/lodash/stubObject.d.ts +2 -0
- package/dist/compiled/lodash/stubString.d.ts +2 -0
- package/dist/compiled/lodash/stubTrue.d.ts +2 -0
- package/dist/compiled/lodash/subtract.d.ts +2 -0
- package/dist/compiled/lodash/sum.d.ts +2 -0
- package/dist/compiled/lodash/sumBy.d.ts +2 -0
- package/dist/compiled/lodash/tail.d.ts +2 -0
- package/dist/compiled/lodash/take.d.ts +2 -0
- package/dist/compiled/lodash/takeRight.d.ts +2 -0
- package/dist/compiled/lodash/takeRightWhile.d.ts +2 -0
- package/dist/compiled/lodash/takeWhile.d.ts +2 -0
- package/dist/compiled/lodash/tap.d.ts +2 -0
- package/dist/compiled/lodash/template.d.ts +2 -0
- package/dist/compiled/lodash/throttle.d.ts +2 -0
- package/dist/compiled/lodash/thru.d.ts +2 -0
- package/dist/compiled/lodash/times.d.ts +2 -0
- package/dist/compiled/lodash/toArray.d.ts +2 -0
- package/dist/compiled/lodash/toFinite.d.ts +2 -0
- package/dist/compiled/lodash/toInteger.d.ts +2 -0
- package/dist/compiled/lodash/toLength.d.ts +2 -0
- package/dist/compiled/lodash/toLower.d.ts +2 -0
- package/dist/compiled/lodash/toNumber.d.ts +2 -0
- package/dist/compiled/lodash/toPairs.d.ts +2 -0
- package/dist/compiled/lodash/toPairsIn.d.ts +2 -0
- package/dist/compiled/lodash/toPath.d.ts +2 -0
- package/dist/compiled/lodash/toPlainObject.d.ts +2 -0
- package/dist/compiled/lodash/toSafeInteger.d.ts +2 -0
- package/dist/compiled/lodash/toString.d.ts +2 -0
- package/dist/compiled/lodash/toUpper.d.ts +2 -0
- package/dist/compiled/lodash/transform.d.ts +2 -0
- package/dist/compiled/lodash/trim.d.ts +2 -0
- package/dist/compiled/lodash/trimEnd.d.ts +2 -0
- package/dist/compiled/lodash/trimStart.d.ts +2 -0
- package/dist/compiled/lodash/truncate.d.ts +2 -0
- package/dist/compiled/lodash/unary.d.ts +2 -0
- package/dist/compiled/lodash/unescape.d.ts +2 -0
- package/dist/compiled/lodash/union.d.ts +2 -0
- package/dist/compiled/lodash/unionBy.d.ts +2 -0
- package/dist/compiled/lodash/unionWith.d.ts +2 -0
- package/dist/compiled/lodash/uniq.d.ts +2 -0
- package/dist/compiled/lodash/uniqBy.d.ts +2 -0
- package/dist/compiled/lodash/uniqWith.d.ts +2 -0
- package/dist/compiled/lodash/uniqueId.d.ts +2 -0
- package/dist/compiled/lodash/unset.d.ts +2 -0
- package/dist/compiled/lodash/unzip.d.ts +2 -0
- package/dist/compiled/lodash/unzipWith.d.ts +2 -0
- package/dist/compiled/lodash/update.d.ts +2 -0
- package/dist/compiled/lodash/updateWith.d.ts +2 -0
- package/dist/compiled/lodash/upperCase.d.ts +2 -0
- package/dist/compiled/lodash/upperFirst.d.ts +2 -0
- package/dist/compiled/lodash/values.d.ts +2 -0
- package/dist/compiled/lodash/valuesIn.d.ts +2 -0
- package/dist/compiled/lodash/without.d.ts +2 -0
- package/dist/compiled/lodash/words.d.ts +2 -0
- package/dist/compiled/lodash/wrap.d.ts +2 -0
- package/dist/compiled/lodash/xor.d.ts +2 -0
- package/dist/compiled/lodash/xorBy.d.ts +2 -0
- package/dist/compiled/lodash/xorWith.d.ts +2 -0
- package/dist/compiled/lodash/zip.d.ts +2 -0
- package/dist/compiled/lodash/zipObject.d.ts +2 -0
- package/dist/compiled/lodash/zipObjectDeep.d.ts +2 -0
- package/dist/compiled/lodash/zipWith.d.ts +2 -0
- package/dist/compiled/mime-types/declaration-licenses/@types_mime-types/LICENSE +21 -0
- package/dist/compiled/mime-types/index.d.ts +15 -12
- package/dist/compiled/mime-types/index.js +74 -28
- package/dist/compiled/mime-types/licenses-cjs.txt +52 -0
- package/dist/compiled/mime-types/package.json +1 -1
- package/dist/compiled/mime-types/provenance.json +19 -0
- package/dist/compiled/minimist/declaration-licenses/@types_minimist/LICENSE +21 -0
- package/dist/compiled/minimist/index.d.ts +3 -11
- package/dist/compiled/minimist/index.js +103 -104
- package/dist/compiled/minimist/licenses-cjs.txt +20 -0
- package/dist/compiled/minimist/package.json +1 -1
- package/dist/compiled/minimist/provenance.json +22 -0
- package/dist/compiled/nanoid/LICENSE +20 -0
- package/dist/compiled/nanoid/declaration-licenses/nanoid/LICENSE +20 -0
- package/dist/compiled/nanoid/index.d.mts +108 -0
- package/dist/compiled/nanoid/index.d.ts +31 -14
- package/dist/compiled/nanoid/index.js +117 -74
- package/dist/compiled/nanoid/index.mjs +98 -48
- package/dist/compiled/nanoid/licenses-cjs.txt +22 -0
- package/dist/compiled/nanoid/licenses-esm.txt +22 -0
- package/dist/compiled/nanoid/package.json +1 -1
- package/dist/compiled/nanoid/provenance.json +19 -0
- package/dist/compiled/ora/declaration-licenses/cli-spinners/license +9 -0
- package/dist/compiled/ora/declaration-licenses/ora/license +9 -0
- package/dist/compiled/ora/index.d.mts +501 -0
- package/dist/compiled/ora/index.d.ts +428 -204
- package/dist/compiled/ora/index.js +2121 -3893
- package/dist/compiled/ora/index.mjs +2155 -0
- package/dist/compiled/ora/licenses-cjs.txt +226 -0
- package/dist/compiled/ora/licenses-esm.txt +226 -0
- package/dist/compiled/ora/package.json +1 -1
- package/dist/compiled/ora/provenance.json +24 -0
- package/dist/compiled/pkg-up/declaration-licenses/@modern-js_compiled-pkg-up/license +9 -0
- package/dist/compiled/pkg-up/index.d.ts +9 -9
- package/dist/compiled/pkg-up/index.js +47 -14
- package/dist/compiled/pkg-up/licenses-cjs.txt +11 -0
- package/dist/compiled/pkg-up/package.json +1 -1
- package/dist/compiled/pkg-up/provenance.json +18 -0
- package/dist/compiled/semver/classes/comparator.d.ts +3 -3
- package/dist/compiled/semver/classes/range.d.ts +6 -6
- package/dist/compiled/semver/classes/semver.d.ts +11 -4
- package/dist/compiled/semver/declaration-licenses/@types_semver/LICENSE +21 -0
- package/dist/compiled/semver/functions/clean.d.ts +1 -1
- package/dist/compiled/semver/functions/cmp.d.ts +2 -2
- package/dist/compiled/semver/functions/coerce.d.ts +2 -2
- package/dist/compiled/semver/functions/compare-build.d.ts +7 -2
- package/dist/compiled/semver/functions/compare-loose.d.ts +4 -1
- package/dist/compiled/semver/functions/compare.d.ts +2 -2
- package/dist/compiled/semver/functions/diff.d.ts +3 -7
- package/dist/compiled/semver/functions/eq.d.ts +2 -2
- package/dist/compiled/semver/functions/gt.d.ts +2 -2
- package/dist/compiled/semver/functions/gte.d.ts +2 -2
- package/dist/compiled/semver/functions/inc.d.ts +15 -4
- package/dist/compiled/semver/functions/lt.d.ts +2 -2
- package/dist/compiled/semver/functions/lte.d.ts +2 -2
- package/dist/compiled/semver/functions/major.d.ts +2 -2
- package/dist/compiled/semver/functions/minor.d.ts +2 -2
- package/dist/compiled/semver/functions/neq.d.ts +2 -2
- package/dist/compiled/semver/functions/parse.d.ts +15 -4
- package/dist/compiled/semver/functions/patch.d.ts +2 -2
- package/dist/compiled/semver/functions/prerelease.d.ts +2 -2
- package/dist/compiled/semver/functions/rcompare.d.ts +2 -2
- package/dist/compiled/semver/functions/rsort.d.ts +2 -2
- package/dist/compiled/semver/functions/satisfies.d.ts +4 -4
- package/dist/compiled/semver/functions/sort.d.ts +2 -2
- package/dist/compiled/semver/functions/truncate.d.ts +10 -0
- package/dist/compiled/semver/functions/valid.d.ts +2 -2
- package/dist/compiled/semver/index.d.ts +82 -77
- package/dist/compiled/semver/index.js +639 -1026
- package/dist/compiled/semver/licenses-cjs.txt +17 -0
- package/dist/compiled/semver/package.json +1 -1
- package/dist/compiled/semver/preload.d.ts +2 -0
- package/dist/compiled/semver/provenance.json +22 -0
- package/dist/compiled/semver/ranges/gtr.d.ts +4 -4
- package/dist/compiled/semver/ranges/intersects.d.ts +3 -3
- package/dist/compiled/semver/ranges/ltr.d.ts +4 -4
- package/dist/compiled/semver/ranges/max-satisfying.d.ts +5 -5
- package/dist/compiled/semver/ranges/min-satisfying.d.ts +5 -5
- package/dist/compiled/semver/ranges/min-version.d.ts +3 -3
- package/dist/compiled/semver/ranges/outside.d.ts +5 -5
- package/dist/compiled/semver/ranges/simplify.d.ts +2 -2
- package/dist/compiled/semver/ranges/subset.d.ts +3 -7
- package/dist/compiled/semver/ranges/to-comparators.d.ts +2 -2
- package/dist/compiled/semver/ranges/valid.d.ts +3 -3
- package/dist/compiled/signale/declaration-licenses/@types_signale/LICENSE +21 -0
- package/dist/compiled/signale/index.d.ts +22 -29
- package/dist/compiled/signale/index.js +2934 -613
- package/dist/compiled/signale/license.md +21 -0
- package/dist/compiled/signale/licenses-cjs.txt +468 -0
- package/dist/compiled/signale/package.json +1 -1
- package/dist/compiled/signale/provenance.json +19 -0
- package/dist/compiled/slash/declaration-licenses/slash/license +9 -0
- package/dist/compiled/slash/index.d.mts +25 -0
- package/dist/compiled/slash/index.d.ts +4 -4
- package/dist/compiled/slash/index.js +31 -27
- package/dist/compiled/slash/index.mjs +25 -0
- package/dist/compiled/slash/license +1 -1
- package/dist/compiled/slash/licenses-cjs.txt +11 -0
- package/dist/compiled/slash/licenses-esm.txt +11 -0
- package/dist/compiled/slash/package.json +1 -1
- package/dist/compiled/slash/provenance.json +19 -0
- package/dist/compiled/strip-ansi/declaration-licenses/strip-ansi/license +9 -0
- package/dist/compiled/strip-ansi/index.d.mts +17 -0
- package/dist/compiled/strip-ansi/index.d.ts +2 -2
- package/dist/compiled/strip-ansi/index.js +39 -29
- package/dist/compiled/strip-ansi/index.mjs +33 -0
- package/dist/compiled/strip-ansi/license +1 -1
- package/dist/compiled/strip-ansi/licenses-cjs.txt +24 -0
- package/dist/compiled/strip-ansi/licenses-esm.txt +24 -0
- package/dist/compiled/strip-ansi/package.json +1 -1
- package/dist/compiled/strip-ansi/provenance.json +19 -0
- package/dist/compiled/tsconfig-paths/declaration-licenses/tsconfig-paths/LICENSE +21 -0
- package/dist/compiled/tsconfig-paths/index.d.mts +115 -0
- package/dist/compiled/tsconfig-paths/index.d.ts +115 -0
- package/dist/compiled/tsconfig-paths/index.js +256 -243
- package/dist/compiled/tsconfig-paths/index.mjs +2 -2
- package/dist/compiled/tsconfig-paths/licenses-cjs.txt +48 -0
- package/dist/compiled/tsconfig-paths/package.json +1 -1
- package/dist/compiled/tsconfig-paths/provenance.json +19 -0
- package/dist/compiled/upath/LICENSE +22 -0
- package/dist/compiled/upath/declaration-licenses/upath/LICENSE +22 -0
- package/dist/compiled/upath/index.d.mts +84 -0
- package/dist/compiled/upath/index.d.ts +84 -0
- package/dist/compiled/upath/index.js +173 -110
- package/dist/compiled/upath/index.mjs +236 -0
- package/dist/compiled/upath/licenses-cjs.txt +24 -0
- package/dist/compiled/upath/licenses-esm.txt +24 -0
- package/dist/compiled/upath/package.json +1 -1
- package/dist/compiled/upath/provenance.json +22 -0
- package/dist/compiled/url-join/declaration-licenses/url-join/LICENSE +21 -0
- package/dist/compiled/url-join/index.d.mts +9 -0
- package/dist/compiled/url-join/index.d.ts +3 -11
- package/dist/compiled/url-join/index.js +55 -55
- package/dist/compiled/url-join/index.mjs +50 -0
- package/dist/compiled/url-join/licenses-cjs.txt +23 -0
- package/dist/compiled/url-join/licenses-esm.txt +23 -0
- package/dist/compiled/url-join/package.json +1 -1
- package/dist/compiled/url-join/provenance.json +22 -0
- package/dist/esm/cli/applyOptionsChain.mjs +1 -1
- package/dist/esm/cli/get/config.mjs +1 -1
- package/dist/esm/cli/is/config.mjs +1 -1
- package/dist/esm/cli/require.mjs +4 -5
- package/dist/esm/compiled.mjs +22 -31
- package/dist/esm/fast-glob.mjs +1 -0
- package/dist/esm/watch-options.mjs +0 -0
- package/dist/esm-node/cli/applyOptionsChain.mjs +1 -1
- package/dist/esm-node/cli/get/config.mjs +1 -1
- package/dist/esm-node/cli/is/config.mjs +1 -1
- package/dist/esm-node/cli/require.mjs +4 -5
- package/dist/esm-node/compiled.mjs +22 -30
- package/dist/esm-node/fast-glob.mjs +2 -0
- package/dist/esm-node/watch-options.mjs +1 -0
- package/dist/types/cli/commands.d.ts +1 -1
- package/dist/types/cli/modulePath.d.ts +1 -1
- package/dist/types/cli/require.d.ts +0 -1
- package/dist/types/compiled.d.ts +30 -29
- package/dist/types/fast-glob.d.ts +1 -0
- package/dist/types/watch-options.d.ts +1 -0
- package/package.json +100 -36
- package/rslib.config.mts +20 -84
- package/dist/compiled/address/lib/address.d.ts +0 -28
- package/dist/compiled/browserslist/license +0 -20
- package/dist/compiled/chokidar/anymatch/index.d.ts +0 -19
- package/dist/compiled/chokidar/fsevents.node +0 -0
- package/dist/compiled/chokidar/license +0 -21
- package/dist/compiled/chokidar/types/index.d.ts +0 -188
- package/dist/compiled/commander/typings/index.d.ts +0 -890
- package/dist/compiled/debug/ms/index.d.ts +0 -25
- package/dist/compiled/dotenv/index.js +0 -101
- package/dist/compiled/dotenv/license +0 -23
- package/dist/compiled/dotenv/package.json +0 -1
- package/dist/compiled/dotenv/types/index.d.ts +0 -59
- package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/adapters/fs.d.ts +0 -20
- package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/index.d.ts +0 -12
- package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/providers/async.d.ts +0 -7
- package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/settings.d.ts +0 -20
- package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/types/index.d.ts +0 -20
- package/dist/compiled/fast-glob/@nodelib/fs.stat/out/adapters/fs.d.ts +0 -13
- package/dist/compiled/fast-glob/@nodelib/fs.stat/out/index.d.ts +0 -12
- package/dist/compiled/fast-glob/@nodelib/fs.stat/out/providers/async.d.ts +0 -4
- package/dist/compiled/fast-glob/@nodelib/fs.stat/out/settings.d.ts +0 -16
- package/dist/compiled/fast-glob/@nodelib/fs.stat/out/types/index.d.ts +0 -4
- package/dist/compiled/fast-glob/@nodelib/fs.walk/out/index.d.ts +0 -14
- package/dist/compiled/fast-glob/@nodelib/fs.walk/out/providers/async.d.ts +0 -12
- package/dist/compiled/fast-glob/@nodelib/fs.walk/out/readers/async.d.ts +0 -30
- package/dist/compiled/fast-glob/@nodelib/fs.walk/out/readers/reader.d.ts +0 -6
- package/dist/compiled/fast-glob/@nodelib/fs.walk/out/settings.d.ts +0 -30
- package/dist/compiled/fast-glob/@nodelib/fs.walk/out/types/index.d.ts +0 -8
- package/dist/compiled/fast-glob/index.js +0 -4665
- package/dist/compiled/fast-glob/index.js.LICENSE.txt +0 -38
- package/dist/compiled/fast-glob/license +0 -21
- package/dist/compiled/fast-glob/out/index.d.ts +0 -27
- package/dist/compiled/fast-glob/out/managers/tasks.d.ts +0 -22
- package/dist/compiled/fast-glob/out/settings.d.ts +0 -164
- package/dist/compiled/fast-glob/out/types/index.d.ts +0 -31
- package/dist/compiled/fast-glob/package.json +0 -1
- package/dist/compiled/filesize/filesize.d.ts +0 -131
- package/dist/compiled/filesize/license +0 -28
- package/dist/compiled/fs-extra/license +0 -15
- package/dist/compiled/glob/license +0 -21
- package/dist/compiled/glob/minimatch/index.d.ts +0 -204
- package/dist/compiled/inquirer/index.js.LICENSE.txt +0 -7
- package/dist/compiled/inquirer/lib/objects/choice.d.ts +0 -65
- package/dist/compiled/inquirer/lib/objects/choices.d.ts +0 -206
- package/dist/compiled/inquirer/lib/objects/separator.d.ts +0 -37
- package/dist/compiled/inquirer/lib/prompts/base.d.ts +0 -100
- package/dist/compiled/inquirer/lib/prompts/checkbox.d.ts +0 -116
- package/dist/compiled/inquirer/lib/prompts/confirm.d.ts +0 -53
- package/dist/compiled/inquirer/lib/prompts/editor.d.ts +0 -101
- package/dist/compiled/inquirer/lib/prompts/expand.d.ts +0 -149
- package/dist/compiled/inquirer/lib/prompts/input.d.ts +0 -82
- package/dist/compiled/inquirer/lib/prompts/list.d.ts +0 -89
- package/dist/compiled/inquirer/lib/prompts/number.d.ts +0 -32
- package/dist/compiled/inquirer/lib/prompts/password.d.ts +0 -82
- package/dist/compiled/inquirer/lib/prompts/rawlist.d.ts +0 -111
- package/dist/compiled/inquirer/lib/ui/baseUI.d.ts +0 -37
- package/dist/compiled/inquirer/lib/ui/bottom-bar.d.ts +0 -65
- package/dist/compiled/inquirer/lib/ui/prompt.d.ts +0 -104
- package/dist/compiled/inquirer/lib/utils/events.d.ts +0 -72
- package/dist/compiled/inquirer/lib/utils/incrementListIndex.d.ts +0 -23
- package/dist/compiled/inquirer/lib/utils/paginator.d.ts +0 -55
- package/dist/compiled/inquirer/lib/utils/readline.d.ts +0 -56
- package/dist/compiled/inquirer/lib/utils/screen-manager.d.ts +0 -90
- package/dist/compiled/inquirer/lib/utils/utils.d.ts +0 -30
- package/dist/compiled/inquirer/license +0 -22
- package/dist/compiled/inquirer/rxjs/LICENSE.txt +0 -202
- package/dist/compiled/inquirer/rxjs/ajax/index.d.ts +0 -5
- package/dist/compiled/inquirer/rxjs/fetch/index.d.ts +0 -2
- package/dist/compiled/inquirer/rxjs/index.d.ts +0 -173
- package/dist/compiled/inquirer/rxjs/internal/AnyCatcher.d.ts +0 -10
- package/dist/compiled/inquirer/rxjs/internal/AsyncSubject.d.ts +0 -13
- package/dist/compiled/inquirer/rxjs/internal/BehaviorSubject.d.ts +0 -13
- package/dist/compiled/inquirer/rxjs/internal/Notification.d.ts +0 -175
- package/dist/compiled/inquirer/rxjs/internal/NotificationFactories.d.ts +0 -2
- package/dist/compiled/inquirer/rxjs/internal/Observable.d.ts +0 -121
- package/dist/compiled/inquirer/rxjs/internal/Operator.d.ts +0 -9
- package/dist/compiled/inquirer/rxjs/internal/ReplaySubject.d.ts +0 -49
- package/dist/compiled/inquirer/rxjs/internal/Scheduler.d.ts +0 -53
- package/dist/compiled/inquirer/rxjs/internal/Subject.d.ts +0 -54
- package/dist/compiled/inquirer/rxjs/internal/Subscriber.d.ts +0 -72
- package/dist/compiled/inquirer/rxjs/internal/Subscription.d.ts +0 -92
- package/dist/compiled/inquirer/rxjs/internal/ajax/AjaxResponse.d.ts +0 -115
- package/dist/compiled/inquirer/rxjs/internal/ajax/ajax.d.ts +0 -227
- package/dist/compiled/inquirer/rxjs/internal/ajax/errors.d.ts +0 -65
- package/dist/compiled/inquirer/rxjs/internal/ajax/getXHRResponse.d.ts +0 -14
- package/dist/compiled/inquirer/rxjs/internal/ajax/types.d.ts +0 -200
- package/dist/compiled/inquirer/rxjs/internal/config.d.ts +0 -73
- package/dist/compiled/inquirer/rxjs/internal/firstValueFrom.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/lastValueFrom.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/observable/ConnectableObservable.d.ts +0 -42
- package/dist/compiled/inquirer/rxjs/internal/observable/bindCallback.d.ts +0 -5
- package/dist/compiled/inquirer/rxjs/internal/observable/bindCallbackInternals.d.ts +0 -4
- package/dist/compiled/inquirer/rxjs/internal/observable/bindNodeCallback.d.ts +0 -5
- package/dist/compiled/inquirer/rxjs/internal/observable/combineLatest.d.ts +0 -33
- package/dist/compiled/inquirer/rxjs/internal/observable/concat.d.ts +0 -5
- package/dist/compiled/inquirer/rxjs/internal/observable/connectable.d.ts +0 -27
- package/dist/compiled/inquirer/rxjs/internal/observable/defer.d.ts +0 -51
- package/dist/compiled/inquirer/rxjs/internal/observable/dom/WebSocketSubject.d.ts +0 -173
- package/dist/compiled/inquirer/rxjs/internal/observable/dom/animationFrames.d.ts +0 -76
- package/dist/compiled/inquirer/rxjs/internal/observable/dom/fetch.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/observable/dom/webSocket.d.ts +0 -159
- package/dist/compiled/inquirer/rxjs/internal/observable/empty.d.ts +0 -72
- package/dist/compiled/inquirer/rxjs/internal/observable/forkJoin.d.ts +0 -24
- package/dist/compiled/inquirer/rxjs/internal/observable/from.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/observable/fromEvent.d.ts +0 -45
- package/dist/compiled/inquirer/rxjs/internal/observable/fromEventPattern.d.ts +0 -5
- package/dist/compiled/inquirer/rxjs/internal/observable/fromSubscribable.d.ts +0 -14
- package/dist/compiled/inquirer/rxjs/internal/observable/generate.d.ts +0 -314
- package/dist/compiled/inquirer/rxjs/internal/observable/iif.d.ts +0 -82
- package/dist/compiled/inquirer/rxjs/internal/observable/innerFrom.d.ts +0 -21
- package/dist/compiled/inquirer/rxjs/internal/observable/interval.d.ts +0 -48
- package/dist/compiled/inquirer/rxjs/internal/observable/merge.d.ts +0 -9
- package/dist/compiled/inquirer/rxjs/internal/observable/never.d.ts +0 -40
- package/dist/compiled/inquirer/rxjs/internal/observable/of.d.ts +0 -14
- package/dist/compiled/inquirer/rxjs/internal/observable/onErrorResumeNext.d.ts +0 -5
- package/dist/compiled/inquirer/rxjs/internal/observable/pairs.d.ts +0 -19
- package/dist/compiled/inquirer/rxjs/internal/observable/partition.d.ts +0 -9
- package/dist/compiled/inquirer/rxjs/internal/observable/race.d.ts +0 -12
- package/dist/compiled/inquirer/rxjs/internal/observable/range.d.ts +0 -8
- package/dist/compiled/inquirer/rxjs/internal/observable/throwError.d.ts +0 -115
- package/dist/compiled/inquirer/rxjs/internal/observable/timer.d.ts +0 -126
- package/dist/compiled/inquirer/rxjs/internal/observable/using.d.ts +0 -30
- package/dist/compiled/inquirer/rxjs/internal/observable/zip.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/operators/OperatorSubscriber.d.ts +0 -41
- package/dist/compiled/inquirer/rxjs/internal/operators/audit.d.ts +0 -48
- package/dist/compiled/inquirer/rxjs/internal/operators/auditTime.d.ts +0 -50
- package/dist/compiled/inquirer/rxjs/internal/operators/buffer.d.ts +0 -41
- package/dist/compiled/inquirer/rxjs/internal/operators/bufferCount.d.ts +0 -54
- package/dist/compiled/inquirer/rxjs/internal/operators/bufferTime.d.ts +0 -5
- package/dist/compiled/inquirer/rxjs/internal/operators/bufferToggle.d.ts +0 -46
- package/dist/compiled/inquirer/rxjs/internal/operators/bufferWhen.d.ts +0 -41
- package/dist/compiled/inquirer/rxjs/internal/operators/catchError.d.ts +0 -4
- package/dist/compiled/inquirer/rxjs/internal/operators/combineAll.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/operators/combineLatest.d.ts +0 -10
- package/dist/compiled/inquirer/rxjs/internal/operators/combineLatestAll.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/operators/combineLatestWith.d.ts +0 -43
- package/dist/compiled/inquirer/rxjs/internal/operators/concat.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/operators/concatAll.d.ts +0 -59
- package/dist/compiled/inquirer/rxjs/internal/operators/concatMap.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/operators/concatMapTo.d.ts +0 -8
- package/dist/compiled/inquirer/rxjs/internal/operators/concatWith.d.ts +0 -43
- package/dist/compiled/inquirer/rxjs/internal/operators/connect.d.ts +0 -87
- package/dist/compiled/inquirer/rxjs/internal/operators/count.d.ts +0 -58
- package/dist/compiled/inquirer/rxjs/internal/operators/debounce.d.ts +0 -61
- package/dist/compiled/inquirer/rxjs/internal/operators/debounceTime.d.ts +0 -59
- package/dist/compiled/inquirer/rxjs/internal/operators/defaultIfEmpty.d.ts +0 -38
- package/dist/compiled/inquirer/rxjs/internal/operators/delay.d.ts +0 -59
- package/dist/compiled/inquirer/rxjs/internal/operators/delayWhen.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/operators/dematerialize.d.ts +0 -51
- package/dist/compiled/inquirer/rxjs/internal/operators/distinct.d.ts +0 -60
- package/dist/compiled/inquirer/rxjs/internal/operators/distinctUntilChanged.d.ts +0 -4
- package/dist/compiled/inquirer/rxjs/internal/operators/distinctUntilKeyChanged.d.ts +0 -4
- package/dist/compiled/inquirer/rxjs/internal/operators/elementAt.d.ts +0 -51
- package/dist/compiled/inquirer/rxjs/internal/operators/endWith.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/operators/every.d.ts +0 -9
- package/dist/compiled/inquirer/rxjs/internal/operators/exhaust.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/operators/exhaustAll.d.ts +0 -47
- package/dist/compiled/inquirer/rxjs/internal/operators/exhaustMap.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/operators/expand.d.ts +0 -9
- package/dist/compiled/inquirer/rxjs/internal/operators/filter.d.ts +0 -9
- package/dist/compiled/inquirer/rxjs/internal/operators/finalize.d.ts +0 -64
- package/dist/compiled/inquirer/rxjs/internal/operators/find.d.ts +0 -12
- package/dist/compiled/inquirer/rxjs/internal/operators/findIndex.d.ts +0 -9
- package/dist/compiled/inquirer/rxjs/internal/operators/first.d.ts +0 -9
- package/dist/compiled/inquirer/rxjs/internal/operators/flatMap.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/operators/groupBy.d.ts +0 -119
- package/dist/compiled/inquirer/rxjs/internal/operators/ignoreElements.d.ts +0 -38
- package/dist/compiled/inquirer/rxjs/internal/operators/isEmpty.d.ts +0 -64
- package/dist/compiled/inquirer/rxjs/internal/operators/joinAllInternals.d.ts +0 -14
- package/dist/compiled/inquirer/rxjs/internal/operators/last.d.ts +0 -8
- package/dist/compiled/inquirer/rxjs/internal/operators/map.d.ts +0 -5
- package/dist/compiled/inquirer/rxjs/internal/operators/mapTo.d.ts +0 -10
- package/dist/compiled/inquirer/rxjs/internal/operators/materialize.d.ts +0 -52
- package/dist/compiled/inquirer/rxjs/internal/operators/max.d.ts +0 -50
- package/dist/compiled/inquirer/rxjs/internal/operators/merge.d.ts +0 -10
- package/dist/compiled/inquirer/rxjs/internal/operators/mergeAll.d.ts +0 -62
- package/dist/compiled/inquirer/rxjs/internal/operators/mergeInternals.d.ts +0 -18
- package/dist/compiled/inquirer/rxjs/internal/operators/mergeMap.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/operators/mergeMapTo.d.ts +0 -9
- package/dist/compiled/inquirer/rxjs/internal/operators/mergeScan.d.ts +0 -68
- package/dist/compiled/inquirer/rxjs/internal/operators/mergeWith.d.ts +0 -44
- package/dist/compiled/inquirer/rxjs/internal/operators/min.d.ts +0 -50
- package/dist/compiled/inquirer/rxjs/internal/operators/multicast.d.ts +0 -63
- package/dist/compiled/inquirer/rxjs/internal/operators/observeOn.d.ts +0 -56
- package/dist/compiled/inquirer/rxjs/internal/operators/onErrorResumeNextWith.d.ts +0 -8
- package/dist/compiled/inquirer/rxjs/internal/operators/pairwise.d.ts +0 -46
- package/dist/compiled/inquirer/rxjs/internal/operators/partition.d.ts +0 -54
- package/dist/compiled/inquirer/rxjs/internal/operators/pluck.d.ts +0 -18
- package/dist/compiled/inquirer/rxjs/internal/operators/publish.d.ts +0 -30
- package/dist/compiled/inquirer/rxjs/internal/operators/publishBehavior.d.ts +0 -19
- package/dist/compiled/inquirer/rxjs/internal/operators/publishLast.d.ts +0 -69
- package/dist/compiled/inquirer/rxjs/internal/operators/publishReplay.d.ts +0 -56
- package/dist/compiled/inquirer/rxjs/internal/operators/race.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/operators/raceWith.d.ts +0 -29
- package/dist/compiled/inquirer/rxjs/internal/operators/reduce.d.ts +0 -5
- package/dist/compiled/inquirer/rxjs/internal/operators/refCount.d.ts +0 -61
- package/dist/compiled/inquirer/rxjs/internal/operators/repeat.d.ts +0 -108
- package/dist/compiled/inquirer/rxjs/internal/operators/repeatWhen.d.ts +0 -38
- package/dist/compiled/inquirer/rxjs/internal/operators/retry.d.ts +0 -28
- package/dist/compiled/inquirer/rxjs/internal/operators/retryWhen.d.ts +0 -61
- package/dist/compiled/inquirer/rxjs/internal/operators/sample.d.ts +0 -43
- package/dist/compiled/inquirer/rxjs/internal/operators/sampleTime.d.ts +0 -46
- package/dist/compiled/inquirer/rxjs/internal/operators/scan.d.ts +0 -5
- package/dist/compiled/inquirer/rxjs/internal/operators/scanInternals.d.ts +0 -12
- package/dist/compiled/inquirer/rxjs/internal/operators/sequenceEqual.d.ts +0 -60
- package/dist/compiled/inquirer/rxjs/internal/operators/share.d.ts +0 -43
- package/dist/compiled/inquirer/rxjs/internal/operators/shareReplay.d.ts +0 -10
- package/dist/compiled/inquirer/rxjs/internal/operators/single.d.ts +0 -5
- package/dist/compiled/inquirer/rxjs/internal/operators/skip.d.ts +0 -36
- package/dist/compiled/inquirer/rxjs/internal/operators/skipLast.d.ts +0 -45
- package/dist/compiled/inquirer/rxjs/internal/operators/skipUntil.d.ts +0 -48
- package/dist/compiled/inquirer/rxjs/internal/operators/skipWhile.d.ts +0 -5
- package/dist/compiled/inquirer/rxjs/internal/operators/startWith.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/operators/subscribeOn.d.ts +0 -62
- package/dist/compiled/inquirer/rxjs/internal/operators/switchAll.d.ts +0 -61
- package/dist/compiled/inquirer/rxjs/internal/operators/switchMap.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/operators/switchMapTo.d.ts +0 -8
- package/dist/compiled/inquirer/rxjs/internal/operators/switchScan.d.ts +0 -20
- package/dist/compiled/inquirer/rxjs/internal/operators/take.d.ts +0 -45
- package/dist/compiled/inquirer/rxjs/internal/operators/takeLast.d.ts +0 -42
- package/dist/compiled/inquirer/rxjs/internal/operators/takeUntil.d.ts +0 -41
- package/dist/compiled/inquirer/rxjs/internal/operators/takeWhile.d.ts +0 -8
- package/dist/compiled/inquirer/rxjs/internal/operators/tap.d.ts +0 -72
- package/dist/compiled/inquirer/rxjs/internal/operators/throttle.d.ts +0 -78
- package/dist/compiled/inquirer/rxjs/internal/operators/throttleTime.d.ts +0 -53
- package/dist/compiled/inquirer/rxjs/internal/operators/throwIfEmpty.d.ts +0 -39
- package/dist/compiled/inquirer/rxjs/internal/operators/timeInterval.d.ts +0 -50
- package/dist/compiled/inquirer/rxjs/internal/operators/timeout.d.ts +0 -255
- package/dist/compiled/inquirer/rxjs/internal/operators/timeoutWith.d.ts +0 -8
- package/dist/compiled/inquirer/rxjs/internal/operators/timestamp.d.ts +0 -35
- package/dist/compiled/inquirer/rxjs/internal/operators/toArray.d.ts +0 -33
- package/dist/compiled/inquirer/rxjs/internal/operators/window.d.ts +0 -48
- package/dist/compiled/inquirer/rxjs/internal/operators/windowCount.d.ts +0 -65
- package/dist/compiled/inquirer/rxjs/internal/operators/windowTime.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/operators/windowToggle.d.ts +0 -49
- package/dist/compiled/inquirer/rxjs/internal/operators/windowWhen.d.ts +0 -49
- package/dist/compiled/inquirer/rxjs/internal/operators/withLatestFrom.d.ts +0 -4
- package/dist/compiled/inquirer/rxjs/internal/operators/zip.d.ts +0 -10
- package/dist/compiled/inquirer/rxjs/internal/operators/zipAll.d.ts +0 -14
- package/dist/compiled/inquirer/rxjs/internal/operators/zipWith.d.ts +0 -26
- package/dist/compiled/inquirer/rxjs/internal/scheduled/scheduleArray.d.ts +0 -4
- package/dist/compiled/inquirer/rxjs/internal/scheduled/scheduleAsyncIterable.d.ts +0 -4
- package/dist/compiled/inquirer/rxjs/internal/scheduled/scheduleIterable.d.ts +0 -9
- package/dist/compiled/inquirer/rxjs/internal/scheduled/scheduleObservable.d.ts +0 -3
- package/dist/compiled/inquirer/rxjs/internal/scheduled/schedulePromise.d.ts +0 -3
- package/dist/compiled/inquirer/rxjs/internal/scheduled/scheduleReadableStreamLike.d.ts +0 -4
- package/dist/compiled/inquirer/rxjs/internal/scheduled/scheduled.d.ts +0 -15
- package/dist/compiled/inquirer/rxjs/internal/scheduler/Action.d.ts +0 -30
- package/dist/compiled/inquirer/rxjs/internal/scheduler/AnimationFrameAction.d.ts +0 -12
- package/dist/compiled/inquirer/rxjs/internal/scheduler/AnimationFrameScheduler.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/scheduler/AsapAction.d.ts +0 -12
- package/dist/compiled/inquirer/rxjs/internal/scheduler/AsapScheduler.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/scheduler/AsyncAction.d.ts +0 -24
- package/dist/compiled/inquirer/rxjs/internal/scheduler/AsyncScheduler.d.ts +0 -9
- package/dist/compiled/inquirer/rxjs/internal/scheduler/QueueAction.d.ts +0 -14
- package/dist/compiled/inquirer/rxjs/internal/scheduler/QueueScheduler.d.ts +0 -4
- package/dist/compiled/inquirer/rxjs/internal/scheduler/VirtualTimeScheduler.d.ts +0 -48
- package/dist/compiled/inquirer/rxjs/internal/scheduler/animationFrame.d.ts +0 -38
- package/dist/compiled/inquirer/rxjs/internal/scheduler/animationFrameProvider.d.ts +0 -13
- package/dist/compiled/inquirer/rxjs/internal/scheduler/asap.d.ts +0 -41
- package/dist/compiled/inquirer/rxjs/internal/scheduler/async.d.ts +0 -53
- package/dist/compiled/inquirer/rxjs/internal/scheduler/dateTimestampProvider.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/scheduler/immediateProvider.d.ts +0 -14
- package/dist/compiled/inquirer/rxjs/internal/scheduler/intervalProvider.d.ts +0 -14
- package/dist/compiled/inquirer/rxjs/internal/scheduler/performanceTimestampProvider.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/scheduler/queue.d.ts +0 -69
- package/dist/compiled/inquirer/rxjs/internal/scheduler/timeoutProvider.d.ts +0 -14
- package/dist/compiled/inquirer/rxjs/internal/scheduler/timerHandle.d.ts +0 -2
- package/dist/compiled/inquirer/rxjs/internal/symbol/iterator.d.ts +0 -3
- package/dist/compiled/inquirer/rxjs/internal/symbol/observable.d.ts +0 -8
- package/dist/compiled/inquirer/rxjs/internal/testing/ColdObservable.d.ts +0 -16
- package/dist/compiled/inquirer/rxjs/internal/testing/HotObservable.d.ts +0 -15
- package/dist/compiled/inquirer/rxjs/internal/testing/SubscriptionLog.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/testing/SubscriptionLoggable.d.ts +0 -9
- package/dist/compiled/inquirer/rxjs/internal/testing/TestMessage.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/testing/TestScheduler.d.ts +0 -88
- package/dist/compiled/inquirer/rxjs/internal/types.d.ts +0 -307
- package/dist/compiled/inquirer/rxjs/internal/util/ArgumentOutOfRangeError.d.ts +0 -19
- package/dist/compiled/inquirer/rxjs/internal/util/EmptyError.d.ts +0 -21
- package/dist/compiled/inquirer/rxjs/internal/util/Immediate.d.ts +0 -14
- package/dist/compiled/inquirer/rxjs/internal/util/NotFoundError.d.ts +0 -17
- package/dist/compiled/inquirer/rxjs/internal/util/ObjectUnsubscribedError.d.ts +0 -20
- package/dist/compiled/inquirer/rxjs/internal/util/SequenceError.d.ts +0 -17
- package/dist/compiled/inquirer/rxjs/internal/util/UnsubscriptionError.d.ts +0 -16
- package/dist/compiled/inquirer/rxjs/internal/util/applyMixins.d.ts +0 -2
- package/dist/compiled/inquirer/rxjs/internal/util/args.d.ts +0 -5
- package/dist/compiled/inquirer/rxjs/internal/util/argsArgArrayOrObject.d.ts +0 -11
- package/dist/compiled/inquirer/rxjs/internal/util/argsOrArgArray.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/util/arrRemove.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/util/createErrorClass.d.ts +0 -11
- package/dist/compiled/inquirer/rxjs/internal/util/createObject.d.ts +0 -2
- package/dist/compiled/inquirer/rxjs/internal/util/errorContext.d.ts +0 -14
- package/dist/compiled/inquirer/rxjs/internal/util/executeSchedule.d.ts +0 -5
- package/dist/compiled/inquirer/rxjs/internal/util/identity.d.ts +0 -44
- package/dist/compiled/inquirer/rxjs/internal/util/isArrayLike.d.ts +0 -2
- package/dist/compiled/inquirer/rxjs/internal/util/isAsyncIterable.d.ts +0 -2
- package/dist/compiled/inquirer/rxjs/internal/util/isDate.d.ts +0 -9
- package/dist/compiled/inquirer/rxjs/internal/util/isFunction.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/util/isInteropObservable.d.ts +0 -4
- package/dist/compiled/inquirer/rxjs/internal/util/isIterable.d.ts +0 -3
- package/dist/compiled/inquirer/rxjs/internal/util/isObservable.d.ts +0 -8
- package/dist/compiled/inquirer/rxjs/internal/util/isPromise.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/util/isReadableStreamLike.d.ts +0 -4
- package/dist/compiled/inquirer/rxjs/internal/util/isScheduler.d.ts +0 -3
- package/dist/compiled/inquirer/rxjs/internal/util/lift.d.ts +0 -15
- package/dist/compiled/inquirer/rxjs/internal/util/mapOneOrManyArgs.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/util/noop.d.ts +0 -2
- package/dist/compiled/inquirer/rxjs/internal/util/not.d.ts +0 -2
- package/dist/compiled/inquirer/rxjs/internal/util/pipe.d.ts +0 -14
- package/dist/compiled/inquirer/rxjs/internal/util/reportUnhandledError.d.ts +0 -11
- package/dist/compiled/inquirer/rxjs/internal/util/subscribeToArray.d.ts +0 -7
- package/dist/compiled/inquirer/rxjs/internal/util/throwUnobservableError.d.ts +0 -6
- package/dist/compiled/inquirer/rxjs/internal/util/workarounds.d.ts +0 -2
- package/dist/compiled/inquirer/rxjs/operators/index.d.ts +0 -114
- package/dist/compiled/inquirer/rxjs/testing/index.d.ts +0 -2
- package/dist/compiled/inquirer/rxjs/webSocket/index.d.ts +0 -3
- package/dist/compiled/inquirer/through/index.d.ts +0 -25
- package/dist/compiled/json5/lib/index.d.ts +0 -4
- package/dist/compiled/json5/lib/parse.d.ts +0 -15
- package/dist/compiled/json5/lib/stringify.d.ts +0 -89
- package/dist/compiled/nanoid/license +0 -20
- package/dist/compiled/ora/cli-spinners/index.d.ts +0 -125
- package/dist/compiled/ora/index.js.LICENSE.txt +0 -1
- package/dist/compiled/tsconfig-paths/lib/config-loader.d.ts +0 -33
- package/dist/compiled/tsconfig-paths/lib/filesystem.d.ts +0 -34
- package/dist/compiled/tsconfig-paths/lib/index.d.ts +0 -5
- package/dist/compiled/tsconfig-paths/lib/mapping-entry.d.ts +0 -18
- package/dist/compiled/tsconfig-paths/lib/match-path-async.d.ts +0 -21
- package/dist/compiled/tsconfig-paths/lib/match-path-sync.d.ts +0 -32
- package/dist/compiled/tsconfig-paths/lib/register.d.ts +0 -12
- package/dist/compiled/tsconfig-paths/lib/try-path.d.ts +0 -15
- package/dist/compiled/tsconfig-paths/lib/tsconfig-loader.d.ts +0 -28
- package/dist/compiled/upath/license +0 -22
- package/dist/compiled/upath/upath.d.ts +0 -241
- package/dist/compiled/webpack-chain/index.js +0 -1475
- package/dist/compiled/webpack-chain/license +0 -373
- package/dist/compiled/webpack-chain/package.json +0 -1
- package/dist/compiled/webpack-chain/types/index.d.ts +0 -599
- package/dist/esm/rslib-runtime~1.mjs +0 -12
- /package/dist/compiled/commander/{license → LICENSE} +0 -0
- /package/dist/compiled/debug/{license → LICENSE} +0 -0
- /package/dist/compiled/{inquirer/types-license → debug/declaration-licenses/@types_debug/LICENSE} +0 -0
- /package/dist/compiled/dotenv-expand/{license → LICENSE} +0 -0
- /package/dist/compiled/js-yaml/{license → LICENSE} +0 -0
- /package/dist/compiled/lodash/{license → LICENSE} +0 -0
- /package/dist/compiled/mime-types/{license → LICENSE} +0 -0
- /package/dist/compiled/minimist/{license → LICENSE} +0 -0
- /package/dist/compiled/semver/{license → LICENSE} +0 -0
- /package/dist/compiled/tsconfig-paths/{license → LICENSE} +0 -0
- /package/dist/compiled/url-join/{license → LICENSE} +0 -0
|
@@ -0,0 +1,3823 @@
|
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
|
+
import { StringDecoder } from 'node:string_decoder';
|
|
3
|
+
import { win32, posix } from 'node:path';
|
|
4
|
+
import { Stats, Dirent } from 'node:fs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Escape all magic characters in a glob pattern.
|
|
8
|
+
*
|
|
9
|
+
* If the {@link MinimatchOptions.windowsPathsNoEscape}
|
|
10
|
+
* option is used, then characters are escaped by wrapping in `[]`, because
|
|
11
|
+
* a magic character wrapped in a character class can only be satisfied by
|
|
12
|
+
* that exact character. In this mode, `\` is _not_ escaped, because it is
|
|
13
|
+
* not interpreted as a magic character, but instead as a path separator.
|
|
14
|
+
*
|
|
15
|
+
* If the {@link MinimatchOptions.magicalBraces} option is used,
|
|
16
|
+
* then braces (`{` and `}`) will be escaped.
|
|
17
|
+
*/
|
|
18
|
+
declare const escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Un-escape a string that has been escaped with {@link escape}.
|
|
22
|
+
*
|
|
23
|
+
* If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
|
|
24
|
+
* square-bracket escapes are removed, but not backslash escapes.
|
|
25
|
+
*
|
|
26
|
+
* For example, it will turn the string `'[*]'` into `*`, but it will not
|
|
27
|
+
* turn `'\\*'` into `'*'`, because `\` is a path separator in
|
|
28
|
+
* `windowsPathsNoEscape` mode.
|
|
29
|
+
*
|
|
30
|
+
* When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
|
|
31
|
+
* backslash escapes are removed.
|
|
32
|
+
*
|
|
33
|
+
* Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
|
|
34
|
+
* or unescaped.
|
|
35
|
+
*
|
|
36
|
+
* When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
|
|
37
|
+
* unescaped.
|
|
38
|
+
*/
|
|
39
|
+
declare const unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
|
40
|
+
|
|
41
|
+
type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
|
|
42
|
+
interface MinimatchOptions {
|
|
43
|
+
/** do not expand `{x,y}` style braces */
|
|
44
|
+
nobrace?: boolean;
|
|
45
|
+
/** do not treat patterns starting with `#` as a comment */
|
|
46
|
+
nocomment?: boolean;
|
|
47
|
+
/** do not treat patterns starting with `!` as a negation */
|
|
48
|
+
nonegate?: boolean;
|
|
49
|
+
/** print LOTS of debugging output */
|
|
50
|
+
debug?: boolean;
|
|
51
|
+
/** treat `**` the same as `*` */
|
|
52
|
+
noglobstar?: boolean;
|
|
53
|
+
/** do not expand extglobs like `+(a|b)` */
|
|
54
|
+
noext?: boolean;
|
|
55
|
+
/** return the pattern if nothing matches */
|
|
56
|
+
nonull?: boolean;
|
|
57
|
+
/** treat `\\` as a path separator, not an escape character */
|
|
58
|
+
windowsPathsNoEscape?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* inverse of {@link MinimatchOptions.windowsPathsNoEscape}
|
|
61
|
+
* @deprecated
|
|
62
|
+
*/
|
|
63
|
+
allowWindowsEscape?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Compare a partial path to a pattern. As long as the parts
|
|
66
|
+
* of the path that are present are not contradicted by the
|
|
67
|
+
* pattern, it will be treated as a match. This is useful in
|
|
68
|
+
* applications where you're walking through a folder structure,
|
|
69
|
+
* and don't yet have the full path, but want to ensure that you
|
|
70
|
+
* do not walk down paths that can never be a match.
|
|
71
|
+
*/
|
|
72
|
+
partial?: boolean;
|
|
73
|
+
/** allow matches that start with `.` even if the pattern does not */
|
|
74
|
+
dot?: boolean;
|
|
75
|
+
/** ignore case */
|
|
76
|
+
nocase?: boolean;
|
|
77
|
+
/** ignore case only in wildcard patterns */
|
|
78
|
+
nocaseMagicOnly?: boolean;
|
|
79
|
+
/** consider braces to be "magic" for the purpose of `hasMagic` */
|
|
80
|
+
magicalBraces?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* If set, then patterns without slashes will be matched
|
|
83
|
+
* against the basename of the path if it contains slashes.
|
|
84
|
+
* For example, `a?b` would match the path `/xyz/123/acb`, but
|
|
85
|
+
* not `/xyz/acb/123`.
|
|
86
|
+
*/
|
|
87
|
+
matchBase?: boolean;
|
|
88
|
+
/** invert the results of negated matches */
|
|
89
|
+
flipNegate?: boolean;
|
|
90
|
+
/** do not collapse multiple `/` into a single `/` */
|
|
91
|
+
preserveMultipleSlashes?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* A number indicating the level of optimization that should be done
|
|
94
|
+
* to the pattern prior to parsing and using it for matches.
|
|
95
|
+
*/
|
|
96
|
+
optimizationLevel?: number;
|
|
97
|
+
/** operating system platform */
|
|
98
|
+
platform?: Platform;
|
|
99
|
+
/**
|
|
100
|
+
* When a pattern starts with a UNC path or drive letter, and in
|
|
101
|
+
* `nocase:true` mode, do not convert the root portions of the
|
|
102
|
+
* pattern into a case-insensitive regular expression, and instead
|
|
103
|
+
* leave them as strings.
|
|
104
|
+
*
|
|
105
|
+
* This is the default when the platform is `win32` and
|
|
106
|
+
* `nocase:true` is set.
|
|
107
|
+
*/
|
|
108
|
+
windowsNoMagicRoot?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* max number of `{...}` patterns to expand. Default 100_000.
|
|
111
|
+
*/
|
|
112
|
+
braceExpandMax?: number;
|
|
113
|
+
/**
|
|
114
|
+
* Max number of non-adjacent `**` patterns to recursively walk down.
|
|
115
|
+
*
|
|
116
|
+
* The default of 200 is almost certainly high enough for most purposes,
|
|
117
|
+
* and can handle absurdly excessive patterns.
|
|
118
|
+
*/
|
|
119
|
+
maxGlobstarRecursion?: number;
|
|
120
|
+
/**
|
|
121
|
+
* Max depth to traverse for nested extglobs like `*(a|b|c)`
|
|
122
|
+
*
|
|
123
|
+
* Default is 2, which is quite low, but any higher value
|
|
124
|
+
* swiftly results in punishing performance impacts. Note
|
|
125
|
+
* that this is *not* relevant when the globstar types can
|
|
126
|
+
* be safely coalesced into a single set.
|
|
127
|
+
*
|
|
128
|
+
* For example, `*(a|@(b|c)|d)` would be flattened into
|
|
129
|
+
* `*(a|b|c|d)`. Thus, many common extglobs will retain good
|
|
130
|
+
* performance and never hit this limit, even if they are
|
|
131
|
+
* excessively deep and complicated.
|
|
132
|
+
*
|
|
133
|
+
* If the limit is hit, then the extglob characters are simply
|
|
134
|
+
* not parsed, and the pattern effectively switches into
|
|
135
|
+
* `noextglob: true` mode for the contents of that nested
|
|
136
|
+
* sub-pattern. This will typically _not_ result in a match,
|
|
137
|
+
* but is considered a valid trade-off for security and
|
|
138
|
+
* performance.
|
|
139
|
+
*/
|
|
140
|
+
maxExtglobRecursion?: number;
|
|
141
|
+
}
|
|
142
|
+
declare const GLOBSTAR: unique symbol;
|
|
143
|
+
type MMRegExp = RegExp & {
|
|
144
|
+
_src?: string;
|
|
145
|
+
_glob?: string;
|
|
146
|
+
};
|
|
147
|
+
type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR;
|
|
148
|
+
type ParseReturn = ParseReturnFiltered | false;
|
|
149
|
+
declare class Minimatch {
|
|
150
|
+
#private;
|
|
151
|
+
options: MinimatchOptions;
|
|
152
|
+
set: ParseReturnFiltered[][];
|
|
153
|
+
pattern: string;
|
|
154
|
+
windowsPathsNoEscape: boolean;
|
|
155
|
+
nonegate: boolean;
|
|
156
|
+
negate: boolean;
|
|
157
|
+
comment: boolean;
|
|
158
|
+
empty: boolean;
|
|
159
|
+
preserveMultipleSlashes: boolean;
|
|
160
|
+
partial: boolean;
|
|
161
|
+
globSet: string[];
|
|
162
|
+
globParts: string[][];
|
|
163
|
+
nocase: boolean;
|
|
164
|
+
isWindows: boolean;
|
|
165
|
+
platform: Platform;
|
|
166
|
+
windowsNoMagicRoot: boolean;
|
|
167
|
+
maxGlobstarRecursion: number;
|
|
168
|
+
regexp: false | null | MMRegExp;
|
|
169
|
+
constructor(pattern: string, options?: MinimatchOptions);
|
|
170
|
+
hasMagic(): boolean;
|
|
171
|
+
debug(..._: unknown[]): void;
|
|
172
|
+
make(): void;
|
|
173
|
+
preprocess(globParts: string[][]): string[][];
|
|
174
|
+
adjascentGlobstarOptimize(globParts: string[][]): string[][];
|
|
175
|
+
levelOneOptimize(globParts: string[][]): string[][];
|
|
176
|
+
levelTwoFileOptimize(parts: string | string[]): string[];
|
|
177
|
+
firstPhasePreProcess(globParts: string[][]): string[][];
|
|
178
|
+
secondPhasePreProcess(globParts: string[][]): string[][];
|
|
179
|
+
partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[];
|
|
180
|
+
parseNegate(): void;
|
|
181
|
+
matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean;
|
|
182
|
+
braceExpand(): string[];
|
|
183
|
+
parse(pattern: string): ParseReturn;
|
|
184
|
+
makeRe(): false | MMRegExp;
|
|
185
|
+
slashSplit(p: string): string[];
|
|
186
|
+
match(f: string, partial?: boolean): boolean;
|
|
187
|
+
static defaults(def: MinimatchOptions): typeof Minimatch;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Same as StringDecoder, but exposing the `lastNeed` flag on the type
|
|
192
|
+
*/
|
|
193
|
+
type SD = StringDecoder & {
|
|
194
|
+
lastNeed: boolean;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
declare const EOF: unique symbol;
|
|
198
|
+
declare const MAYBE_EMIT_END: unique symbol;
|
|
199
|
+
declare const EMITTED_END: unique symbol;
|
|
200
|
+
declare const EMITTING_END: unique symbol;
|
|
201
|
+
declare const EMITTED_ERROR: unique symbol;
|
|
202
|
+
declare const CLOSED: unique symbol;
|
|
203
|
+
declare const READ: unique symbol;
|
|
204
|
+
declare const FLUSH: unique symbol;
|
|
205
|
+
declare const FLUSHCHUNK: unique symbol;
|
|
206
|
+
declare const ENCODING: unique symbol;
|
|
207
|
+
declare const DECODER: unique symbol;
|
|
208
|
+
declare const FLOWING: unique symbol;
|
|
209
|
+
declare const PAUSED: unique symbol;
|
|
210
|
+
declare const RESUME: unique symbol;
|
|
211
|
+
declare const BUFFER: unique symbol;
|
|
212
|
+
declare const PIPES: unique symbol;
|
|
213
|
+
declare const BUFFERLENGTH: unique symbol;
|
|
214
|
+
declare const BUFFERPUSH: unique symbol;
|
|
215
|
+
declare const BUFFERSHIFT: unique symbol;
|
|
216
|
+
declare const OBJECTMODE: unique symbol;
|
|
217
|
+
declare const DESTROYED: unique symbol;
|
|
218
|
+
declare const ERROR: unique symbol;
|
|
219
|
+
declare const EMITDATA: unique symbol;
|
|
220
|
+
declare const EMITEND: unique symbol;
|
|
221
|
+
declare const EMITEND2: unique symbol;
|
|
222
|
+
declare const ASYNC: unique symbol;
|
|
223
|
+
declare const ABORT: unique symbol;
|
|
224
|
+
declare const ABORTED: unique symbol;
|
|
225
|
+
declare const SIGNAL: unique symbol;
|
|
226
|
+
declare const DATALISTENERS: unique symbol;
|
|
227
|
+
declare const DISCARDED: unique symbol;
|
|
228
|
+
/**
|
|
229
|
+
* Options that may be passed to stream.pipe()
|
|
230
|
+
*/
|
|
231
|
+
interface PipeOptions {
|
|
232
|
+
/**
|
|
233
|
+
* end the destination stream when the source stream ends
|
|
234
|
+
*/
|
|
235
|
+
end?: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* proxy errors from the source stream to the destination stream
|
|
238
|
+
*/
|
|
239
|
+
proxyErrors?: boolean;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Internal class representing a pipe to a destination stream.
|
|
243
|
+
*
|
|
244
|
+
* @internal
|
|
245
|
+
*/
|
|
246
|
+
declare class Pipe<T extends unknown> {
|
|
247
|
+
src: Minipass<T>;
|
|
248
|
+
dest: Minipass<any, T>;
|
|
249
|
+
opts: PipeOptions;
|
|
250
|
+
ondrain: () => any;
|
|
251
|
+
constructor(src: Minipass<T>, dest: Minipass.Writable, opts: PipeOptions);
|
|
252
|
+
unpipe(): void;
|
|
253
|
+
proxyErrors(_er: any): void;
|
|
254
|
+
end(): void;
|
|
255
|
+
}
|
|
256
|
+
declare namespace Minipass {
|
|
257
|
+
/**
|
|
258
|
+
* Encoding used to create a stream that outputs strings rather than
|
|
259
|
+
* Buffer objects.
|
|
260
|
+
*/
|
|
261
|
+
export type Encoding = BufferEncoding | 'buffer' | null;
|
|
262
|
+
/**
|
|
263
|
+
* Any stream that Minipass can pipe into
|
|
264
|
+
*/
|
|
265
|
+
export type Writable = Minipass<any, any, any> | NodeJS.WriteStream | (NodeJS.WriteStream & {
|
|
266
|
+
fd: number;
|
|
267
|
+
}) | (EventEmitter & {
|
|
268
|
+
end(): any;
|
|
269
|
+
write(chunk: any, ...args: any[]): any;
|
|
270
|
+
});
|
|
271
|
+
/**
|
|
272
|
+
* Any stream that can be read from
|
|
273
|
+
*/
|
|
274
|
+
export type Readable = Minipass<any, any, any> | NodeJS.ReadStream | (NodeJS.ReadStream & {
|
|
275
|
+
fd: number;
|
|
276
|
+
}) | (EventEmitter & {
|
|
277
|
+
pause(): any;
|
|
278
|
+
resume(): any;
|
|
279
|
+
pipe(...destArgs: any[]): any;
|
|
280
|
+
});
|
|
281
|
+
/**
|
|
282
|
+
* Utility type that can be iterated sync or async
|
|
283
|
+
*/
|
|
284
|
+
export type DualIterable<T> = Iterable<T> & AsyncIterable<T>;
|
|
285
|
+
type EventArguments = Record<string | symbol, unknown[]>;
|
|
286
|
+
/**
|
|
287
|
+
* The listing of events that a Minipass class can emit.
|
|
288
|
+
* Extend this when extending the Minipass class, and pass as
|
|
289
|
+
* the third template argument. The key is the name of the event,
|
|
290
|
+
* and the value is the argument list.
|
|
291
|
+
*
|
|
292
|
+
* Any undeclared events will still be allowed, but the handler will get
|
|
293
|
+
* arguments as `unknown[]`.
|
|
294
|
+
*/
|
|
295
|
+
export interface Events<RType extends any = Buffer> extends EventArguments {
|
|
296
|
+
readable: [];
|
|
297
|
+
data: [chunk: RType];
|
|
298
|
+
error: [er: unknown];
|
|
299
|
+
abort: [reason: unknown];
|
|
300
|
+
drain: [];
|
|
301
|
+
resume: [];
|
|
302
|
+
end: [];
|
|
303
|
+
finish: [];
|
|
304
|
+
prefinish: [];
|
|
305
|
+
close: [];
|
|
306
|
+
[DESTROYED]: [er?: unknown];
|
|
307
|
+
[ERROR]: [er: unknown];
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* String or buffer-like data that can be joined and sliced
|
|
311
|
+
*/
|
|
312
|
+
export type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string;
|
|
313
|
+
export type BufferOrString = Buffer | string;
|
|
314
|
+
/**
|
|
315
|
+
* Options passed to the Minipass constructor.
|
|
316
|
+
*/
|
|
317
|
+
export type SharedOptions = {
|
|
318
|
+
/**
|
|
319
|
+
* Defer all data emission and other events until the end of the
|
|
320
|
+
* current tick, similar to Node core streams
|
|
321
|
+
*/
|
|
322
|
+
async?: boolean;
|
|
323
|
+
/**
|
|
324
|
+
* A signal which will abort the stream
|
|
325
|
+
*/
|
|
326
|
+
signal?: AbortSignal;
|
|
327
|
+
/**
|
|
328
|
+
* Output string encoding. Set to `null` or `'buffer'` (or omit) to
|
|
329
|
+
* emit Buffer objects rather than strings.
|
|
330
|
+
*
|
|
331
|
+
* Conflicts with `objectMode`
|
|
332
|
+
*/
|
|
333
|
+
encoding?: BufferEncoding | null | 'buffer';
|
|
334
|
+
/**
|
|
335
|
+
* Output data exactly as it was written, supporting non-buffer/string
|
|
336
|
+
* data (such as arbitrary objects, falsey values, etc.)
|
|
337
|
+
*
|
|
338
|
+
* Conflicts with `encoding`
|
|
339
|
+
*/
|
|
340
|
+
objectMode?: boolean;
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* Options for a string encoded output
|
|
344
|
+
*/
|
|
345
|
+
export type EncodingOptions = SharedOptions & {
|
|
346
|
+
encoding: BufferEncoding;
|
|
347
|
+
objectMode?: false;
|
|
348
|
+
};
|
|
349
|
+
/**
|
|
350
|
+
* Options for contiguous data buffer output
|
|
351
|
+
*/
|
|
352
|
+
export type BufferOptions = SharedOptions & {
|
|
353
|
+
encoding?: null | 'buffer';
|
|
354
|
+
objectMode?: false;
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* Options for objectMode arbitrary output
|
|
358
|
+
*/
|
|
359
|
+
export type ObjectModeOptions = SharedOptions & {
|
|
360
|
+
objectMode: true;
|
|
361
|
+
encoding?: null;
|
|
362
|
+
};
|
|
363
|
+
/**
|
|
364
|
+
* Utility type to determine allowed options based on read type
|
|
365
|
+
*/
|
|
366
|
+
export type Options<T> = ObjectModeOptions | (T extends string ? EncodingOptions : T extends Buffer ? BufferOptions : SharedOptions);
|
|
367
|
+
export {};
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Main export, the Minipass class
|
|
371
|
+
*
|
|
372
|
+
* `RType` is the type of data emitted, defaults to Buffer
|
|
373
|
+
*
|
|
374
|
+
* `WType` is the type of data to be written, if RType is buffer or string,
|
|
375
|
+
* then any {@link Minipass.ContiguousData} is allowed.
|
|
376
|
+
*
|
|
377
|
+
* `Events` is the set of event handler signatures that this object
|
|
378
|
+
* will emit, see {@link Minipass.Events}
|
|
379
|
+
*/
|
|
380
|
+
declare class Minipass<RType extends unknown = Buffer, WType extends unknown = RType extends Minipass.BufferOrString ? Minipass.ContiguousData : RType, Events extends Minipass.Events<RType> = Minipass.Events<RType>> extends EventEmitter implements Minipass.DualIterable<RType> {
|
|
381
|
+
[FLOWING]: boolean;
|
|
382
|
+
[PAUSED]: boolean;
|
|
383
|
+
[PIPES]: Pipe<RType>[];
|
|
384
|
+
[BUFFER]: RType[];
|
|
385
|
+
[OBJECTMODE]: boolean;
|
|
386
|
+
[ENCODING]: BufferEncoding | null;
|
|
387
|
+
[ASYNC]: boolean;
|
|
388
|
+
[DECODER]: SD | null;
|
|
389
|
+
[EOF]: boolean;
|
|
390
|
+
[EMITTED_END]: boolean;
|
|
391
|
+
[EMITTING_END]: boolean;
|
|
392
|
+
[CLOSED]: boolean;
|
|
393
|
+
[EMITTED_ERROR]: unknown;
|
|
394
|
+
[BUFFERLENGTH]: number;
|
|
395
|
+
[DESTROYED]: boolean;
|
|
396
|
+
[SIGNAL]?: AbortSignal;
|
|
397
|
+
[ABORTED]: boolean;
|
|
398
|
+
[DATALISTENERS]: number;
|
|
399
|
+
[DISCARDED]: boolean;
|
|
400
|
+
/**
|
|
401
|
+
* true if the stream can be written
|
|
402
|
+
*/
|
|
403
|
+
writable: boolean;
|
|
404
|
+
/**
|
|
405
|
+
* true if the stream can be read
|
|
406
|
+
*/
|
|
407
|
+
readable: boolean;
|
|
408
|
+
/**
|
|
409
|
+
* If `RType` is Buffer, then options do not need to be provided.
|
|
410
|
+
* Otherwise, an options object must be provided to specify either
|
|
411
|
+
* {@link Minipass.SharedOptions.objectMode} or
|
|
412
|
+
* {@link Minipass.SharedOptions.encoding}, as appropriate.
|
|
413
|
+
*/
|
|
414
|
+
constructor(...args: [Minipass.ObjectModeOptions] | (RType extends Buffer ? [] | [Minipass.Options<RType>] : [Minipass.Options<RType>]));
|
|
415
|
+
/**
|
|
416
|
+
* The amount of data stored in the buffer waiting to be read.
|
|
417
|
+
*
|
|
418
|
+
* For Buffer strings, this will be the total byte length.
|
|
419
|
+
* For string encoding streams, this will be the string character length,
|
|
420
|
+
* according to JavaScript's `string.length` logic.
|
|
421
|
+
* For objectMode streams, this is a count of the items waiting to be
|
|
422
|
+
* emitted.
|
|
423
|
+
*/
|
|
424
|
+
get bufferLength(): number;
|
|
425
|
+
/**
|
|
426
|
+
* The `BufferEncoding` currently in use, or `null`
|
|
427
|
+
*/
|
|
428
|
+
get encoding(): BufferEncoding | null;
|
|
429
|
+
/**
|
|
430
|
+
* @deprecated - This is a read only property
|
|
431
|
+
*/
|
|
432
|
+
set encoding(_enc: BufferEncoding | null);
|
|
433
|
+
/**
|
|
434
|
+
* @deprecated - Encoding may only be set at instantiation time
|
|
435
|
+
*/
|
|
436
|
+
setEncoding(_enc: Minipass.Encoding): void;
|
|
437
|
+
/**
|
|
438
|
+
* True if this is an objectMode stream
|
|
439
|
+
*/
|
|
440
|
+
get objectMode(): boolean;
|
|
441
|
+
/**
|
|
442
|
+
* @deprecated - This is a read-only property
|
|
443
|
+
*/
|
|
444
|
+
set objectMode(_om: boolean);
|
|
445
|
+
/**
|
|
446
|
+
* true if this is an async stream
|
|
447
|
+
*/
|
|
448
|
+
get ['async'](): boolean;
|
|
449
|
+
/**
|
|
450
|
+
* Set to true to make this stream async.
|
|
451
|
+
*
|
|
452
|
+
* Once set, it cannot be unset, as this would potentially cause incorrect
|
|
453
|
+
* behavior. Ie, a sync stream can be made async, but an async stream
|
|
454
|
+
* cannot be safely made sync.
|
|
455
|
+
*/
|
|
456
|
+
set ['async'](a: boolean);
|
|
457
|
+
[ABORT](): void;
|
|
458
|
+
/**
|
|
459
|
+
* True if the stream has been aborted.
|
|
460
|
+
*/
|
|
461
|
+
get aborted(): boolean;
|
|
462
|
+
/**
|
|
463
|
+
* No-op setter. Stream aborted status is set via the AbortSignal provided
|
|
464
|
+
* in the constructor options.
|
|
465
|
+
*/
|
|
466
|
+
set aborted(_: boolean);
|
|
467
|
+
/**
|
|
468
|
+
* Write data into the stream
|
|
469
|
+
*
|
|
470
|
+
* If the chunk written is a string, and encoding is not specified, then
|
|
471
|
+
* `utf8` will be assumed. If the stream encoding matches the encoding of
|
|
472
|
+
* a written string, and the state of the string decoder allows it, then
|
|
473
|
+
* the string will be passed through to either the output or the internal
|
|
474
|
+
* buffer without any processing. Otherwise, it will be turned into a
|
|
475
|
+
* Buffer object for processing into the desired encoding.
|
|
476
|
+
*
|
|
477
|
+
* If provided, `cb` function is called immediately before return for
|
|
478
|
+
* sync streams, or on next tick for async streams, because for this
|
|
479
|
+
* base class, a chunk is considered "processed" once it is accepted
|
|
480
|
+
* and either emitted or buffered. That is, the callback does not indicate
|
|
481
|
+
* that the chunk has been eventually emitted, though of course child
|
|
482
|
+
* classes can override this function to do whatever processing is required
|
|
483
|
+
* and call `super.write(...)` only once processing is completed.
|
|
484
|
+
*/
|
|
485
|
+
write(chunk: WType, cb?: () => void): boolean;
|
|
486
|
+
write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean;
|
|
487
|
+
/**
|
|
488
|
+
* Low-level explicit read method.
|
|
489
|
+
*
|
|
490
|
+
* In objectMode, the argument is ignored, and one item is returned if
|
|
491
|
+
* available.
|
|
492
|
+
*
|
|
493
|
+
* `n` is the number of bytes (or in the case of encoding streams,
|
|
494
|
+
* characters) to consume. If `n` is not provided, then the entire buffer
|
|
495
|
+
* is returned, or `null` is returned if no data is available.
|
|
496
|
+
*
|
|
497
|
+
* If `n` is greater that the amount of data in the internal buffer,
|
|
498
|
+
* then `null` is returned.
|
|
499
|
+
*/
|
|
500
|
+
read(n?: number | null): RType | null;
|
|
501
|
+
[READ](n: number | null, chunk: RType): RType;
|
|
502
|
+
/**
|
|
503
|
+
* End the stream, optionally providing a final write.
|
|
504
|
+
*
|
|
505
|
+
* See {@link Minipass#write} for argument descriptions
|
|
506
|
+
*/
|
|
507
|
+
end(cb?: () => void): this;
|
|
508
|
+
end(chunk: WType, cb?: () => void): this;
|
|
509
|
+
end(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): this;
|
|
510
|
+
[RESUME](): void;
|
|
511
|
+
/**
|
|
512
|
+
* Resume the stream if it is currently in a paused state
|
|
513
|
+
*
|
|
514
|
+
* If called when there are no pipe destinations or `data` event listeners,
|
|
515
|
+
* this will place the stream in a "discarded" state, where all data will
|
|
516
|
+
* be thrown away. The discarded state is removed if a pipe destination or
|
|
517
|
+
* data handler is added, if pause() is called, or if any synchronous or
|
|
518
|
+
* asynchronous iteration is started.
|
|
519
|
+
*/
|
|
520
|
+
resume(): void;
|
|
521
|
+
/**
|
|
522
|
+
* Pause the stream
|
|
523
|
+
*/
|
|
524
|
+
pause(): void;
|
|
525
|
+
/**
|
|
526
|
+
* true if the stream has been forcibly destroyed
|
|
527
|
+
*/
|
|
528
|
+
get destroyed(): boolean;
|
|
529
|
+
/**
|
|
530
|
+
* true if the stream is currently in a flowing state, meaning that
|
|
531
|
+
* any writes will be immediately emitted.
|
|
532
|
+
*/
|
|
533
|
+
get flowing(): boolean;
|
|
534
|
+
/**
|
|
535
|
+
* true if the stream is currently in a paused state
|
|
536
|
+
*/
|
|
537
|
+
get paused(): boolean;
|
|
538
|
+
[BUFFERPUSH](chunk: RType): void;
|
|
539
|
+
[BUFFERSHIFT](): RType;
|
|
540
|
+
[FLUSH](noDrain?: boolean): void;
|
|
541
|
+
[FLUSHCHUNK](chunk: RType): boolean;
|
|
542
|
+
/**
|
|
543
|
+
* Pipe all data emitted by this stream into the destination provided.
|
|
544
|
+
*
|
|
545
|
+
* Triggers the flow of data.
|
|
546
|
+
*/
|
|
547
|
+
pipe<W extends Minipass.Writable>(dest: W, opts?: PipeOptions): W;
|
|
548
|
+
/**
|
|
549
|
+
* Fully unhook a piped destination stream.
|
|
550
|
+
*
|
|
551
|
+
* If the destination stream was the only consumer of this stream (ie,
|
|
552
|
+
* there are no other piped destinations or `'data'` event listeners)
|
|
553
|
+
* then the flow of data will stop until there is another consumer or
|
|
554
|
+
* {@link Minipass#resume} is explicitly called.
|
|
555
|
+
*/
|
|
556
|
+
unpipe<W extends Minipass.Writable>(dest: W): void;
|
|
557
|
+
/**
|
|
558
|
+
* Alias for {@link Minipass#on}
|
|
559
|
+
*/
|
|
560
|
+
addListener<Event extends keyof Events>(ev: Event, handler: (...args: Events[Event]) => any): this;
|
|
561
|
+
/**
|
|
562
|
+
* Mostly identical to `EventEmitter.on`, with the following
|
|
563
|
+
* behavior differences to prevent data loss and unnecessary hangs:
|
|
564
|
+
*
|
|
565
|
+
* - Adding a 'data' event handler will trigger the flow of data
|
|
566
|
+
*
|
|
567
|
+
* - Adding a 'readable' event handler when there is data waiting to be read
|
|
568
|
+
* will cause 'readable' to be emitted immediately.
|
|
569
|
+
*
|
|
570
|
+
* - Adding an 'endish' event handler ('end', 'finish', etc.) which has
|
|
571
|
+
* already passed will cause the event to be emitted immediately and all
|
|
572
|
+
* handlers removed.
|
|
573
|
+
*
|
|
574
|
+
* - Adding an 'error' event handler after an error has been emitted will
|
|
575
|
+
* cause the event to be re-emitted immediately with the error previously
|
|
576
|
+
* raised.
|
|
577
|
+
*/
|
|
578
|
+
on<Event extends keyof Events>(ev: Event, handler: (...args: Events[Event]) => any): this;
|
|
579
|
+
/**
|
|
580
|
+
* Alias for {@link Minipass#off}
|
|
581
|
+
*/
|
|
582
|
+
removeListener<Event extends keyof Events>(ev: Event, handler: (...args: Events[Event]) => any): this;
|
|
583
|
+
/**
|
|
584
|
+
* Mostly identical to `EventEmitter.off`
|
|
585
|
+
*
|
|
586
|
+
* If a 'data' event handler is removed, and it was the last consumer
|
|
587
|
+
* (ie, there are no pipe destinations or other 'data' event listeners),
|
|
588
|
+
* then the flow of data will stop until there is another consumer or
|
|
589
|
+
* {@link Minipass#resume} is explicitly called.
|
|
590
|
+
*/
|
|
591
|
+
off<Event extends keyof Events>(ev: Event, handler: (...args: Events[Event]) => any): this;
|
|
592
|
+
/**
|
|
593
|
+
* Mostly identical to `EventEmitter.removeAllListeners`
|
|
594
|
+
*
|
|
595
|
+
* If all 'data' event handlers are removed, and they were the last consumer
|
|
596
|
+
* (ie, there are no pipe destinations), then the flow of data will stop
|
|
597
|
+
* until there is another consumer or {@link Minipass#resume} is explicitly
|
|
598
|
+
* called.
|
|
599
|
+
*/
|
|
600
|
+
removeAllListeners<Event extends keyof Events>(ev?: Event): this;
|
|
601
|
+
/**
|
|
602
|
+
* true if the 'end' event has been emitted
|
|
603
|
+
*/
|
|
604
|
+
get emittedEnd(): boolean;
|
|
605
|
+
[MAYBE_EMIT_END](): void;
|
|
606
|
+
/**
|
|
607
|
+
* Mostly identical to `EventEmitter.emit`, with the following
|
|
608
|
+
* behavior differences to prevent data loss and unnecessary hangs:
|
|
609
|
+
*
|
|
610
|
+
* If the stream has been destroyed, and the event is something other
|
|
611
|
+
* than 'close' or 'error', then `false` is returned and no handlers
|
|
612
|
+
* are called.
|
|
613
|
+
*
|
|
614
|
+
* If the event is 'end', and has already been emitted, then the event
|
|
615
|
+
* is ignored. If the stream is in a paused or non-flowing state, then
|
|
616
|
+
* the event will be deferred until data flow resumes. If the stream is
|
|
617
|
+
* async, then handlers will be called on the next tick rather than
|
|
618
|
+
* immediately.
|
|
619
|
+
*
|
|
620
|
+
* If the event is 'close', and 'end' has not yet been emitted, then
|
|
621
|
+
* the event will be deferred until after 'end' is emitted.
|
|
622
|
+
*
|
|
623
|
+
* If the event is 'error', and an AbortSignal was provided for the stream,
|
|
624
|
+
* and there are no listeners, then the event is ignored, matching the
|
|
625
|
+
* behavior of node core streams in the presense of an AbortSignal.
|
|
626
|
+
*
|
|
627
|
+
* If the event is 'finish' or 'prefinish', then all listeners will be
|
|
628
|
+
* removed after emitting the event, to prevent double-firing.
|
|
629
|
+
*/
|
|
630
|
+
emit<Event extends keyof Events>(ev: Event, ...args: Events[Event]): boolean;
|
|
631
|
+
[EMITDATA](data: RType): boolean;
|
|
632
|
+
[EMITEND](): boolean;
|
|
633
|
+
[EMITEND2](): boolean;
|
|
634
|
+
/**
|
|
635
|
+
* Return a Promise that resolves to an array of all emitted data once
|
|
636
|
+
* the stream ends.
|
|
637
|
+
*/
|
|
638
|
+
collect(): Promise<RType[] & {
|
|
639
|
+
dataLength: number;
|
|
640
|
+
}>;
|
|
641
|
+
/**
|
|
642
|
+
* Return a Promise that resolves to the concatenation of all emitted data
|
|
643
|
+
* once the stream ends.
|
|
644
|
+
*
|
|
645
|
+
* Not allowed on objectMode streams.
|
|
646
|
+
*/
|
|
647
|
+
concat(): Promise<RType>;
|
|
648
|
+
/**
|
|
649
|
+
* Return a void Promise that resolves once the stream ends.
|
|
650
|
+
*/
|
|
651
|
+
promise(): Promise<void>;
|
|
652
|
+
/**
|
|
653
|
+
* Asynchronous `for await of` iteration.
|
|
654
|
+
*
|
|
655
|
+
* This will continue emitting all chunks until the stream terminates.
|
|
656
|
+
*/
|
|
657
|
+
[Symbol.asyncIterator](): AsyncGenerator<RType, void, void>;
|
|
658
|
+
/**
|
|
659
|
+
* Synchronous `for of` iteration.
|
|
660
|
+
*
|
|
661
|
+
* The iteration will terminate when the internal buffer runs out, even
|
|
662
|
+
* if the stream has not yet terminated.
|
|
663
|
+
*/
|
|
664
|
+
[Symbol.iterator](): Generator<RType, void, void>;
|
|
665
|
+
/**
|
|
666
|
+
* Destroy a stream, preventing it from being used for any further purpose.
|
|
667
|
+
*
|
|
668
|
+
* If the stream has a `close()` method, then it will be called on
|
|
669
|
+
* destruction.
|
|
670
|
+
*
|
|
671
|
+
* After destruction, any attempt to write data, read data, or emit most
|
|
672
|
+
* events will be ignored.
|
|
673
|
+
*
|
|
674
|
+
* If an error argument is provided, then it will be emitted in an
|
|
675
|
+
* 'error' event.
|
|
676
|
+
*/
|
|
677
|
+
destroy(er?: unknown): this;
|
|
678
|
+
/**
|
|
679
|
+
* Alias for {@link isStream}
|
|
680
|
+
*
|
|
681
|
+
* Former export location, maintained for backwards compatibility.
|
|
682
|
+
*
|
|
683
|
+
* @deprecated
|
|
684
|
+
*/
|
|
685
|
+
static get isStream(): (s: any) => s is Minipass<any, any, any> | NodeJS.ReadStream | NodeJS.WriteStream | (EventEmitter<any> & {
|
|
686
|
+
end(): any;
|
|
687
|
+
write(chunk: any, ...args: any[]): any;
|
|
688
|
+
}) | (EventEmitter<any> & {
|
|
689
|
+
pause(): any;
|
|
690
|
+
resume(): any;
|
|
691
|
+
pipe(...destArgs: any[]): any;
|
|
692
|
+
}) | (NodeJS.ReadStream & {
|
|
693
|
+
fd: number;
|
|
694
|
+
}) | (NodeJS.WriteStream & {
|
|
695
|
+
fd: number;
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* this provides the default Perf object source, either the
|
|
701
|
+
* `performance` global, or the `Date` constructor.
|
|
702
|
+
*
|
|
703
|
+
* it can be passed in via configuration to override it
|
|
704
|
+
* for a single LRU object.
|
|
705
|
+
*/
|
|
706
|
+
type Perf = {
|
|
707
|
+
now: () => number;
|
|
708
|
+
};
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* @module LRUCache
|
|
712
|
+
*/
|
|
713
|
+
|
|
714
|
+
declare const TYPE: unique symbol;
|
|
715
|
+
type Index = number & {
|
|
716
|
+
[TYPE]: 'LRUCache Index';
|
|
717
|
+
};
|
|
718
|
+
type UintArray = Uint8Array | Uint16Array | Uint32Array;
|
|
719
|
+
type NumberArray = UintArray | number[];
|
|
720
|
+
declare class ZeroArray extends Array<number> {
|
|
721
|
+
constructor(size: number);
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
type StackLike = Stack | Index[];
|
|
725
|
+
declare class Stack {
|
|
726
|
+
#private;
|
|
727
|
+
heap: NumberArray;
|
|
728
|
+
length: number;
|
|
729
|
+
static create(max: number): StackLike;
|
|
730
|
+
constructor(max: number, HeapCls: {
|
|
731
|
+
new (n: number): NumberArray;
|
|
732
|
+
});
|
|
733
|
+
push(n: Index): void;
|
|
734
|
+
pop(): Index;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Promise representing an in-progress {@link LRUCache#fetch} call
|
|
738
|
+
*/
|
|
739
|
+
type BackgroundFetch<V> = Promise<V | undefined> & {
|
|
740
|
+
__returned: BackgroundFetch<V> | undefined;
|
|
741
|
+
__abortController: AbortController;
|
|
742
|
+
__staleWhileFetching: V | undefined;
|
|
743
|
+
};
|
|
744
|
+
declare namespace LRUCache {
|
|
745
|
+
/**
|
|
746
|
+
* An integer greater than 0, reflecting the calculated size of items
|
|
747
|
+
*/
|
|
748
|
+
type Size = number;
|
|
749
|
+
/**
|
|
750
|
+
* Integer greater than 0, representing some number of milliseconds, or the
|
|
751
|
+
* time at which a TTL started counting from.
|
|
752
|
+
*/
|
|
753
|
+
type Milliseconds = number;
|
|
754
|
+
/**
|
|
755
|
+
* An integer greater than 0, reflecting a number of items
|
|
756
|
+
*/
|
|
757
|
+
type Count = number;
|
|
758
|
+
/**
|
|
759
|
+
* The reason why an item was removed from the cache, passed
|
|
760
|
+
* to the {@link Disposer} methods.
|
|
761
|
+
*
|
|
762
|
+
* - `evict`: The item was evicted because it is the least recently used,
|
|
763
|
+
* and the cache is full.
|
|
764
|
+
* - `set`: A new value was set, overwriting the old value being disposed.
|
|
765
|
+
* - `delete`: The item was explicitly deleted, either by calling
|
|
766
|
+
* {@link LRUCache#delete}, {@link LRUCache#clear}, or
|
|
767
|
+
* {@link LRUCache#set} with an undefined value.
|
|
768
|
+
* - `expire`: The item was removed due to exceeding its TTL.
|
|
769
|
+
* - `fetch`: A {@link OptionsBase#fetchMethod} operation returned
|
|
770
|
+
* `undefined` or was aborted, causing the item to be deleted.
|
|
771
|
+
*/
|
|
772
|
+
type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch';
|
|
773
|
+
/**
|
|
774
|
+
* A method called upon item removal, passed as the
|
|
775
|
+
* {@link OptionsBase.dispose} and/or
|
|
776
|
+
* {@link OptionsBase.disposeAfter} options.
|
|
777
|
+
*/
|
|
778
|
+
type Disposer<K, V> = (value: V, key: K, reason: DisposeReason) => void;
|
|
779
|
+
/**
|
|
780
|
+
* The reason why an item was added to the cache, passed
|
|
781
|
+
* to the {@link Inserter} methods.
|
|
782
|
+
*
|
|
783
|
+
* - `add`: the item was not found in the cache, and was added
|
|
784
|
+
* - `update`: the item was in the cache, with the same value provided
|
|
785
|
+
* - `replace`: the item was in the cache, and replaced
|
|
786
|
+
*/
|
|
787
|
+
type InsertReason = 'add' | 'update' | 'replace';
|
|
788
|
+
/**
|
|
789
|
+
* A method called upon item insertion, passed as the
|
|
790
|
+
* {@link OptionsBase.insert}
|
|
791
|
+
*/
|
|
792
|
+
type Inserter<K, V> = (value: V, key: K, reason: InsertReason) => void;
|
|
793
|
+
/**
|
|
794
|
+
* A function that returns the effective calculated size
|
|
795
|
+
* of an entry in the cache.
|
|
796
|
+
*/
|
|
797
|
+
type SizeCalculator<K, V> = (value: V, key: K) => Size;
|
|
798
|
+
/**
|
|
799
|
+
* Options provided to the
|
|
800
|
+
* {@link OptionsBase.fetchMethod} function.
|
|
801
|
+
*/
|
|
802
|
+
interface FetcherOptions<K, V, FC = unknown> {
|
|
803
|
+
signal: AbortSignal;
|
|
804
|
+
options: FetcherFetchOptions<K, V, FC>;
|
|
805
|
+
/**
|
|
806
|
+
* Object provided in the {@link FetchOptions.context} option to
|
|
807
|
+
* {@link LRUCache#fetch}
|
|
808
|
+
*/
|
|
809
|
+
context: FC;
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Occasionally, it may be useful to track the internal behavior of the
|
|
813
|
+
* cache, particularly for logging, debugging, or for behavior within the
|
|
814
|
+
* `fetchMethod`. To do this, you can pass a `status` object to the
|
|
815
|
+
* {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},
|
|
816
|
+
* {@link LRUCache#memo}, and {@link LRUCache#has} methods.
|
|
817
|
+
*
|
|
818
|
+
* The `status` option should be a plain JavaScript object. The following
|
|
819
|
+
* fields will be set on it appropriately, depending on the situation.
|
|
820
|
+
*
|
|
821
|
+
* These objects are also the context objects passed to listeners on the
|
|
822
|
+
* `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing
|
|
823
|
+
* channels, in platforms that support them.
|
|
824
|
+
*/
|
|
825
|
+
interface Status<K, V, FC = unknown> {
|
|
826
|
+
/**
|
|
827
|
+
* The operation being performed
|
|
828
|
+
*/
|
|
829
|
+
op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek';
|
|
830
|
+
/**
|
|
831
|
+
* The status of a set() operation.
|
|
832
|
+
*
|
|
833
|
+
* - add: the item was not found in the cache, and was added
|
|
834
|
+
* - update: the item was in the cache, with the same value provided
|
|
835
|
+
* - replace: the item was in the cache, and replaced
|
|
836
|
+
* - miss: the item was not added to the cache for some reason
|
|
837
|
+
*/
|
|
838
|
+
set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted';
|
|
839
|
+
/**
|
|
840
|
+
* The status of a delete() operation.
|
|
841
|
+
*/
|
|
842
|
+
delete?: LRUCache.DisposeReason;
|
|
843
|
+
/**
|
|
844
|
+
* The result of a peek() operation
|
|
845
|
+
*
|
|
846
|
+
* - hit: the item was found and returned
|
|
847
|
+
* - stale: the item is in the cache, but past its ttl and not returned
|
|
848
|
+
* - miss: item not in the cache
|
|
849
|
+
*/
|
|
850
|
+
peek?: 'hit' | 'miss' | 'stale';
|
|
851
|
+
/**
|
|
852
|
+
* The status of a memo() operation.
|
|
853
|
+
*
|
|
854
|
+
* - 'hit': the item was found in the cache and returned
|
|
855
|
+
* - 'miss': the `memoMethod` function was called
|
|
856
|
+
*/
|
|
857
|
+
memo?: 'hit' | 'miss';
|
|
858
|
+
/**
|
|
859
|
+
* The `context` option provided to a memo or fetch operation
|
|
860
|
+
*
|
|
861
|
+
* In practice, of course, this will be the same type as the `FC`
|
|
862
|
+
* fetch context param used to instantiate the LRUCache, but the
|
|
863
|
+
* convolutions of threading that through would get quite complicated,
|
|
864
|
+
* and preclude forcing/forbidding the passing of a `context` param
|
|
865
|
+
* where it is/isn't expected, which is more valuable for error
|
|
866
|
+
* prevention.
|
|
867
|
+
*/
|
|
868
|
+
context?: unknown;
|
|
869
|
+
/**
|
|
870
|
+
* the ttl stored for the item, or undefined if ttls are not used.
|
|
871
|
+
*/
|
|
872
|
+
ttl?: Milliseconds;
|
|
873
|
+
/**
|
|
874
|
+
* the start time for the item, or undefined if ttls are not used.
|
|
875
|
+
*/
|
|
876
|
+
start?: Milliseconds;
|
|
877
|
+
/**
|
|
878
|
+
* The timestamp used for TTL calculation
|
|
879
|
+
*/
|
|
880
|
+
now?: Milliseconds;
|
|
881
|
+
/**
|
|
882
|
+
* the remaining ttl for the item, or undefined if ttls are not used.
|
|
883
|
+
*/
|
|
884
|
+
remainingTTL?: Milliseconds;
|
|
885
|
+
/**
|
|
886
|
+
* The calculated size for the item, if sizes are used.
|
|
887
|
+
*/
|
|
888
|
+
entrySize?: Size;
|
|
889
|
+
/**
|
|
890
|
+
* The total calculated size of the cache, if sizes are used.
|
|
891
|
+
*/
|
|
892
|
+
totalCalculatedSize?: Size;
|
|
893
|
+
/**
|
|
894
|
+
* A flag indicating that the item was not stored, due to exceeding the
|
|
895
|
+
* {@link OptionsBase.maxEntrySize}
|
|
896
|
+
*/
|
|
897
|
+
maxEntrySizeExceeded?: true;
|
|
898
|
+
/**
|
|
899
|
+
* The key that was set or retrieved
|
|
900
|
+
*/
|
|
901
|
+
key?: K;
|
|
902
|
+
/**
|
|
903
|
+
* The value that was set
|
|
904
|
+
*/
|
|
905
|
+
value?: V;
|
|
906
|
+
/**
|
|
907
|
+
* The old value, specified in the case of `set:'replace'`
|
|
908
|
+
*/
|
|
909
|
+
oldValue?: V;
|
|
910
|
+
/**
|
|
911
|
+
* The results of a {@link LRUCache#has} operation
|
|
912
|
+
*
|
|
913
|
+
* - hit: the item was found in the cache
|
|
914
|
+
* - stale: the item was found in the cache, but is stale
|
|
915
|
+
* - miss: the item was not found in the cache
|
|
916
|
+
*/
|
|
917
|
+
has?: 'hit' | 'stale' | 'miss';
|
|
918
|
+
/**
|
|
919
|
+
* The status of a {@link LRUCache#fetch} operation.
|
|
920
|
+
* Note that this can change as the underlying fetch() moves through
|
|
921
|
+
* various states.
|
|
922
|
+
*
|
|
923
|
+
* - inflight: there is another fetch() for this key which is in process
|
|
924
|
+
* - get: there is no {@link OptionsBase.fetchMethod}, so
|
|
925
|
+
* {@link LRUCache#get} was called.
|
|
926
|
+
* - miss: the item is not in cache, and will be fetched.
|
|
927
|
+
* - hit: the item is in the cache, and was resolved immediately.
|
|
928
|
+
* - stale: the item is in the cache, but stale.
|
|
929
|
+
* - refresh: the item is in the cache, and not stale, but
|
|
930
|
+
* {@link FetchOptions.forceRefresh} was specified.
|
|
931
|
+
*/
|
|
932
|
+
fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh';
|
|
933
|
+
/**
|
|
934
|
+
* `forceRefresh` option was used for either a fetch or memo operation
|
|
935
|
+
*/
|
|
936
|
+
forceRefresh?: boolean;
|
|
937
|
+
/**
|
|
938
|
+
* The {@link OptionsBase.fetchMethod} was called
|
|
939
|
+
*/
|
|
940
|
+
fetchDispatched?: true;
|
|
941
|
+
/**
|
|
942
|
+
* The cached value was updated after a successful call to
|
|
943
|
+
* {@link OptionsBase.fetchMethod}
|
|
944
|
+
*/
|
|
945
|
+
fetchUpdated?: true;
|
|
946
|
+
/**
|
|
947
|
+
* The reason for a fetch() rejection. Either the error raised by the
|
|
948
|
+
* {@link OptionsBase.fetchMethod}, or the reason for an
|
|
949
|
+
* AbortSignal.
|
|
950
|
+
*/
|
|
951
|
+
fetchError?: Error;
|
|
952
|
+
/**
|
|
953
|
+
* The fetch received an abort signal
|
|
954
|
+
*/
|
|
955
|
+
fetchAborted?: true;
|
|
956
|
+
/**
|
|
957
|
+
* The abort signal received was ignored, and the fetch was allowed to
|
|
958
|
+
* continue in the background.
|
|
959
|
+
*/
|
|
960
|
+
fetchAbortIgnored?: true;
|
|
961
|
+
/**
|
|
962
|
+
* The fetchMethod promise resolved successfully
|
|
963
|
+
*/
|
|
964
|
+
fetchResolved?: true;
|
|
965
|
+
/**
|
|
966
|
+
* The fetchMethod promise was rejected
|
|
967
|
+
*/
|
|
968
|
+
fetchRejected?: true;
|
|
969
|
+
/**
|
|
970
|
+
* The status of a {@link LRUCache#get} operation.
|
|
971
|
+
*
|
|
972
|
+
* - fetching: The item is currently being fetched. If a previous value
|
|
973
|
+
* is present and allowed, that will be returned.
|
|
974
|
+
* - stale: The item is in the cache, and is stale. If it was returned,
|
|
975
|
+
* then the `returnedStale` flag will be set.
|
|
976
|
+
* - stale-fetching: The value is being fetched in the background, but is
|
|
977
|
+
* currently stale. If the stale value was returned, then the
|
|
978
|
+
* `returnedStale` flag will be set.
|
|
979
|
+
* - hit: the item is in the cache
|
|
980
|
+
* - miss: the item is not in the cache
|
|
981
|
+
*/
|
|
982
|
+
get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching';
|
|
983
|
+
/**
|
|
984
|
+
* A fetch or get operation returned a stale value.
|
|
985
|
+
*/
|
|
986
|
+
returnedStale?: true;
|
|
987
|
+
/**
|
|
988
|
+
* A tracingChannel trace was started for this operation
|
|
989
|
+
*/
|
|
990
|
+
trace?: boolean;
|
|
991
|
+
/**
|
|
992
|
+
* A reference to the cache instance associated with this operation
|
|
993
|
+
*/
|
|
994
|
+
cache?: LRUCache<K & {}, V & {}, FC>;
|
|
995
|
+
}
|
|
996
|
+
/**
|
|
997
|
+
* options which override the options set in the LRUCache constructor
|
|
998
|
+
* when calling {@link LRUCache#fetch}.
|
|
999
|
+
*
|
|
1000
|
+
* This is the union of {@link GetOptions} and {@link SetOptions}, plus
|
|
1001
|
+
* {@link OptionsBase.noDeleteOnFetchRejection},
|
|
1002
|
+
* {@link OptionsBase.allowStaleOnFetchRejection},
|
|
1003
|
+
* {@link FetchOptions.forceRefresh}, and
|
|
1004
|
+
* {@link FetcherOptions.context}
|
|
1005
|
+
*
|
|
1006
|
+
* Any of these may be modified in the {@link OptionsBase.fetchMethod}
|
|
1007
|
+
* function, but the {@link GetOptions} fields will of course have no
|
|
1008
|
+
* effect, as the {@link LRUCache#get} call already happened by the time
|
|
1009
|
+
* the fetchMethod is called.
|
|
1010
|
+
*/
|
|
1011
|
+
interface FetcherFetchOptions<K, V, FC = unknown> extends Pick<OptionsBase<K, V, FC>, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> {
|
|
1012
|
+
status?: Status<K, V, FC>;
|
|
1013
|
+
size?: Size;
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* Options that may be passed to the {@link LRUCache#fetch} method.
|
|
1017
|
+
*/
|
|
1018
|
+
interface FetchOptions<K, V, FC> extends FetcherFetchOptions<K, V, FC> {
|
|
1019
|
+
/**
|
|
1020
|
+
* Set to true to force a re-load of the existing data, even if it
|
|
1021
|
+
* is not yet stale.
|
|
1022
|
+
*/
|
|
1023
|
+
forceRefresh?: boolean;
|
|
1024
|
+
/**
|
|
1025
|
+
* Context provided to the {@link OptionsBase.fetchMethod} as
|
|
1026
|
+
* the {@link FetcherOptions.context} param.
|
|
1027
|
+
*
|
|
1028
|
+
* If the FC type is specified as unknown (the default),
|
|
1029
|
+
* undefined or void, then this is optional. Otherwise, it will
|
|
1030
|
+
* be required.
|
|
1031
|
+
*/
|
|
1032
|
+
context?: FC;
|
|
1033
|
+
signal?: AbortSignal;
|
|
1034
|
+
status?: Status<K, V, FC>;
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Options provided to {@link LRUCache#fetch} when the FC type is something
|
|
1038
|
+
* other than `unknown`, `undefined`, or `void`
|
|
1039
|
+
*/
|
|
1040
|
+
interface FetchOptionsWithContext<K, V, FC> extends FetchOptions<K, V, FC> {
|
|
1041
|
+
context: FC;
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* Options provided to {@link LRUCache#fetch} when the FC type is
|
|
1045
|
+
* `undefined` or `void`
|
|
1046
|
+
*/
|
|
1047
|
+
interface FetchOptionsNoContext<K, V, FC extends undefined | void = undefined> extends FetchOptions<K, V, FC> {
|
|
1048
|
+
context?: FC;
|
|
1049
|
+
}
|
|
1050
|
+
interface MemoOptions<K, V, FC = unknown> extends Pick<OptionsBase<K, V, FC>, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> {
|
|
1051
|
+
/**
|
|
1052
|
+
* Set to true to force a re-load of the existing data, even if it
|
|
1053
|
+
* is not yet stale.
|
|
1054
|
+
*/
|
|
1055
|
+
forceRefresh?: boolean;
|
|
1056
|
+
/**
|
|
1057
|
+
* Context provided to the {@link OptionsBase.memoMethod} as
|
|
1058
|
+
* the {@link MemoizerOptions.context} param.
|
|
1059
|
+
*
|
|
1060
|
+
* If the FC type is specified as unknown (the default),
|
|
1061
|
+
* undefined or void, then this is optional. Otherwise, it will
|
|
1062
|
+
* be required.
|
|
1063
|
+
*/
|
|
1064
|
+
context?: FC;
|
|
1065
|
+
status?: Status<K, V, FC>;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* Options provided to {@link LRUCache#memo} when the FC type is something
|
|
1069
|
+
* other than `unknown`, `undefined`, or `void`
|
|
1070
|
+
*/
|
|
1071
|
+
interface MemoOptionsWithContext<K, V, FC> extends MemoOptions<K, V, FC> {
|
|
1072
|
+
context: FC;
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* Options provided to {@link LRUCache#memo} when the FC type is
|
|
1076
|
+
* `undefined` or `void`
|
|
1077
|
+
*/
|
|
1078
|
+
interface MemoOptionsNoContext<K, V, FC extends undefined | void = undefined> extends MemoOptions<K, V, FC> {
|
|
1079
|
+
context?: FC;
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Options provided to the
|
|
1083
|
+
* {@link OptionsBase.memoMethod} function.
|
|
1084
|
+
*/
|
|
1085
|
+
interface MemoizerOptions<K, V, FC = unknown> {
|
|
1086
|
+
options: MemoizerMemoOptions<K, V, FC>;
|
|
1087
|
+
/**
|
|
1088
|
+
* Object provided in the {@link MemoOptions.context} option to
|
|
1089
|
+
* {@link LRUCache#memo}
|
|
1090
|
+
*/
|
|
1091
|
+
context: FC;
|
|
1092
|
+
}
|
|
1093
|
+
/**
|
|
1094
|
+
* options which override the options set in the LRUCache constructor
|
|
1095
|
+
* when calling {@link LRUCache#memo}.
|
|
1096
|
+
*
|
|
1097
|
+
* This is the union of {@link GetOptions} and {@link SetOptions}, plus
|
|
1098
|
+
* {@link MemoOptions.forceRefresh}, and
|
|
1099
|
+
* {@link MemoOptions.context}
|
|
1100
|
+
*
|
|
1101
|
+
* Any of these may be modified in the {@link OptionsBase.memoMethod}
|
|
1102
|
+
* function, but the {@link GetOptions} fields will of course have no
|
|
1103
|
+
* effect, as the {@link LRUCache#get} call already happened by the time
|
|
1104
|
+
* the memoMethod is called.
|
|
1105
|
+
*/
|
|
1106
|
+
interface MemoizerMemoOptions<K, V, FC = unknown> extends Pick<OptionsBase<K, V, FC>, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> {
|
|
1107
|
+
status?: Status<K, V, FC>;
|
|
1108
|
+
size?: Size;
|
|
1109
|
+
start?: Milliseconds;
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* Options that may be passed to the {@link LRUCache#has} method.
|
|
1113
|
+
*/
|
|
1114
|
+
interface HasOptions<K, V, FC> extends Pick<OptionsBase<K, V, FC>, 'updateAgeOnHas'> {
|
|
1115
|
+
status?: Status<K, V, FC>;
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
* Options that may be passed to the {@link LRUCache#get} method.
|
|
1119
|
+
*/
|
|
1120
|
+
interface GetOptions<K, V, FC> extends Pick<OptionsBase<K, V, FC>, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> {
|
|
1121
|
+
status?: Status<K, V, FC>;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* Options that may be passed to the {@link LRUCache#peek} method.
|
|
1125
|
+
*/
|
|
1126
|
+
interface PeekOptions<K, V, FC> extends Pick<OptionsBase<K, V, FC>, 'allowStale'> {
|
|
1127
|
+
status?: Status<K, V, FC>;
|
|
1128
|
+
}
|
|
1129
|
+
/**
|
|
1130
|
+
* Options that may be passed to the {@link LRUCache#set} method.
|
|
1131
|
+
*/
|
|
1132
|
+
interface SetOptions<K, V, FC> extends Pick<OptionsBase<K, V, FC>, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> {
|
|
1133
|
+
/**
|
|
1134
|
+
* If size tracking is enabled, then setting an explicit size
|
|
1135
|
+
* in the {@link LRUCache#set} call will prevent calling the
|
|
1136
|
+
* {@link OptionsBase.sizeCalculation} function.
|
|
1137
|
+
*/
|
|
1138
|
+
size?: Size;
|
|
1139
|
+
/**
|
|
1140
|
+
* If TTL tracking is enabled, then setting an explicit start
|
|
1141
|
+
* time in the {@link LRUCache#set} call will override the
|
|
1142
|
+
* default time from `performance.now()` or `Date.now()`.
|
|
1143
|
+
*
|
|
1144
|
+
* Note that it must be a valid value for whichever time-tracking
|
|
1145
|
+
* method is in use.
|
|
1146
|
+
*/
|
|
1147
|
+
start?: Milliseconds;
|
|
1148
|
+
status?: Status<K, V, FC>;
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* The type signature for the {@link OptionsBase.fetchMethod} option.
|
|
1152
|
+
*/
|
|
1153
|
+
type Fetcher<K, V, FC = unknown> = (key: K, staleValue: V | undefined, options: FetcherOptions<K, V, FC>) => Promise<V | undefined | void> | V | undefined | void;
|
|
1154
|
+
/**
|
|
1155
|
+
* the type signature for the {@link OptionsBase.memoMethod} option.
|
|
1156
|
+
*/
|
|
1157
|
+
type Memoizer<K, V, FC = unknown> = (key: K, staleValue: V | undefined, options: MemoizerOptions<K, V, FC>) => V;
|
|
1158
|
+
/**
|
|
1159
|
+
* Options which may be passed to the {@link LRUCache} constructor.
|
|
1160
|
+
*
|
|
1161
|
+
* Most of these may be overridden in the various options that use
|
|
1162
|
+
* them.
|
|
1163
|
+
*
|
|
1164
|
+
* Despite all being technically optional, the constructor requires that
|
|
1165
|
+
* a cache is at minimum limited by one or more of {@link OptionsBase.max},
|
|
1166
|
+
* {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.
|
|
1167
|
+
*
|
|
1168
|
+
* If {@link OptionsBase.ttl} is used alone, then it is strongly advised
|
|
1169
|
+
* (and in fact required by the type definitions here) that the cache
|
|
1170
|
+
* also set {@link OptionsBase.ttlAutopurge}, to prevent potentially
|
|
1171
|
+
* unbounded storage.
|
|
1172
|
+
*
|
|
1173
|
+
* All options are also available on the {@link LRUCache} instance, making
|
|
1174
|
+
* it safe to pass an LRUCache instance as the options argumemnt to
|
|
1175
|
+
* make another empty cache of the same type.
|
|
1176
|
+
*
|
|
1177
|
+
* Some options are marked as read-only, because changing them after
|
|
1178
|
+
* instantiation is not safe. Changing any of the other options will of
|
|
1179
|
+
* course only have an effect on subsequent method calls.
|
|
1180
|
+
*/
|
|
1181
|
+
interface OptionsBase<K, V, FC> {
|
|
1182
|
+
/**
|
|
1183
|
+
* The maximum number of items to store in the cache before evicting
|
|
1184
|
+
* old entries. This is read-only on the {@link LRUCache} instance,
|
|
1185
|
+
* and may not be overridden.
|
|
1186
|
+
*
|
|
1187
|
+
* If set, then storage space will be pre-allocated at construction
|
|
1188
|
+
* time, and the cache will perform significantly faster.
|
|
1189
|
+
*
|
|
1190
|
+
* Note that significantly fewer items may be stored, if
|
|
1191
|
+
* {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also
|
|
1192
|
+
* set.
|
|
1193
|
+
*
|
|
1194
|
+
* **It is strongly recommended to set a `max` to prevent unbounded growth
|
|
1195
|
+
* of the cache.**
|
|
1196
|
+
*/
|
|
1197
|
+
max?: Count;
|
|
1198
|
+
/**
|
|
1199
|
+
* Max time in milliseconds for items to live in cache before they are
|
|
1200
|
+
* considered stale. Note that stale items are NOT preemptively removed by
|
|
1201
|
+
* default, and MAY live in the cache, contributing to its LRU max, long
|
|
1202
|
+
* after they have expired, unless {@link OptionsBase.ttlAutopurge} is
|
|
1203
|
+
* set.
|
|
1204
|
+
*
|
|
1205
|
+
* If set to `0` (the default value), then that means "do not track
|
|
1206
|
+
* TTL", not "expire immediately".
|
|
1207
|
+
*
|
|
1208
|
+
* Also, as this cache is optimized for LRU/MRU operations, some of
|
|
1209
|
+
* the staleness/TTL checks will reduce performance, as they will incur
|
|
1210
|
+
* overhead by deleting items.
|
|
1211
|
+
*
|
|
1212
|
+
* This is not primarily a TTL cache, and does not make strong TTL
|
|
1213
|
+
* guarantees. There is no pre-emptive pruning of expired items, but you
|
|
1214
|
+
* _may_ set a TTL on the cache, and it will treat expired items as missing
|
|
1215
|
+
* when they are fetched, and delete them.
|
|
1216
|
+
*
|
|
1217
|
+
* Optional, but must be a non-negative integer in ms if specified.
|
|
1218
|
+
*
|
|
1219
|
+
* This may be overridden by passing an options object to `cache.set()`.
|
|
1220
|
+
*
|
|
1221
|
+
* At least one of `max`, `maxSize`, or `TTL` is required. This must be a
|
|
1222
|
+
* positive integer if set.
|
|
1223
|
+
*
|
|
1224
|
+
* Even if ttl tracking is enabled, **it is strongly recommended to set a
|
|
1225
|
+
* `max` to prevent unbounded growth of the cache.**
|
|
1226
|
+
*
|
|
1227
|
+
* If ttl tracking is enabled, and `max` and `maxSize` are not set,
|
|
1228
|
+
* and `ttlAutopurge` is not set, then a warning will be emitted
|
|
1229
|
+
* cautioning about the potential for unbounded memory consumption.
|
|
1230
|
+
* (The TypeScript definitions will also discourage this.)
|
|
1231
|
+
*/
|
|
1232
|
+
ttl?: Milliseconds;
|
|
1233
|
+
/**
|
|
1234
|
+
* Minimum amount of time in ms in which to check for staleness.
|
|
1235
|
+
* Defaults to 1, which means that the current time is checked
|
|
1236
|
+
* at most once per millisecond.
|
|
1237
|
+
*
|
|
1238
|
+
* Set to 0 to check the current time every time staleness is tested.
|
|
1239
|
+
* (This reduces performance, and is theoretically unnecessary.)
|
|
1240
|
+
*
|
|
1241
|
+
* Setting this to a higher value will improve performance somewhat
|
|
1242
|
+
* while using ttl tracking, albeit at the expense of keeping stale
|
|
1243
|
+
* items around a bit longer than their TTLs would indicate.
|
|
1244
|
+
*
|
|
1245
|
+
* @default 1
|
|
1246
|
+
*/
|
|
1247
|
+
ttlResolution?: Milliseconds;
|
|
1248
|
+
/**
|
|
1249
|
+
* Preemptively remove stale items from the cache.
|
|
1250
|
+
*
|
|
1251
|
+
* Note that this may *significantly* degrade performance, especially if
|
|
1252
|
+
* the cache is storing a large number of items. It is almost always best
|
|
1253
|
+
* to just leave the stale items in the cache, and let them fall out as new
|
|
1254
|
+
* items are added.
|
|
1255
|
+
*
|
|
1256
|
+
* Note that this means that {@link OptionsBase.allowStale} is a bit
|
|
1257
|
+
* pointless, as stale items will be deleted almost as soon as they
|
|
1258
|
+
* expire.
|
|
1259
|
+
*
|
|
1260
|
+
* Use with caution!
|
|
1261
|
+
*/
|
|
1262
|
+
ttlAutopurge?: boolean;
|
|
1263
|
+
/**
|
|
1264
|
+
* When using time-expiring entries with `ttl`, setting this to `true` will
|
|
1265
|
+
* make each item's age reset to 0 whenever it is retrieved from cache with
|
|
1266
|
+
* {@link LRUCache#get}, causing it to not expire. (It can still fall out
|
|
1267
|
+
* of cache based on recency of use, of course.)
|
|
1268
|
+
*
|
|
1269
|
+
* Has no effect if {@link OptionsBase.ttl} is not set.
|
|
1270
|
+
*
|
|
1271
|
+
* This may be overridden by passing an options object to `cache.get()`.
|
|
1272
|
+
*/
|
|
1273
|
+
updateAgeOnGet?: boolean;
|
|
1274
|
+
/**
|
|
1275
|
+
* When using time-expiring entries with `ttl`, setting this to `true` will
|
|
1276
|
+
* make each item's age reset to 0 whenever its presence in the cache is
|
|
1277
|
+
* checked with {@link LRUCache#has}, causing it to not expire. (It can
|
|
1278
|
+
* still fall out of cache based on recency of use, of course.)
|
|
1279
|
+
*
|
|
1280
|
+
* Has no effect if {@link OptionsBase.ttl} is not set.
|
|
1281
|
+
*/
|
|
1282
|
+
updateAgeOnHas?: boolean;
|
|
1283
|
+
/**
|
|
1284
|
+
* Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return
|
|
1285
|
+
* stale data, if available.
|
|
1286
|
+
*
|
|
1287
|
+
* By default, if you set `ttl`, stale items will only be deleted from the
|
|
1288
|
+
* cache when you `get(key)`. That is, it's not preemptively pruning items,
|
|
1289
|
+
* unless {@link OptionsBase.ttlAutopurge} is set.
|
|
1290
|
+
*
|
|
1291
|
+
* If you set `allowStale:true`, it'll return the stale value *as well as*
|
|
1292
|
+
* deleting it. If you don't set this, then it'll return `undefined` when
|
|
1293
|
+
* you try to get a stale entry.
|
|
1294
|
+
*
|
|
1295
|
+
* Note that when a stale entry is fetched, _even if it is returned due to
|
|
1296
|
+
* `allowStale` being set_, it is removed from the cache immediately. You
|
|
1297
|
+
* can suppress this behavior by setting
|
|
1298
|
+
* {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in
|
|
1299
|
+
* the options provided to {@link LRUCache#get}.
|
|
1300
|
+
*
|
|
1301
|
+
* This may be overridden by passing an options object to `cache.get()`.
|
|
1302
|
+
* The `cache.has()` method will always return `false` for stale items.
|
|
1303
|
+
*
|
|
1304
|
+
* Only relevant if a ttl is set.
|
|
1305
|
+
*/
|
|
1306
|
+
allowStale?: boolean;
|
|
1307
|
+
/**
|
|
1308
|
+
* Function that is called on items when they are dropped from the
|
|
1309
|
+
* cache, as `dispose(value, key, reason)`.
|
|
1310
|
+
*
|
|
1311
|
+
* This can be handy if you want to close file descriptors or do
|
|
1312
|
+
* other cleanup tasks when items are no longer stored in the cache.
|
|
1313
|
+
*
|
|
1314
|
+
* **NOTE**: It is called _before_ the item has been fully removed
|
|
1315
|
+
* from the cache, so if you want to put it right back in, you need
|
|
1316
|
+
* to wait until the next tick. If you try to add it back in during
|
|
1317
|
+
* the `dispose()` function call, it will break things in subtle and
|
|
1318
|
+
* weird ways.
|
|
1319
|
+
*
|
|
1320
|
+
* Unlike several other options, this may _not_ be overridden by
|
|
1321
|
+
* passing an option to `set()`, for performance reasons.
|
|
1322
|
+
*
|
|
1323
|
+
* The `reason` will be one of the following strings, corresponding
|
|
1324
|
+
* to the reason for the item's deletion:
|
|
1325
|
+
*
|
|
1326
|
+
* - `evict` Item was evicted to make space for a new addition
|
|
1327
|
+
* - `set` Item was overwritten by a new value
|
|
1328
|
+
* - `expire` Item expired its TTL
|
|
1329
|
+
* - `fetch` Item was deleted due to a failed or aborted fetch, or a
|
|
1330
|
+
* fetchMethod returning `undefined.
|
|
1331
|
+
* - `delete` Item was removed by explicit `cache.delete(key)`,
|
|
1332
|
+
* `cache.clear()`, or `cache.set(key, undefined)`.
|
|
1333
|
+
*/
|
|
1334
|
+
dispose?: Disposer<K, V>;
|
|
1335
|
+
/**
|
|
1336
|
+
* Function that is called when new items are inserted into the cache,
|
|
1337
|
+
* as `onInsert(value, key, reason)`.
|
|
1338
|
+
*
|
|
1339
|
+
* This can be useful if you need to perform actions when an item is
|
|
1340
|
+
* added, such as logging or tracking insertions.
|
|
1341
|
+
*
|
|
1342
|
+
* Unlike some other options, this may _not_ be overridden by passing
|
|
1343
|
+
* an option to `set()`, for performance and consistency reasons.
|
|
1344
|
+
*/
|
|
1345
|
+
onInsert?: Inserter<K, V>;
|
|
1346
|
+
/**
|
|
1347
|
+
* The same as {@link OptionsBase.dispose}, but called *after* the entry
|
|
1348
|
+
* is completely removed and the cache is once again in a clean state.
|
|
1349
|
+
*
|
|
1350
|
+
* It is safe to add an item right back into the cache at this point.
|
|
1351
|
+
* However, note that it is *very* easy to inadvertently create infinite
|
|
1352
|
+
* recursion this way.
|
|
1353
|
+
*/
|
|
1354
|
+
disposeAfter?: Disposer<K, V>;
|
|
1355
|
+
/**
|
|
1356
|
+
* Set to true to suppress calling the
|
|
1357
|
+
* {@link OptionsBase.dispose} function if the entry key is
|
|
1358
|
+
* still accessible within the cache.
|
|
1359
|
+
*
|
|
1360
|
+
* This may be overridden by passing an options object to
|
|
1361
|
+
* {@link LRUCache#set}.
|
|
1362
|
+
*
|
|
1363
|
+
* Only relevant if `dispose` or `disposeAfter` are set.
|
|
1364
|
+
*/
|
|
1365
|
+
noDisposeOnSet?: boolean;
|
|
1366
|
+
/**
|
|
1367
|
+
* Boolean flag to tell the cache to not update the TTL when setting a new
|
|
1368
|
+
* value for an existing key (ie, when updating a value rather than
|
|
1369
|
+
* inserting a new value). Note that the TTL value is _always_ set (if
|
|
1370
|
+
* provided) when adding a new entry into the cache.
|
|
1371
|
+
*
|
|
1372
|
+
* Has no effect if a {@link OptionsBase.ttl} is not set.
|
|
1373
|
+
*
|
|
1374
|
+
* May be passed as an option to {@link LRUCache#set}.
|
|
1375
|
+
*/
|
|
1376
|
+
noUpdateTTL?: boolean;
|
|
1377
|
+
/**
|
|
1378
|
+
* Set to a positive integer to track the sizes of items added to the
|
|
1379
|
+
* cache, and automatically evict items in order to stay below this size.
|
|
1380
|
+
* Note that this may result in fewer than `max` items being stored.
|
|
1381
|
+
*
|
|
1382
|
+
* Attempting to add an item to the cache whose calculated size is greater
|
|
1383
|
+
* that this amount will be a no-op. The item will not be cached, and no
|
|
1384
|
+
* other items will be evicted.
|
|
1385
|
+
*
|
|
1386
|
+
* Optional, must be a positive integer if provided.
|
|
1387
|
+
*
|
|
1388
|
+
* Sets `maxEntrySize` to the same value, unless a different value is
|
|
1389
|
+
* provided for `maxEntrySize`.
|
|
1390
|
+
*
|
|
1391
|
+
* At least one of `max`, `maxSize`, or `TTL` is required. This must be a
|
|
1392
|
+
* positive integer if set.
|
|
1393
|
+
*
|
|
1394
|
+
* Even if size tracking is enabled, **it is strongly recommended to set a
|
|
1395
|
+
* `max` to prevent unbounded growth of the cache.**
|
|
1396
|
+
*
|
|
1397
|
+
* Note also that size tracking can negatively impact performance,
|
|
1398
|
+
* though for most cases, only minimally.
|
|
1399
|
+
*/
|
|
1400
|
+
maxSize?: Size;
|
|
1401
|
+
/**
|
|
1402
|
+
* The effective size for background fetch promises.
|
|
1403
|
+
*
|
|
1404
|
+
* This has no effect unless `maxSize` and `sizeCalculation` are used,
|
|
1405
|
+
* and a {@link LRUCache.OptionsBase.fetchMethod} is provided to
|
|
1406
|
+
* support {@link LRUCache#fetch}.
|
|
1407
|
+
*
|
|
1408
|
+
* If a stale value is present in the cache, then the effective size of
|
|
1409
|
+
* the background fetch is the size of the stale item it will eventually
|
|
1410
|
+
* replace. If not, then this value is used as its effective size.
|
|
1411
|
+
*
|
|
1412
|
+
* @default 1
|
|
1413
|
+
*/
|
|
1414
|
+
backgroundFetchSize?: number;
|
|
1415
|
+
/**
|
|
1416
|
+
* The maximum allowed size for any single item in the cache.
|
|
1417
|
+
*
|
|
1418
|
+
* If a larger item is passed to {@link LRUCache#set} or returned by a
|
|
1419
|
+
* {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then
|
|
1420
|
+
* it will not be stored in the cache.
|
|
1421
|
+
*
|
|
1422
|
+
* Attempting to add an item whose calculated size is greater than
|
|
1423
|
+
* this amount will not cache the item or evict any old items, but
|
|
1424
|
+
* WILL delete an existing value if one is already present.
|
|
1425
|
+
*
|
|
1426
|
+
* Optional, must be a positive integer if provided. Defaults to
|
|
1427
|
+
* the value of `maxSize` if provided.
|
|
1428
|
+
*/
|
|
1429
|
+
maxEntrySize?: Size;
|
|
1430
|
+
/**
|
|
1431
|
+
* A function that returns a number indicating the item's size.
|
|
1432
|
+
*
|
|
1433
|
+
* Requires {@link OptionsBase.maxSize} to be set.
|
|
1434
|
+
*
|
|
1435
|
+
* If not provided, and {@link OptionsBase.maxSize} or
|
|
1436
|
+
* {@link OptionsBase.maxEntrySize} are set, then all
|
|
1437
|
+
* {@link LRUCache#set} calls **must** provide an explicit
|
|
1438
|
+
* {@link SetOptions.size} or sizeCalculation param.
|
|
1439
|
+
*/
|
|
1440
|
+
sizeCalculation?: SizeCalculator<K, V>;
|
|
1441
|
+
/**
|
|
1442
|
+
* Method that provides the implementation for {@link LRUCache#fetch}
|
|
1443
|
+
*
|
|
1444
|
+
* ```ts
|
|
1445
|
+
* fetchMethod(key, staleValue, { signal, options, context })
|
|
1446
|
+
* ```
|
|
1447
|
+
*
|
|
1448
|
+
* If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent
|
|
1449
|
+
* to `Promise.resolve(cache.get(key))`.
|
|
1450
|
+
*
|
|
1451
|
+
* If at any time, `signal.aborted` is set to `true`, or if the
|
|
1452
|
+
* `signal.onabort` method is called, or if it emits an `'abort'` event
|
|
1453
|
+
* which you can listen to with `addEventListener`, then that means that
|
|
1454
|
+
* the fetch should be abandoned. This may be passed along to async
|
|
1455
|
+
* functions aware of AbortController/AbortSignal behavior.
|
|
1456
|
+
*
|
|
1457
|
+
* The `fetchMethod` should **only** return `undefined` or a Promise
|
|
1458
|
+
* resolving to `undefined` if the AbortController signaled an `abort`
|
|
1459
|
+
* event. In all other cases, it should return or resolve to a value
|
|
1460
|
+
* suitable for adding to the cache.
|
|
1461
|
+
*
|
|
1462
|
+
* The `options` object is a union of the options that may be provided to
|
|
1463
|
+
* `set()` and `get()`. If they are modified, then that will result in
|
|
1464
|
+
* modifying the settings to `cache.set()` when the value is resolved, and
|
|
1465
|
+
* in the case of
|
|
1466
|
+
* {@link OptionsBase.noDeleteOnFetchRejection} and
|
|
1467
|
+
* {@link OptionsBase.allowStaleOnFetchRejection}, the handling of
|
|
1468
|
+
* `fetchMethod` failures.
|
|
1469
|
+
*
|
|
1470
|
+
* For example, a DNS cache may update the TTL based on the value returned
|
|
1471
|
+
* from a remote DNS server by changing `options.ttl` in the `fetchMethod`.
|
|
1472
|
+
*/
|
|
1473
|
+
fetchMethod?: Fetcher<K, V, FC>;
|
|
1474
|
+
/**
|
|
1475
|
+
* Method that provides the implementation for {@link LRUCache#memo}
|
|
1476
|
+
*/
|
|
1477
|
+
memoMethod?: Memoizer<K, V, FC>;
|
|
1478
|
+
/**
|
|
1479
|
+
* Set to true to suppress the deletion of stale data when a
|
|
1480
|
+
* {@link OptionsBase.fetchMethod} returns a rejected promise.
|
|
1481
|
+
*/
|
|
1482
|
+
noDeleteOnFetchRejection?: boolean;
|
|
1483
|
+
/**
|
|
1484
|
+
* Do not delete stale items when they are retrieved with
|
|
1485
|
+
* {@link LRUCache#get}.
|
|
1486
|
+
*
|
|
1487
|
+
* Note that the `get` return value will still be `undefined`
|
|
1488
|
+
* unless {@link OptionsBase.allowStale} is true.
|
|
1489
|
+
*
|
|
1490
|
+
* When using time-expiring entries with `ttl`, by default stale
|
|
1491
|
+
* items will be removed from the cache when the key is accessed
|
|
1492
|
+
* with `cache.get()`.
|
|
1493
|
+
*
|
|
1494
|
+
* Setting this option will cause stale items to remain in the cache, until
|
|
1495
|
+
* they are explicitly deleted with `cache.delete(key)`, or retrieved with
|
|
1496
|
+
* `noDeleteOnStaleGet` set to `false`.
|
|
1497
|
+
*
|
|
1498
|
+
* This may be overridden by passing an options object to `cache.get()`.
|
|
1499
|
+
*
|
|
1500
|
+
* Only relevant if a ttl is used.
|
|
1501
|
+
*/
|
|
1502
|
+
noDeleteOnStaleGet?: boolean;
|
|
1503
|
+
/**
|
|
1504
|
+
* Set to true to allow returning stale data when a
|
|
1505
|
+
* {@link OptionsBase.fetchMethod} throws an error or returns a rejected
|
|
1506
|
+
* promise.
|
|
1507
|
+
*
|
|
1508
|
+
* This differs from using {@link OptionsBase.allowStale} in that stale
|
|
1509
|
+
* data will ONLY be returned in the case that the {@link LRUCache#fetch}
|
|
1510
|
+
* fails, not any other times.
|
|
1511
|
+
*
|
|
1512
|
+
* If a `fetchMethod` fails, and there is no stale value available, the
|
|
1513
|
+
* `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are
|
|
1514
|
+
* suppressed.
|
|
1515
|
+
*
|
|
1516
|
+
* Implies `noDeleteOnFetchRejection`.
|
|
1517
|
+
*
|
|
1518
|
+
* This may be set in calls to `fetch()`, or defaulted on the constructor,
|
|
1519
|
+
* or overridden by modifying the options object in the `fetchMethod`.
|
|
1520
|
+
*/
|
|
1521
|
+
allowStaleOnFetchRejection?: boolean;
|
|
1522
|
+
/**
|
|
1523
|
+
* Set to true to return a stale value from the cache when the
|
|
1524
|
+
* `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches
|
|
1525
|
+
* an `'abort'` event, whether user-triggered, or due to internal cache
|
|
1526
|
+
* behavior.
|
|
1527
|
+
*
|
|
1528
|
+
* Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying
|
|
1529
|
+
* {@link OptionsBase.fetchMethod} will still be considered canceled, and
|
|
1530
|
+
* any value it returns will be ignored and not cached.
|
|
1531
|
+
*
|
|
1532
|
+
* Caveat: since fetches are aborted when a new value is explicitly
|
|
1533
|
+
* set in the cache, this can lead to fetch returning a stale value,
|
|
1534
|
+
* since that was the fallback value _at the moment the `fetch()` was
|
|
1535
|
+
* initiated_, even though the new updated value is now present in
|
|
1536
|
+
* the cache.
|
|
1537
|
+
*
|
|
1538
|
+
* For example:
|
|
1539
|
+
*
|
|
1540
|
+
* ```ts
|
|
1541
|
+
* const cache = new LRUCache<string, any>({
|
|
1542
|
+
* ttl: 100,
|
|
1543
|
+
* fetchMethod: async (url, oldValue, { signal }) => {
|
|
1544
|
+
* const res = await fetch(url, { signal })
|
|
1545
|
+
* return await res.json()
|
|
1546
|
+
* }
|
|
1547
|
+
* })
|
|
1548
|
+
* cache.set('https://example.com/', { some: 'data' })
|
|
1549
|
+
* // 100ms go by...
|
|
1550
|
+
* const result = cache.fetch('https://example.com/')
|
|
1551
|
+
* cache.set('https://example.com/', { other: 'thing' })
|
|
1552
|
+
* console.log(await result) // { some: 'data' }
|
|
1553
|
+
* console.log(cache.get('https://example.com/')) // { other: 'thing' }
|
|
1554
|
+
* ```
|
|
1555
|
+
*/
|
|
1556
|
+
allowStaleOnFetchAbort?: boolean;
|
|
1557
|
+
/**
|
|
1558
|
+
* Set to true to ignore the `abort` event emitted by the `AbortSignal`
|
|
1559
|
+
* object passed to {@link OptionsBase.fetchMethod}, and still cache the
|
|
1560
|
+
* resulting resolution value, as long as it is not `undefined`.
|
|
1561
|
+
*
|
|
1562
|
+
* When used on its own, this means aborted {@link LRUCache#fetch} calls
|
|
1563
|
+
* are not immediately resolved or rejected when they are aborted, and
|
|
1564
|
+
* instead take the full time to await.
|
|
1565
|
+
*
|
|
1566
|
+
* When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted
|
|
1567
|
+
* {@link LRUCache#fetch} calls will resolve immediately to their stale
|
|
1568
|
+
* cached value or `undefined`, and will continue to process and eventually
|
|
1569
|
+
* update the cache when they resolve, as long as the resulting value is
|
|
1570
|
+
* not `undefined`, thus supporting a "return stale on timeout while
|
|
1571
|
+
* refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal.
|
|
1572
|
+
*
|
|
1573
|
+
* For example:
|
|
1574
|
+
*
|
|
1575
|
+
* ```ts
|
|
1576
|
+
* const c = new LRUCache({
|
|
1577
|
+
* ttl: 100,
|
|
1578
|
+
* ignoreFetchAbort: true,
|
|
1579
|
+
* allowStaleOnFetchAbort: true,
|
|
1580
|
+
* fetchMethod: async (key, oldValue, { signal }) => {
|
|
1581
|
+
* // note: do NOT pass the signal to fetch()!
|
|
1582
|
+
* // let's say this fetch can take a long time.
|
|
1583
|
+
* const res = await fetch(`https://slow-backend-server/${key}`)
|
|
1584
|
+
* return await res.json()
|
|
1585
|
+
* },
|
|
1586
|
+
* })
|
|
1587
|
+
*
|
|
1588
|
+
* // this will return the stale value after 100ms, while still
|
|
1589
|
+
* // updating in the background for next time.
|
|
1590
|
+
* const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })
|
|
1591
|
+
* ```
|
|
1592
|
+
*
|
|
1593
|
+
* **Note**: regardless of this setting, an `abort` event _is still
|
|
1594
|
+
* emitted on the `AbortSignal` object_, so may result in invalid results
|
|
1595
|
+
* when passed to other underlying APIs that use AbortSignals.
|
|
1596
|
+
*
|
|
1597
|
+
* This may be overridden in the {@link OptionsBase.fetchMethod} or the
|
|
1598
|
+
* call to {@link LRUCache#fetch}.
|
|
1599
|
+
*/
|
|
1600
|
+
ignoreFetchAbort?: boolean;
|
|
1601
|
+
/**
|
|
1602
|
+
* In some cases, you may want to swap out the performance/Date object
|
|
1603
|
+
* used for TTL tracking. This should almost certainly NOT be done in
|
|
1604
|
+
* production environments!
|
|
1605
|
+
*
|
|
1606
|
+
* This value defaults to `global.performance` if it has a `now()` method,
|
|
1607
|
+
* or the `global.Date` object otherwise.
|
|
1608
|
+
*/
|
|
1609
|
+
perf?: Perf;
|
|
1610
|
+
}
|
|
1611
|
+
interface OptionsMaxLimit<K, V, FC> extends OptionsBase<K, V, FC> {
|
|
1612
|
+
max: Count;
|
|
1613
|
+
}
|
|
1614
|
+
interface OptionsTTLLimit<K, V, FC> extends OptionsBase<K, V, FC> {
|
|
1615
|
+
ttl: Milliseconds;
|
|
1616
|
+
ttlAutopurge: boolean;
|
|
1617
|
+
}
|
|
1618
|
+
interface OptionsSizeLimit<K, V, FC> extends OptionsBase<K, V, FC> {
|
|
1619
|
+
maxSize: Size;
|
|
1620
|
+
}
|
|
1621
|
+
/**
|
|
1622
|
+
* The valid safe options for the {@link LRUCache} constructor
|
|
1623
|
+
*/
|
|
1624
|
+
type Options<K, V, FC> = OptionsMaxLimit<K, V, FC> | OptionsSizeLimit<K, V, FC> | OptionsTTLLimit<K, V, FC>;
|
|
1625
|
+
/**
|
|
1626
|
+
* Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},
|
|
1627
|
+
* and returned by {@link LRUCache#info}.
|
|
1628
|
+
*/
|
|
1629
|
+
interface Entry<V> {
|
|
1630
|
+
value: V;
|
|
1631
|
+
ttl?: Milliseconds;
|
|
1632
|
+
size?: Size;
|
|
1633
|
+
start?: Milliseconds;
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
/**
|
|
1637
|
+
* Default export, the thing you're using this module to get.
|
|
1638
|
+
*
|
|
1639
|
+
* The `K` and `V` types define the key and value types, respectively. The
|
|
1640
|
+
* optional `FC` type defines the type of the `context` object passed to
|
|
1641
|
+
* `cache.fetch()` and `cache.memo()`.
|
|
1642
|
+
*
|
|
1643
|
+
* Keys and values **must not** be `null` or `undefined`.
|
|
1644
|
+
*
|
|
1645
|
+
* All properties from the options object (with the exception of `max`,
|
|
1646
|
+
* `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are
|
|
1647
|
+
* added as normal public members. (The listed options are read-only getters.)
|
|
1648
|
+
*
|
|
1649
|
+
* Changing any of these will alter the defaults for subsequent method calls.
|
|
1650
|
+
*/
|
|
1651
|
+
declare class LRUCache<K extends {}, V extends {}, FC = unknown> {
|
|
1652
|
+
#private;
|
|
1653
|
+
/**
|
|
1654
|
+
* {@link LRUCache.OptionsBase.perf}
|
|
1655
|
+
*/
|
|
1656
|
+
get perf(): Perf;
|
|
1657
|
+
/**
|
|
1658
|
+
* {@link LRUCache.OptionsBase.ttl}
|
|
1659
|
+
*/
|
|
1660
|
+
ttl: LRUCache.Milliseconds;
|
|
1661
|
+
/**
|
|
1662
|
+
* {@link LRUCache.OptionsBase.ttlResolution}
|
|
1663
|
+
*/
|
|
1664
|
+
ttlResolution: LRUCache.Milliseconds;
|
|
1665
|
+
/**
|
|
1666
|
+
* {@link LRUCache.OptionsBase.ttlAutopurge}
|
|
1667
|
+
*/
|
|
1668
|
+
ttlAutopurge: boolean;
|
|
1669
|
+
/**
|
|
1670
|
+
* {@link LRUCache.OptionsBase.updateAgeOnGet}
|
|
1671
|
+
*/
|
|
1672
|
+
updateAgeOnGet: boolean;
|
|
1673
|
+
/**
|
|
1674
|
+
* {@link LRUCache.OptionsBase.updateAgeOnHas}
|
|
1675
|
+
*/
|
|
1676
|
+
updateAgeOnHas: boolean;
|
|
1677
|
+
/**
|
|
1678
|
+
* {@link LRUCache.OptionsBase.allowStale}
|
|
1679
|
+
*/
|
|
1680
|
+
allowStale: boolean;
|
|
1681
|
+
/**
|
|
1682
|
+
* {@link LRUCache.OptionsBase.noDisposeOnSet}
|
|
1683
|
+
*/
|
|
1684
|
+
noDisposeOnSet: boolean;
|
|
1685
|
+
/**
|
|
1686
|
+
* {@link LRUCache.OptionsBase.noUpdateTTL}
|
|
1687
|
+
*/
|
|
1688
|
+
noUpdateTTL: boolean;
|
|
1689
|
+
/**
|
|
1690
|
+
* {@link LRUCache.OptionsBase.maxEntrySize}
|
|
1691
|
+
*/
|
|
1692
|
+
maxEntrySize: LRUCache.Size;
|
|
1693
|
+
/**
|
|
1694
|
+
* {@link LRUCache.OptionsBase.sizeCalculation}
|
|
1695
|
+
*/
|
|
1696
|
+
sizeCalculation?: LRUCache.SizeCalculator<K, V>;
|
|
1697
|
+
/**
|
|
1698
|
+
* {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
|
|
1699
|
+
*/
|
|
1700
|
+
noDeleteOnFetchRejection: boolean;
|
|
1701
|
+
/**
|
|
1702
|
+
* {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
|
|
1703
|
+
*/
|
|
1704
|
+
noDeleteOnStaleGet: boolean;
|
|
1705
|
+
/**
|
|
1706
|
+
* {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
|
|
1707
|
+
*/
|
|
1708
|
+
allowStaleOnFetchAbort: boolean;
|
|
1709
|
+
/**
|
|
1710
|
+
* {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
|
|
1711
|
+
*/
|
|
1712
|
+
allowStaleOnFetchRejection: boolean;
|
|
1713
|
+
/**
|
|
1714
|
+
* {@link LRUCache.OptionsBase.ignoreFetchAbort}
|
|
1715
|
+
*/
|
|
1716
|
+
ignoreFetchAbort: boolean;
|
|
1717
|
+
/** {@link LRUCache.OptionsBase.backgroundFetchSize} */
|
|
1718
|
+
backgroundFetchSize: number;
|
|
1719
|
+
/**
|
|
1720
|
+
* Do not call this method unless you need to inspect the
|
|
1721
|
+
* inner workings of the cache. If anything returned by this
|
|
1722
|
+
* object is modified in any way, strange breakage may occur.
|
|
1723
|
+
*
|
|
1724
|
+
* These fields are private for a reason!
|
|
1725
|
+
*
|
|
1726
|
+
* @internal
|
|
1727
|
+
*/
|
|
1728
|
+
static unsafeExposeInternals<K extends {}, V extends {}, FC extends unknown = unknown>(c: LRUCache<K, V, FC>): {
|
|
1729
|
+
starts: ZeroArray | undefined;
|
|
1730
|
+
ttls: ZeroArray | undefined;
|
|
1731
|
+
autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined;
|
|
1732
|
+
sizes: ZeroArray | undefined;
|
|
1733
|
+
keyMap: Map<K, number>;
|
|
1734
|
+
keyList: (K | undefined)[];
|
|
1735
|
+
valList: (V | BackgroundFetch<V> | undefined)[];
|
|
1736
|
+
next: NumberArray;
|
|
1737
|
+
prev: NumberArray;
|
|
1738
|
+
readonly head: Index;
|
|
1739
|
+
readonly tail: Index;
|
|
1740
|
+
free: StackLike;
|
|
1741
|
+
isBackgroundFetch: (p: unknown) => p is BackgroundFetch<V>;
|
|
1742
|
+
backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions<K, V, FC>, context: unknown) => BackgroundFetch<V>;
|
|
1743
|
+
moveToTail: (index: number) => void;
|
|
1744
|
+
indexes: (options?: {
|
|
1745
|
+
allowStale: boolean;
|
|
1746
|
+
}) => Generator<Index, void, unknown>;
|
|
1747
|
+
rindexes: (options?: {
|
|
1748
|
+
allowStale: boolean;
|
|
1749
|
+
}) => Generator<Index, void, unknown>;
|
|
1750
|
+
isStale: (index: number | undefined) => boolean;
|
|
1751
|
+
};
|
|
1752
|
+
/**
|
|
1753
|
+
* {@link LRUCache.OptionsBase.max} (read-only)
|
|
1754
|
+
*/
|
|
1755
|
+
get max(): LRUCache.Count;
|
|
1756
|
+
/**
|
|
1757
|
+
* {@link LRUCache.OptionsBase.maxSize} (read-only)
|
|
1758
|
+
*/
|
|
1759
|
+
get maxSize(): LRUCache.Count;
|
|
1760
|
+
/**
|
|
1761
|
+
* The total computed size of items in the cache (read-only)
|
|
1762
|
+
*/
|
|
1763
|
+
get calculatedSize(): LRUCache.Size;
|
|
1764
|
+
/**
|
|
1765
|
+
* The number of items stored in the cache (read-only)
|
|
1766
|
+
*/
|
|
1767
|
+
get size(): LRUCache.Count;
|
|
1768
|
+
/**
|
|
1769
|
+
* {@link LRUCache.OptionsBase.fetchMethod} (read-only)
|
|
1770
|
+
*/
|
|
1771
|
+
get fetchMethod(): LRUCache.Fetcher<K, V, FC> | undefined;
|
|
1772
|
+
get memoMethod(): LRUCache.Memoizer<K, V, FC> | undefined;
|
|
1773
|
+
/**
|
|
1774
|
+
* {@link LRUCache.OptionsBase.dispose} (read-only)
|
|
1775
|
+
*/
|
|
1776
|
+
get dispose(): LRUCache.Disposer<K, V> | undefined;
|
|
1777
|
+
/**
|
|
1778
|
+
* {@link LRUCache.OptionsBase.onInsert} (read-only)
|
|
1779
|
+
*/
|
|
1780
|
+
get onInsert(): LRUCache.Inserter<K, V> | undefined;
|
|
1781
|
+
/**
|
|
1782
|
+
* {@link LRUCache.OptionsBase.disposeAfter} (read-only)
|
|
1783
|
+
*/
|
|
1784
|
+
get disposeAfter(): LRUCache.Disposer<K, V> | undefined;
|
|
1785
|
+
constructor(options: LRUCache.Options<K, V, FC> | LRUCache<K, V, FC>);
|
|
1786
|
+
/**
|
|
1787
|
+
* Return the number of ms left in the item's TTL. If item is not in cache,
|
|
1788
|
+
* returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
|
|
1789
|
+
*/
|
|
1790
|
+
getRemainingTTL(key: K): number;
|
|
1791
|
+
/**
|
|
1792
|
+
* Return a generator yielding `[key, value]` pairs,
|
|
1793
|
+
* in order from most recently used to least recently used.
|
|
1794
|
+
*/
|
|
1795
|
+
entries(): Generator<[K, V], void, unknown>;
|
|
1796
|
+
/**
|
|
1797
|
+
* Inverse order version of {@link LRUCache.entries}
|
|
1798
|
+
*
|
|
1799
|
+
* Return a generator yielding `[key, value]` pairs,
|
|
1800
|
+
* in order from least recently used to most recently used.
|
|
1801
|
+
*/
|
|
1802
|
+
rentries(): Generator<(K | V)[], void, unknown>;
|
|
1803
|
+
/**
|
|
1804
|
+
* Return a generator yielding the keys in the cache,
|
|
1805
|
+
* in order from most recently used to least recently used.
|
|
1806
|
+
*/
|
|
1807
|
+
keys(): Generator<K, void, unknown>;
|
|
1808
|
+
/**
|
|
1809
|
+
* Inverse order version of {@link LRUCache.keys}
|
|
1810
|
+
*
|
|
1811
|
+
* Return a generator yielding the keys in the cache,
|
|
1812
|
+
* in order from least recently used to most recently used.
|
|
1813
|
+
*/
|
|
1814
|
+
rkeys(): Generator<K, void, unknown>;
|
|
1815
|
+
/**
|
|
1816
|
+
* Return a generator yielding the values in the cache,
|
|
1817
|
+
* in order from most recently used to least recently used.
|
|
1818
|
+
*/
|
|
1819
|
+
values(): Generator<V, void, unknown>;
|
|
1820
|
+
/**
|
|
1821
|
+
* Inverse order version of {@link LRUCache.values}
|
|
1822
|
+
*
|
|
1823
|
+
* Return a generator yielding the values in the cache,
|
|
1824
|
+
* in order from least recently used to most recently used.
|
|
1825
|
+
*/
|
|
1826
|
+
rvalues(): Generator<V | undefined, void, unknown>;
|
|
1827
|
+
/**
|
|
1828
|
+
* Iterating over the cache itself yields the same results as
|
|
1829
|
+
* {@link LRUCache.entries}
|
|
1830
|
+
*/
|
|
1831
|
+
[Symbol.iterator](): Generator<[K, V], void, unknown>;
|
|
1832
|
+
/**
|
|
1833
|
+
* A String value that is used in the creation of the default string
|
|
1834
|
+
* description of an object. Called by the built-in method
|
|
1835
|
+
* `Object.prototype.toString`.
|
|
1836
|
+
*/
|
|
1837
|
+
[Symbol.toStringTag]: string;
|
|
1838
|
+
/**
|
|
1839
|
+
* Find a value for which the supplied fn method returns a truthy value,
|
|
1840
|
+
* similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
|
|
1841
|
+
*/
|
|
1842
|
+
find(fn: (v: V, k: K, self: LRUCache<K, V, FC>) => boolean, getOptions?: LRUCache.GetOptions<K, V, FC>): V | undefined;
|
|
1843
|
+
/**
|
|
1844
|
+
* Call the supplied function on each item in the cache, in order from most
|
|
1845
|
+
* recently used to least recently used.
|
|
1846
|
+
*
|
|
1847
|
+
* `fn` is called as `fn(value, key, cache)`.
|
|
1848
|
+
*
|
|
1849
|
+
* If `thisp` is provided, function will be called in the `this`-context of
|
|
1850
|
+
* the provided object, or the cache if no `thisp` object is provided.
|
|
1851
|
+
*
|
|
1852
|
+
* Does not update age or recenty of use, or iterate over stale values.
|
|
1853
|
+
*/
|
|
1854
|
+
forEach(fn: (v: V, k: K, self: LRUCache<K, V, FC>) => unknown, thisp?: unknown): void;
|
|
1855
|
+
/**
|
|
1856
|
+
* The same as {@link LRUCache.forEach} but items are iterated over in
|
|
1857
|
+
* reverse order. (ie, less recently used items are iterated over first.)
|
|
1858
|
+
*/
|
|
1859
|
+
rforEach(fn: (v: V, k: K, self: LRUCache<K, V, FC>) => unknown, thisp?: unknown): void;
|
|
1860
|
+
/**
|
|
1861
|
+
* Delete any stale entries. Returns true if anything was removed,
|
|
1862
|
+
* false otherwise.
|
|
1863
|
+
*/
|
|
1864
|
+
purgeStale(): boolean;
|
|
1865
|
+
/**
|
|
1866
|
+
* Get the extended info about a given entry, to get its value, size, and
|
|
1867
|
+
* TTL info simultaneously. Returns `undefined` if the key is not present.
|
|
1868
|
+
*
|
|
1869
|
+
* Unlike {@link LRUCache#dump}, which is designed to be portable and survive
|
|
1870
|
+
* serialization, the `start` value is always the current timestamp, and the
|
|
1871
|
+
* `ttl` is a calculated remaining time to live (negative if expired).
|
|
1872
|
+
*
|
|
1873
|
+
* Always returns stale values, if their info is found in the cache, so be
|
|
1874
|
+
* sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
|
|
1875
|
+
* if relevant.
|
|
1876
|
+
*/
|
|
1877
|
+
info(key: K): LRUCache.Entry<V> | undefined;
|
|
1878
|
+
/**
|
|
1879
|
+
* Return an array of [key, {@link LRUCache.Entry}] tuples which can be
|
|
1880
|
+
* passed to {@link LRUCache#load}.
|
|
1881
|
+
*
|
|
1882
|
+
* The `start` fields are calculated relative to a portable `Date.now()`
|
|
1883
|
+
* timestamp, even if `performance.now()` is available.
|
|
1884
|
+
*
|
|
1885
|
+
* Stale entries are always included in the `dump`, even if
|
|
1886
|
+
* {@link LRUCache.OptionsBase.allowStale} is false.
|
|
1887
|
+
*
|
|
1888
|
+
* Note: this returns an actual array, not a generator, so it can be more
|
|
1889
|
+
* easily passed around.
|
|
1890
|
+
*/
|
|
1891
|
+
dump(): [K, LRUCache.Entry<V>][];
|
|
1892
|
+
/**
|
|
1893
|
+
* Reset the cache and load in the items in entries in the order listed.
|
|
1894
|
+
*
|
|
1895
|
+
* The shape of the resulting cache may be different if the same options are
|
|
1896
|
+
* not used in both caches.
|
|
1897
|
+
*
|
|
1898
|
+
* The `start` fields are assumed to be calculated relative to a portable
|
|
1899
|
+
* `Date.now()` timestamp, even if `performance.now()` is available.
|
|
1900
|
+
*/
|
|
1901
|
+
load(arr: [K, LRUCache.Entry<V>][]): void;
|
|
1902
|
+
/**
|
|
1903
|
+
* Add a value to the cache.
|
|
1904
|
+
*
|
|
1905
|
+
* Note: if `undefined` is specified as a value, this is an alias for
|
|
1906
|
+
* {@link LRUCache#delete}
|
|
1907
|
+
*
|
|
1908
|
+
* Fields on the {@link LRUCache.SetOptions} options param will override
|
|
1909
|
+
* their corresponding values in the constructor options for the scope
|
|
1910
|
+
* of this single `set()` operation.
|
|
1911
|
+
*
|
|
1912
|
+
* If `start` is provided, then that will set the effective start
|
|
1913
|
+
* time for the TTL calculation. Note that this must be a previous
|
|
1914
|
+
* value of `performance.now()` if supported, or a previous value of
|
|
1915
|
+
* `Date.now()` if not.
|
|
1916
|
+
*
|
|
1917
|
+
* Options object may also include `size`, which will prevent
|
|
1918
|
+
* calling the `sizeCalculation` function and just use the specified
|
|
1919
|
+
* number if it is a positive integer, and `noDisposeOnSet` which
|
|
1920
|
+
* will prevent calling a `dispose` function in the case of
|
|
1921
|
+
* overwrites.
|
|
1922
|
+
*
|
|
1923
|
+
* If the `size` (or return value of `sizeCalculation`) for a given
|
|
1924
|
+
* entry is greater than `maxEntrySize`, then the item will not be
|
|
1925
|
+
* added to the cache.
|
|
1926
|
+
*
|
|
1927
|
+
* Will update the recency of the entry.
|
|
1928
|
+
*
|
|
1929
|
+
* If the value is `undefined`, then this is an alias for
|
|
1930
|
+
* `cache.delete(key)`. `undefined` is never stored in the cache.
|
|
1931
|
+
*/
|
|
1932
|
+
set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions<K, V, FC>): this;
|
|
1933
|
+
/**
|
|
1934
|
+
* Evict the least recently used item, returning its value or
|
|
1935
|
+
* `undefined` if cache is empty.
|
|
1936
|
+
*/
|
|
1937
|
+
pop(): V | undefined;
|
|
1938
|
+
/**
|
|
1939
|
+
* Check if a key is in the cache, without updating the recency of use.
|
|
1940
|
+
* Will return false if the item is stale, even though it is technically
|
|
1941
|
+
* in the cache.
|
|
1942
|
+
*
|
|
1943
|
+
* Check if a key is in the cache, without updating the recency of
|
|
1944
|
+
* use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
|
|
1945
|
+
* to `true` in either the options or the constructor.
|
|
1946
|
+
*
|
|
1947
|
+
* Will return `false` if the item is stale, even though it is technically in
|
|
1948
|
+
* the cache. The difference can be determined (if it matters) by using a
|
|
1949
|
+
* `status` argument, and inspecting the `has` field.
|
|
1950
|
+
*
|
|
1951
|
+
* Will not update item age unless
|
|
1952
|
+
* {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
|
|
1953
|
+
*/
|
|
1954
|
+
has(k: K, hasOptions?: LRUCache.HasOptions<K, V, FC>): boolean;
|
|
1955
|
+
/**
|
|
1956
|
+
* Like {@link LRUCache#get} but doesn't update recency or delete stale
|
|
1957
|
+
* items.
|
|
1958
|
+
*
|
|
1959
|
+
* Returns `undefined` if the item is stale, unless
|
|
1960
|
+
* {@link LRUCache.OptionsBase.allowStale} is set.
|
|
1961
|
+
*/
|
|
1962
|
+
peek(k: K, peekOptions?: LRUCache.PeekOptions<K, V, FC>): V | undefined;
|
|
1963
|
+
/**
|
|
1964
|
+
* Make an asynchronous cached fetch using the
|
|
1965
|
+
* {@link LRUCache.OptionsBase.fetchMethod} function.
|
|
1966
|
+
*
|
|
1967
|
+
* If the value is in the cache and not stale, then the returned
|
|
1968
|
+
* Promise resolves to the value.
|
|
1969
|
+
*
|
|
1970
|
+
* If not in the cache, or beyond its TTL staleness, then
|
|
1971
|
+
* `fetchMethod(key, staleValue, { options, signal, context })` is
|
|
1972
|
+
* called, and the value returned will be added to the cache once
|
|
1973
|
+
* resolved.
|
|
1974
|
+
*
|
|
1975
|
+
* If called with `allowStale`, and an asynchronous fetch is
|
|
1976
|
+
* currently in progress to reload a stale value, then the former
|
|
1977
|
+
* stale value will be returned.
|
|
1978
|
+
*
|
|
1979
|
+
* If called with `forceRefresh`, then the cached item will be
|
|
1980
|
+
* re-fetched, even if it is not stale. However, if `allowStale` is also
|
|
1981
|
+
* set, then the old value will still be returned. This is useful
|
|
1982
|
+
* in cases where you want to force a reload of a cached value. If
|
|
1983
|
+
* a background fetch is already in progress, then `forceRefresh`
|
|
1984
|
+
* has no effect.
|
|
1985
|
+
*
|
|
1986
|
+
* If multiple fetches for the same key are issued, then they will all be
|
|
1987
|
+
* coalesced into a single call to fetchMethod.
|
|
1988
|
+
*
|
|
1989
|
+
* Note that this means that handling options such as
|
|
1990
|
+
* {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},
|
|
1991
|
+
* {@link LRUCache.FetchOptions.signal},
|
|
1992
|
+
* and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be
|
|
1993
|
+
* determined by the FIRST fetch() call for a given key.
|
|
1994
|
+
*
|
|
1995
|
+
* This is a known (fixable) shortcoming which will be addresed on when
|
|
1996
|
+
* someone complains about it, as the fix would involve added complexity and
|
|
1997
|
+
* may not be worth the costs for this edge case.
|
|
1998
|
+
*
|
|
1999
|
+
* If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is
|
|
2000
|
+
* effectively an alias for `Promise.resolve(cache.get(key))`.
|
|
2001
|
+
*
|
|
2002
|
+
* When the fetch method resolves to a value, if the fetch has not
|
|
2003
|
+
* been aborted due to deletion, eviction, or being overwritten,
|
|
2004
|
+
* then it is added to the cache using the options provided.
|
|
2005
|
+
*
|
|
2006
|
+
* If the key is evicted or deleted before the `fetchMethod`
|
|
2007
|
+
* resolves, then the AbortSignal passed to the `fetchMethod` will
|
|
2008
|
+
* receive an `abort` event, and the promise returned by `fetch()`
|
|
2009
|
+
* will reject with the reason for the abort.
|
|
2010
|
+
*
|
|
2011
|
+
* If a `signal` is passed to the `fetch()` call, then aborting the
|
|
2012
|
+
* signal will abort the fetch and cause the `fetch()` promise to
|
|
2013
|
+
* reject with the reason provided.
|
|
2014
|
+
*
|
|
2015
|
+
* **Setting `context`**
|
|
2016
|
+
*
|
|
2017
|
+
* If an `FC` type is set to a type other than `unknown`, `void`, or
|
|
2018
|
+
* `undefined` in the {@link LRUCache} constructor, then all
|
|
2019
|
+
* calls to `cache.fetch()` _must_ provide a `context` option. If
|
|
2020
|
+
* set to `undefined` or `void`, then calls to fetch _must not_
|
|
2021
|
+
* provide a `context` option.
|
|
2022
|
+
*
|
|
2023
|
+
* The `context` param allows you to provide arbitrary data that
|
|
2024
|
+
* might be relevant in the course of fetching the data. It is only
|
|
2025
|
+
* relevant for the course of a single `fetch()` operation, and
|
|
2026
|
+
* discarded afterwards.
|
|
2027
|
+
*
|
|
2028
|
+
* **Note: `fetch()` calls are inflight-unique**
|
|
2029
|
+
*
|
|
2030
|
+
* If you call `fetch()` multiple times with the same key value,
|
|
2031
|
+
* then every call after the first will resolve on the same
|
|
2032
|
+
* promise<sup>1</sup>,
|
|
2033
|
+
* _even if they have different settings that would otherwise change
|
|
2034
|
+
* the behavior of the fetch_, such as `noDeleteOnFetchRejection`
|
|
2035
|
+
* or `ignoreFetchAbort`.
|
|
2036
|
+
*
|
|
2037
|
+
* In most cases, this is not a problem (in fact, only fetching
|
|
2038
|
+
* something once is what you probably want, if you're caching in
|
|
2039
|
+
* the first place). If you are changing the fetch() options
|
|
2040
|
+
* dramatically between runs, there's a good chance that you might
|
|
2041
|
+
* be trying to fit divergent semantics into a single object, and
|
|
2042
|
+
* would be better off with multiple cache instances.
|
|
2043
|
+
*
|
|
2044
|
+
* **1**: Ie, they're not the "same Promise", but they resolve at
|
|
2045
|
+
* the same time, because they're both waiting on the same
|
|
2046
|
+
* underlying fetchMethod response.
|
|
2047
|
+
*/
|
|
2048
|
+
fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions<K, V, FC> : FC extends undefined | void ? LRUCache.FetchOptionsNoContext<K, V, FC> : LRUCache.FetchOptionsWithContext<K, V, FC>): Promise<undefined | V>;
|
|
2049
|
+
fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions<K, V, FC> : FC extends undefined | void ? LRUCache.FetchOptionsNoContext<K, V, FC> : never): Promise<undefined | V>;
|
|
2050
|
+
/**
|
|
2051
|
+
* In some cases, `cache.fetch()` may resolve to `undefined`, either because
|
|
2052
|
+
* a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning
|
|
2053
|
+
* `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or
|
|
2054
|
+
* because `ignoreFetchAbort` was specified (either to the constructor or
|
|
2055
|
+
* in the {@link LRUCache.FetchOptions}). Also, the
|
|
2056
|
+
* {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making
|
|
2057
|
+
* the test even more complicated.
|
|
2058
|
+
*
|
|
2059
|
+
* Because inferring the cases where `undefined` might be returned are so
|
|
2060
|
+
* cumbersome, but testing for `undefined` can also be annoying, this method
|
|
2061
|
+
* can be used, which will reject if `this.fetch()` resolves to undefined.
|
|
2062
|
+
*/
|
|
2063
|
+
forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions<K, V, FC> : FC extends undefined | void ? LRUCache.FetchOptionsNoContext<K, V, FC> : LRUCache.FetchOptionsWithContext<K, V, FC>): Promise<V>;
|
|
2064
|
+
forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions<K, V, FC> : FC extends undefined | void ? LRUCache.FetchOptionsNoContext<K, V, FC> : never): Promise<V>;
|
|
2065
|
+
/**
|
|
2066
|
+
* If the key is found in the cache, then this is equivalent to
|
|
2067
|
+
* {@link LRUCache#get}. If not, in the cache, then calculate the value using
|
|
2068
|
+
* the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.
|
|
2069
|
+
*
|
|
2070
|
+
* If an `FC` type is set to a type other than `unknown`, `void`, or
|
|
2071
|
+
* `undefined` in the LRUCache constructor, then all calls to `cache.memo()`
|
|
2072
|
+
* _must_ provide a `context` option. If set to `undefined` or `void`, then
|
|
2073
|
+
* calls to memo _must not_ provide a `context` option.
|
|
2074
|
+
*
|
|
2075
|
+
* The `context` param allows you to provide arbitrary data that might be
|
|
2076
|
+
* relevant in the course of fetching the data. It is only relevant for the
|
|
2077
|
+
* course of a single `memo()` operation, and discarded afterwards.
|
|
2078
|
+
*/
|
|
2079
|
+
memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions<K, V, FC> : FC extends undefined | void ? LRUCache.MemoOptionsNoContext<K, V, FC> : LRUCache.MemoOptionsWithContext<K, V, FC>): V;
|
|
2080
|
+
memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions<K, V, FC> : FC extends undefined | void ? LRUCache.MemoOptionsNoContext<K, V, FC> : never): V;
|
|
2081
|
+
/**
|
|
2082
|
+
* Return a value from the cache. Will update the recency of the cache
|
|
2083
|
+
* entry found.
|
|
2084
|
+
*
|
|
2085
|
+
* If the key is not found, get() will return `undefined`.
|
|
2086
|
+
*/
|
|
2087
|
+
get(k: K, getOptions?: LRUCache.GetOptions<K, V, FC>): V | undefined;
|
|
2088
|
+
/**
|
|
2089
|
+
* Deletes a key out of the cache.
|
|
2090
|
+
*
|
|
2091
|
+
* Returns true if the key was deleted, false otherwise.
|
|
2092
|
+
*/
|
|
2093
|
+
delete(k: K): boolean;
|
|
2094
|
+
/**
|
|
2095
|
+
* Clear the cache entirely, throwing away all values.
|
|
2096
|
+
*/
|
|
2097
|
+
clear(): void;
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
/**
|
|
2101
|
+
* An object that will be used to override the default `fs`
|
|
2102
|
+
* methods. Any methods that are not overridden will use Node's
|
|
2103
|
+
* built-in implementations.
|
|
2104
|
+
*
|
|
2105
|
+
* - lstatSync
|
|
2106
|
+
* - readdir (callback `withFileTypes` Dirent variant, used for
|
|
2107
|
+
* readdirCB and most walks)
|
|
2108
|
+
* - readdirSync
|
|
2109
|
+
* - readlinkSync
|
|
2110
|
+
* - realpathSync
|
|
2111
|
+
* - promises: Object containing the following async methods:
|
|
2112
|
+
* - lstat
|
|
2113
|
+
* - readdir (Dirent variant only)
|
|
2114
|
+
* - readlink
|
|
2115
|
+
* - realpath
|
|
2116
|
+
*/
|
|
2117
|
+
interface FSOption {
|
|
2118
|
+
lstatSync?: (path: string) => Stats;
|
|
2119
|
+
readdir?: (path: string, options: {
|
|
2120
|
+
withFileTypes: true;
|
|
2121
|
+
}, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void;
|
|
2122
|
+
readdirSync?: (path: string, options: {
|
|
2123
|
+
withFileTypes: true;
|
|
2124
|
+
}) => Dirent[];
|
|
2125
|
+
readlinkSync?: (path: string) => string;
|
|
2126
|
+
realpathSync?: (path: string) => string;
|
|
2127
|
+
promises?: {
|
|
2128
|
+
lstat?: (path: string) => Promise<Stats>;
|
|
2129
|
+
readdir?: (path: string, options: {
|
|
2130
|
+
withFileTypes: true;
|
|
2131
|
+
}) => Promise<Dirent[]>;
|
|
2132
|
+
readlink?: (path: string) => Promise<string>;
|
|
2133
|
+
realpath?: (path: string) => Promise<string>;
|
|
2134
|
+
[k: string]: any;
|
|
2135
|
+
};
|
|
2136
|
+
[k: string]: any;
|
|
2137
|
+
}
|
|
2138
|
+
interface FSValue {
|
|
2139
|
+
lstatSync: (path: string) => Stats;
|
|
2140
|
+
readdir: (path: string, options: {
|
|
2141
|
+
withFileTypes: true;
|
|
2142
|
+
}, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void;
|
|
2143
|
+
readdirSync: (path: string, options: {
|
|
2144
|
+
withFileTypes: true;
|
|
2145
|
+
}) => Dirent[];
|
|
2146
|
+
readlinkSync: (path: string) => string;
|
|
2147
|
+
realpathSync: (path: string) => string;
|
|
2148
|
+
promises: {
|
|
2149
|
+
lstat: (path: string) => Promise<Stats>;
|
|
2150
|
+
readdir: (path: string, options: {
|
|
2151
|
+
withFileTypes: true;
|
|
2152
|
+
}) => Promise<Dirent[]>;
|
|
2153
|
+
readlink: (path: string) => Promise<string>;
|
|
2154
|
+
realpath: (path: string) => Promise<string>;
|
|
2155
|
+
[k: string]: any;
|
|
2156
|
+
};
|
|
2157
|
+
[k: string]: any;
|
|
2158
|
+
}
|
|
2159
|
+
type Type = 'Unknown' | 'FIFO' | 'CharacterDevice' | 'Directory' | 'BlockDevice' | 'File' | 'SymbolicLink' | 'Socket';
|
|
2160
|
+
/**
|
|
2161
|
+
* Options that may be provided to the Path constructor
|
|
2162
|
+
*/
|
|
2163
|
+
interface PathOpts {
|
|
2164
|
+
fullpath?: string;
|
|
2165
|
+
relative?: string;
|
|
2166
|
+
relativePosix?: string;
|
|
2167
|
+
parent?: PathBase;
|
|
2168
|
+
/**
|
|
2169
|
+
* See {@link FSOption}
|
|
2170
|
+
*/
|
|
2171
|
+
fs?: FSOption;
|
|
2172
|
+
}
|
|
2173
|
+
/**
|
|
2174
|
+
* an LRUCache for storing child entries.
|
|
2175
|
+
* @internal
|
|
2176
|
+
*/
|
|
2177
|
+
declare class ChildrenCache extends LRUCache<PathBase, Children> {
|
|
2178
|
+
constructor(maxSize?: number);
|
|
2179
|
+
}
|
|
2180
|
+
/**
|
|
2181
|
+
* Array of Path objects, plus a marker indicating the first provisional entry
|
|
2182
|
+
*
|
|
2183
|
+
* @internal
|
|
2184
|
+
*/
|
|
2185
|
+
type Children = PathBase[] & {
|
|
2186
|
+
provisional: number;
|
|
2187
|
+
};
|
|
2188
|
+
declare const setAsCwd: unique symbol;
|
|
2189
|
+
/**
|
|
2190
|
+
* Path objects are sort of like a super-powered
|
|
2191
|
+
* {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}
|
|
2192
|
+
*
|
|
2193
|
+
* Each one represents a single filesystem entry on disk, which may or may not
|
|
2194
|
+
* exist. It includes methods for reading various types of information via
|
|
2195
|
+
* lstat, readlink, and readdir, and caches all information to the greatest
|
|
2196
|
+
* degree possible.
|
|
2197
|
+
*
|
|
2198
|
+
* Note that fs operations that would normally throw will instead return an
|
|
2199
|
+
* "empty" value. This is in order to prevent excessive overhead from error
|
|
2200
|
+
* stack traces.
|
|
2201
|
+
*/
|
|
2202
|
+
declare abstract class PathBase implements Dirent {
|
|
2203
|
+
#private;
|
|
2204
|
+
/**
|
|
2205
|
+
* the basename of this path
|
|
2206
|
+
*
|
|
2207
|
+
* **Important**: *always* test the path name against any test string
|
|
2208
|
+
* usingthe {@link isNamed} method, and not by directly comparing this
|
|
2209
|
+
* string. Otherwise, unicode path strings that the system sees as identical
|
|
2210
|
+
* will not be properly treated as the same path, leading to incorrect
|
|
2211
|
+
* behavior and possible security issues.
|
|
2212
|
+
*/
|
|
2213
|
+
name: string;
|
|
2214
|
+
/**
|
|
2215
|
+
* the Path entry corresponding to the path root.
|
|
2216
|
+
*
|
|
2217
|
+
* @internal
|
|
2218
|
+
*/
|
|
2219
|
+
root: PathBase;
|
|
2220
|
+
/**
|
|
2221
|
+
* All roots found within the current PathScurry family
|
|
2222
|
+
*
|
|
2223
|
+
* @internal
|
|
2224
|
+
*/
|
|
2225
|
+
roots: {
|
|
2226
|
+
[k: string]: PathBase;
|
|
2227
|
+
};
|
|
2228
|
+
/**
|
|
2229
|
+
* a reference to the parent path, or undefined in the case of root entries
|
|
2230
|
+
*
|
|
2231
|
+
* @internal
|
|
2232
|
+
*/
|
|
2233
|
+
parent?: PathBase;
|
|
2234
|
+
/**
|
|
2235
|
+
* boolean indicating whether paths are compared case-insensitively
|
|
2236
|
+
* @internal
|
|
2237
|
+
*/
|
|
2238
|
+
nocase: boolean;
|
|
2239
|
+
/**
|
|
2240
|
+
* boolean indicating that this path is the current working directory
|
|
2241
|
+
* of the PathScurry collection that contains it.
|
|
2242
|
+
*/
|
|
2243
|
+
isCWD: boolean;
|
|
2244
|
+
/**
|
|
2245
|
+
* the string or regexp used to split paths. On posix, it is `'/'`, and on
|
|
2246
|
+
* windows it is a RegExp matching either `'/'` or `'\\'`
|
|
2247
|
+
*/
|
|
2248
|
+
abstract splitSep: string | RegExp;
|
|
2249
|
+
/**
|
|
2250
|
+
* The path separator string to use when joining paths
|
|
2251
|
+
*/
|
|
2252
|
+
abstract sep: string;
|
|
2253
|
+
get dev(): number | undefined;
|
|
2254
|
+
get mode(): number | undefined;
|
|
2255
|
+
get nlink(): number | undefined;
|
|
2256
|
+
get uid(): number | undefined;
|
|
2257
|
+
get gid(): number | undefined;
|
|
2258
|
+
get rdev(): number | undefined;
|
|
2259
|
+
get blksize(): number | undefined;
|
|
2260
|
+
get ino(): number | undefined;
|
|
2261
|
+
get size(): number | undefined;
|
|
2262
|
+
get blocks(): number | undefined;
|
|
2263
|
+
get atimeMs(): number | undefined;
|
|
2264
|
+
get mtimeMs(): number | undefined;
|
|
2265
|
+
get ctimeMs(): number | undefined;
|
|
2266
|
+
get birthtimeMs(): number | undefined;
|
|
2267
|
+
get atime(): Date | undefined;
|
|
2268
|
+
get mtime(): Date | undefined;
|
|
2269
|
+
get ctime(): Date | undefined;
|
|
2270
|
+
get birthtime(): Date | undefined;
|
|
2271
|
+
/**
|
|
2272
|
+
* This property is for compatibility with the Dirent class as of
|
|
2273
|
+
* Node v20, where Dirent['parentPath'] refers to the path of the
|
|
2274
|
+
* directory that was passed to readdir. For root entries, it's the path
|
|
2275
|
+
* to the entry itself.
|
|
2276
|
+
*/
|
|
2277
|
+
get parentPath(): string;
|
|
2278
|
+
/**
|
|
2279
|
+
* Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
|
|
2280
|
+
* this property refers to the *parent* path, not the path object itself.
|
|
2281
|
+
*
|
|
2282
|
+
* @deprecated
|
|
2283
|
+
*/
|
|
2284
|
+
get path(): string;
|
|
2285
|
+
/**
|
|
2286
|
+
* Do not create new Path objects directly. They should always be accessed
|
|
2287
|
+
* via the PathScurry class or other methods on the Path class.
|
|
2288
|
+
*
|
|
2289
|
+
* @internal
|
|
2290
|
+
*/
|
|
2291
|
+
constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: {
|
|
2292
|
+
[k: string]: PathBase;
|
|
2293
|
+
}, nocase: boolean, children: ChildrenCache, opts: PathOpts);
|
|
2294
|
+
/**
|
|
2295
|
+
* Returns the depth of the Path object from its root.
|
|
2296
|
+
*
|
|
2297
|
+
* For example, a path at `/foo/bar` would have a depth of 2.
|
|
2298
|
+
*/
|
|
2299
|
+
depth(): number;
|
|
2300
|
+
/**
|
|
2301
|
+
* @internal
|
|
2302
|
+
*/
|
|
2303
|
+
abstract getRootString(path: string): string;
|
|
2304
|
+
/**
|
|
2305
|
+
* @internal
|
|
2306
|
+
*/
|
|
2307
|
+
abstract getRoot(rootPath: string): PathBase;
|
|
2308
|
+
/**
|
|
2309
|
+
* @internal
|
|
2310
|
+
*/
|
|
2311
|
+
abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase;
|
|
2312
|
+
/**
|
|
2313
|
+
* @internal
|
|
2314
|
+
*/
|
|
2315
|
+
childrenCache(): ChildrenCache;
|
|
2316
|
+
/**
|
|
2317
|
+
* Get the Path object referenced by the string path, resolved from this Path
|
|
2318
|
+
*/
|
|
2319
|
+
resolve(path?: string): PathBase;
|
|
2320
|
+
/**
|
|
2321
|
+
* Returns the cached children Path objects, if still available. If they
|
|
2322
|
+
* have fallen out of the cache, then returns an empty array, and resets the
|
|
2323
|
+
* READDIR_CALLED bit, so that future calls to readdir() will require an fs
|
|
2324
|
+
* lookup.
|
|
2325
|
+
*
|
|
2326
|
+
* @internal
|
|
2327
|
+
*/
|
|
2328
|
+
children(): Children;
|
|
2329
|
+
/**
|
|
2330
|
+
* Resolves a path portion and returns or creates the child Path.
|
|
2331
|
+
*
|
|
2332
|
+
* Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is
|
|
2333
|
+
* `'..'`.
|
|
2334
|
+
*
|
|
2335
|
+
* This should not be called directly. If `pathPart` contains any path
|
|
2336
|
+
* separators, it will lead to unsafe undefined behavior.
|
|
2337
|
+
*
|
|
2338
|
+
* Use `Path.resolve()` instead.
|
|
2339
|
+
*
|
|
2340
|
+
* @internal
|
|
2341
|
+
*/
|
|
2342
|
+
child(pathPart: string, opts?: PathOpts): PathBase;
|
|
2343
|
+
/**
|
|
2344
|
+
* The relative path from the cwd. If it does not share an ancestor with
|
|
2345
|
+
* the cwd, then this ends up being equivalent to the fullpath()
|
|
2346
|
+
*/
|
|
2347
|
+
relative(): string;
|
|
2348
|
+
/**
|
|
2349
|
+
* The relative path from the cwd, using / as the path separator.
|
|
2350
|
+
* If it does not share an ancestor with
|
|
2351
|
+
* the cwd, then this ends up being equivalent to the fullpathPosix()
|
|
2352
|
+
* On posix systems, this is identical to relative().
|
|
2353
|
+
*/
|
|
2354
|
+
relativePosix(): string;
|
|
2355
|
+
/**
|
|
2356
|
+
* The fully resolved path string for this Path entry
|
|
2357
|
+
*/
|
|
2358
|
+
fullpath(): string;
|
|
2359
|
+
/**
|
|
2360
|
+
* On platforms other than windows, this is identical to fullpath.
|
|
2361
|
+
*
|
|
2362
|
+
* On windows, this is overridden to return the forward-slash form of the
|
|
2363
|
+
* full UNC path.
|
|
2364
|
+
*/
|
|
2365
|
+
fullpathPosix(): string;
|
|
2366
|
+
/**
|
|
2367
|
+
* Is the Path of an unknown type?
|
|
2368
|
+
*
|
|
2369
|
+
* Note that we might know *something* about it if there has been a previous
|
|
2370
|
+
* filesystem operation, for example that it does not exist, or is not a
|
|
2371
|
+
* link, or whether it has child entries.
|
|
2372
|
+
*/
|
|
2373
|
+
isUnknown(): boolean;
|
|
2374
|
+
isType(type: Type): boolean;
|
|
2375
|
+
getType(): Type;
|
|
2376
|
+
/**
|
|
2377
|
+
* Is the Path a regular file?
|
|
2378
|
+
*/
|
|
2379
|
+
isFile(): boolean;
|
|
2380
|
+
/**
|
|
2381
|
+
* Is the Path a directory?
|
|
2382
|
+
*/
|
|
2383
|
+
isDirectory(): boolean;
|
|
2384
|
+
/**
|
|
2385
|
+
* Is the path a character device?
|
|
2386
|
+
*/
|
|
2387
|
+
isCharacterDevice(): boolean;
|
|
2388
|
+
/**
|
|
2389
|
+
* Is the path a block device?
|
|
2390
|
+
*/
|
|
2391
|
+
isBlockDevice(): boolean;
|
|
2392
|
+
/**
|
|
2393
|
+
* Is the path a FIFO pipe?
|
|
2394
|
+
*/
|
|
2395
|
+
isFIFO(): boolean;
|
|
2396
|
+
/**
|
|
2397
|
+
* Is the path a socket?
|
|
2398
|
+
*/
|
|
2399
|
+
isSocket(): boolean;
|
|
2400
|
+
/**
|
|
2401
|
+
* Is the path a symbolic link?
|
|
2402
|
+
*/
|
|
2403
|
+
isSymbolicLink(): boolean;
|
|
2404
|
+
/**
|
|
2405
|
+
* Return the entry if it has been subject of a successful lstat, or
|
|
2406
|
+
* undefined otherwise.
|
|
2407
|
+
*
|
|
2408
|
+
* Does not read the filesystem, so an undefined result *could* simply
|
|
2409
|
+
* mean that we haven't called lstat on it.
|
|
2410
|
+
*/
|
|
2411
|
+
lstatCached(): PathBase | undefined;
|
|
2412
|
+
/**
|
|
2413
|
+
* Return the cached link target if the entry has been the subject of a
|
|
2414
|
+
* successful readlink, or undefined otherwise.
|
|
2415
|
+
*
|
|
2416
|
+
* Does not read the filesystem, so an undefined result *could* just mean we
|
|
2417
|
+
* don't have any cached data. Only use it if you are very sure that a
|
|
2418
|
+
* readlink() has been called at some point.
|
|
2419
|
+
*/
|
|
2420
|
+
readlinkCached(): PathBase | undefined;
|
|
2421
|
+
/**
|
|
2422
|
+
* Returns the cached realpath target if the entry has been the subject
|
|
2423
|
+
* of a successful realpath, or undefined otherwise.
|
|
2424
|
+
*
|
|
2425
|
+
* Does not read the filesystem, so an undefined result *could* just mean we
|
|
2426
|
+
* don't have any cached data. Only use it if you are very sure that a
|
|
2427
|
+
* realpath() has been called at some point.
|
|
2428
|
+
*/
|
|
2429
|
+
realpathCached(): PathBase | undefined;
|
|
2430
|
+
/**
|
|
2431
|
+
* Returns the cached child Path entries array if the entry has been the
|
|
2432
|
+
* subject of a successful readdir(), or [] otherwise.
|
|
2433
|
+
*
|
|
2434
|
+
* Does not read the filesystem, so an empty array *could* just mean we
|
|
2435
|
+
* don't have any cached data. Only use it if you are very sure that a
|
|
2436
|
+
* readdir() has been called recently enough to still be valid.
|
|
2437
|
+
*/
|
|
2438
|
+
readdirCached(): PathBase[];
|
|
2439
|
+
/**
|
|
2440
|
+
* Return true if it's worth trying to readlink. Ie, we don't (yet) have
|
|
2441
|
+
* any indication that readlink will definitely fail.
|
|
2442
|
+
*
|
|
2443
|
+
* Returns false if the path is known to not be a symlink, if a previous
|
|
2444
|
+
* readlink failed, or if the entry does not exist.
|
|
2445
|
+
*/
|
|
2446
|
+
canReadlink(): boolean;
|
|
2447
|
+
/**
|
|
2448
|
+
* Return true if readdir has previously been successfully called on this
|
|
2449
|
+
* path, indicating that cachedReaddir() is likely valid.
|
|
2450
|
+
*/
|
|
2451
|
+
calledReaddir(): boolean;
|
|
2452
|
+
/**
|
|
2453
|
+
* Returns true if the path is known to not exist. That is, a previous lstat
|
|
2454
|
+
* or readdir failed to verify its existence when that would have been
|
|
2455
|
+
* expected, or a parent entry was marked either enoent or enotdir.
|
|
2456
|
+
*/
|
|
2457
|
+
isENOENT(): boolean;
|
|
2458
|
+
/**
|
|
2459
|
+
* Return true if the path is a match for the given path name. This handles
|
|
2460
|
+
* case sensitivity and unicode normalization.
|
|
2461
|
+
*
|
|
2462
|
+
* Note: even on case-sensitive systems, it is **not** safe to test the
|
|
2463
|
+
* equality of the `.name` property to determine whether a given pathname
|
|
2464
|
+
* matches, due to unicode normalization mismatches.
|
|
2465
|
+
*
|
|
2466
|
+
* Always use this method instead of testing the `path.name` property
|
|
2467
|
+
* directly.
|
|
2468
|
+
*/
|
|
2469
|
+
isNamed(n: string): boolean;
|
|
2470
|
+
/**
|
|
2471
|
+
* Return the Path object corresponding to the target of a symbolic link.
|
|
2472
|
+
*
|
|
2473
|
+
* If the Path is not a symbolic link, or if the readlink call fails for any
|
|
2474
|
+
* reason, `undefined` is returned.
|
|
2475
|
+
*
|
|
2476
|
+
* Result is cached, and thus may be outdated if the filesystem is mutated.
|
|
2477
|
+
*/
|
|
2478
|
+
readlink(): Promise<PathBase | undefined>;
|
|
2479
|
+
/**
|
|
2480
|
+
* Synchronous {@link PathBase.readlink}
|
|
2481
|
+
*/
|
|
2482
|
+
readlinkSync(): PathBase | undefined;
|
|
2483
|
+
/**
|
|
2484
|
+
* Call lstat() on this Path, and update all known information that can be
|
|
2485
|
+
* determined.
|
|
2486
|
+
*
|
|
2487
|
+
* Note that unlike `fs.lstat()`, the returned value does not contain some
|
|
2488
|
+
* information, such as `mode`, `dev`, `nlink`, and `ino`. If that
|
|
2489
|
+
* information is required, you will need to call `fs.lstat` yourself.
|
|
2490
|
+
*
|
|
2491
|
+
* If the Path refers to a nonexistent file, or if the lstat call fails for
|
|
2492
|
+
* any reason, `undefined` is returned. Otherwise the updated Path object is
|
|
2493
|
+
* returned.
|
|
2494
|
+
*
|
|
2495
|
+
* Results are cached, and thus may be out of date if the filesystem is
|
|
2496
|
+
* mutated.
|
|
2497
|
+
*/
|
|
2498
|
+
lstat(): Promise<PathBase | undefined>;
|
|
2499
|
+
/**
|
|
2500
|
+
* synchronous {@link PathBase.lstat}
|
|
2501
|
+
*/
|
|
2502
|
+
lstatSync(): PathBase | undefined;
|
|
2503
|
+
/**
|
|
2504
|
+
* Standard node-style callback interface to get list of directory entries.
|
|
2505
|
+
*
|
|
2506
|
+
* If the Path cannot or does not contain any children, then an empty array
|
|
2507
|
+
* is returned.
|
|
2508
|
+
*
|
|
2509
|
+
* Results are cached, and thus may be out of date if the filesystem is
|
|
2510
|
+
* mutated.
|
|
2511
|
+
*
|
|
2512
|
+
* @param cb The callback called with (er, entries). Note that the `er`
|
|
2513
|
+
* param is somewhat extraneous, as all readdir() errors are handled and
|
|
2514
|
+
* simply result in an empty set of entries being returned.
|
|
2515
|
+
* @param allowZalgo Boolean indicating that immediately known results should
|
|
2516
|
+
* *not* be deferred with `queueMicrotask`. Defaults to `false`. Release
|
|
2517
|
+
* zalgo at your peril, the dark pony lord is devious and unforgiving.
|
|
2518
|
+
*/
|
|
2519
|
+
readdirCB(cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any, allowZalgo?: boolean): void;
|
|
2520
|
+
/**
|
|
2521
|
+
* Return an array of known child entries.
|
|
2522
|
+
*
|
|
2523
|
+
* If the Path cannot or does not contain any children, then an empty array
|
|
2524
|
+
* is returned.
|
|
2525
|
+
*
|
|
2526
|
+
* Results are cached, and thus may be out of date if the filesystem is
|
|
2527
|
+
* mutated.
|
|
2528
|
+
*/
|
|
2529
|
+
readdir(): Promise<PathBase[]>;
|
|
2530
|
+
/**
|
|
2531
|
+
* synchronous {@link PathBase.readdir}
|
|
2532
|
+
*/
|
|
2533
|
+
readdirSync(): PathBase[];
|
|
2534
|
+
canReaddir(): boolean;
|
|
2535
|
+
shouldWalk(dirs: Set<PathBase | undefined>, walkFilter?: (e: PathBase) => boolean): boolean;
|
|
2536
|
+
/**
|
|
2537
|
+
* Return the Path object corresponding to path as resolved
|
|
2538
|
+
* by realpath(3).
|
|
2539
|
+
*
|
|
2540
|
+
* If the realpath call fails for any reason, `undefined` is returned.
|
|
2541
|
+
*
|
|
2542
|
+
* Result is cached, and thus may be outdated if the filesystem is mutated.
|
|
2543
|
+
* On success, returns a Path object.
|
|
2544
|
+
*/
|
|
2545
|
+
realpath(): Promise<PathBase | undefined>;
|
|
2546
|
+
/**
|
|
2547
|
+
* Synchronous {@link realpath}
|
|
2548
|
+
*/
|
|
2549
|
+
realpathSync(): PathBase | undefined;
|
|
2550
|
+
/**
|
|
2551
|
+
* Internal method to mark this Path object as the scurry cwd,
|
|
2552
|
+
* called by {@link PathScurry#chdir}
|
|
2553
|
+
*
|
|
2554
|
+
* @internal
|
|
2555
|
+
*/
|
|
2556
|
+
[setAsCwd](oldCwd: PathBase): void;
|
|
2557
|
+
}
|
|
2558
|
+
/**
|
|
2559
|
+
* Path class used on win32 systems
|
|
2560
|
+
*
|
|
2561
|
+
* Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'`
|
|
2562
|
+
* as the path separator for parsing paths.
|
|
2563
|
+
*/
|
|
2564
|
+
declare class PathWin32 extends PathBase {
|
|
2565
|
+
/**
|
|
2566
|
+
* Separator for generating path strings.
|
|
2567
|
+
*/
|
|
2568
|
+
sep: '\\';
|
|
2569
|
+
/**
|
|
2570
|
+
* Separator for parsing path strings.
|
|
2571
|
+
*/
|
|
2572
|
+
splitSep: RegExp;
|
|
2573
|
+
/**
|
|
2574
|
+
* Do not create new Path objects directly. They should always be accessed
|
|
2575
|
+
* via the PathScurry class or other methods on the Path class.
|
|
2576
|
+
*
|
|
2577
|
+
* @internal
|
|
2578
|
+
*/
|
|
2579
|
+
constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: {
|
|
2580
|
+
[k: string]: PathBase;
|
|
2581
|
+
}, nocase: boolean, children: ChildrenCache, opts: PathOpts);
|
|
2582
|
+
/**
|
|
2583
|
+
* @internal
|
|
2584
|
+
*/
|
|
2585
|
+
newChild(name: string, type?: number, opts?: PathOpts): PathWin32;
|
|
2586
|
+
/**
|
|
2587
|
+
* @internal
|
|
2588
|
+
*/
|
|
2589
|
+
getRootString(path: string): string;
|
|
2590
|
+
/**
|
|
2591
|
+
* @internal
|
|
2592
|
+
*/
|
|
2593
|
+
getRoot(rootPath: string): PathBase;
|
|
2594
|
+
/**
|
|
2595
|
+
* @internal
|
|
2596
|
+
*/
|
|
2597
|
+
sameRoot(rootPath: string, compare?: string): boolean;
|
|
2598
|
+
}
|
|
2599
|
+
/**
|
|
2600
|
+
* Path class used on all posix systems.
|
|
2601
|
+
*
|
|
2602
|
+
* Uses `'/'` as the path separator.
|
|
2603
|
+
*/
|
|
2604
|
+
declare class PathPosix extends PathBase {
|
|
2605
|
+
/**
|
|
2606
|
+
* separator for parsing path strings
|
|
2607
|
+
*/
|
|
2608
|
+
splitSep: '/';
|
|
2609
|
+
/**
|
|
2610
|
+
* separator for generating path strings
|
|
2611
|
+
*/
|
|
2612
|
+
sep: '/';
|
|
2613
|
+
/**
|
|
2614
|
+
* Do not create new Path objects directly. They should always be accessed
|
|
2615
|
+
* via the PathScurry class or other methods on the Path class.
|
|
2616
|
+
*
|
|
2617
|
+
* @internal
|
|
2618
|
+
*/
|
|
2619
|
+
constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: {
|
|
2620
|
+
[k: string]: PathBase;
|
|
2621
|
+
}, nocase: boolean, children: ChildrenCache, opts: PathOpts);
|
|
2622
|
+
/**
|
|
2623
|
+
* @internal
|
|
2624
|
+
*/
|
|
2625
|
+
getRootString(path: string): string;
|
|
2626
|
+
/**
|
|
2627
|
+
* @internal
|
|
2628
|
+
*/
|
|
2629
|
+
getRoot(_rootPath: string): PathBase;
|
|
2630
|
+
/**
|
|
2631
|
+
* @internal
|
|
2632
|
+
*/
|
|
2633
|
+
newChild(name: string, type?: number, opts?: PathOpts): PathPosix;
|
|
2634
|
+
}
|
|
2635
|
+
/**
|
|
2636
|
+
* Options that may be provided to the PathScurry constructor
|
|
2637
|
+
*/
|
|
2638
|
+
interface PathScurryOpts {
|
|
2639
|
+
/**
|
|
2640
|
+
* perform case-insensitive path matching. Default based on platform
|
|
2641
|
+
* subclass.
|
|
2642
|
+
*/
|
|
2643
|
+
nocase?: boolean;
|
|
2644
|
+
/**
|
|
2645
|
+
* Number of Path entries to keep in the cache of Path child references.
|
|
2646
|
+
*
|
|
2647
|
+
* Setting this higher than 65536 will dramatically increase the data
|
|
2648
|
+
* consumption and construction time overhead of each PathScurry.
|
|
2649
|
+
*
|
|
2650
|
+
* Setting this value to 256 or lower will significantly reduce the data
|
|
2651
|
+
* consumption and construction time overhead, but may also reduce resolve()
|
|
2652
|
+
* and readdir() performance on large filesystems.
|
|
2653
|
+
*
|
|
2654
|
+
* Default `16384`.
|
|
2655
|
+
*/
|
|
2656
|
+
childrenCacheSize?: number;
|
|
2657
|
+
/**
|
|
2658
|
+
* An object that overrides the built-in functions from the fs and
|
|
2659
|
+
* fs/promises modules.
|
|
2660
|
+
*
|
|
2661
|
+
* See {@link FSOption}
|
|
2662
|
+
*/
|
|
2663
|
+
fs?: FSOption;
|
|
2664
|
+
}
|
|
2665
|
+
/**
|
|
2666
|
+
* The base class for all PathScurry classes, providing the interface for path
|
|
2667
|
+
* resolution and filesystem operations.
|
|
2668
|
+
*
|
|
2669
|
+
* Typically, you should *not* instantiate this class directly, but rather one
|
|
2670
|
+
* of the platform-specific classes, or the exported {@link PathScurry} which
|
|
2671
|
+
* defaults to the current platform.
|
|
2672
|
+
*/
|
|
2673
|
+
declare abstract class PathScurryBase {
|
|
2674
|
+
#private;
|
|
2675
|
+
/**
|
|
2676
|
+
* The root Path entry for the current working directory of this Scurry
|
|
2677
|
+
*/
|
|
2678
|
+
root: PathBase;
|
|
2679
|
+
/**
|
|
2680
|
+
* The string path for the root of this Scurry's current working directory
|
|
2681
|
+
*/
|
|
2682
|
+
rootPath: string;
|
|
2683
|
+
/**
|
|
2684
|
+
* A collection of all roots encountered, referenced by rootPath
|
|
2685
|
+
*/
|
|
2686
|
+
roots: {
|
|
2687
|
+
[k: string]: PathBase;
|
|
2688
|
+
};
|
|
2689
|
+
/**
|
|
2690
|
+
* The Path entry corresponding to this PathScurry's current working directory.
|
|
2691
|
+
*/
|
|
2692
|
+
cwd: PathBase;
|
|
2693
|
+
/**
|
|
2694
|
+
* Perform path comparisons case-insensitively.
|
|
2695
|
+
*
|
|
2696
|
+
* Defaults true on Darwin and Windows systems, false elsewhere.
|
|
2697
|
+
*/
|
|
2698
|
+
nocase: boolean;
|
|
2699
|
+
/**
|
|
2700
|
+
* The path separator used for parsing paths
|
|
2701
|
+
*
|
|
2702
|
+
* `'/'` on Posix systems, either `'/'` or `'\\'` on Windows
|
|
2703
|
+
*/
|
|
2704
|
+
abstract sep: string | RegExp;
|
|
2705
|
+
/**
|
|
2706
|
+
* This class should not be instantiated directly.
|
|
2707
|
+
*
|
|
2708
|
+
* Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry
|
|
2709
|
+
*
|
|
2710
|
+
* @internal
|
|
2711
|
+
*/
|
|
2712
|
+
constructor(cwd: (URL | string) | undefined, pathImpl: typeof win32 | typeof posix, sep: string | RegExp, { nocase, childrenCacheSize, fs, }?: PathScurryOpts);
|
|
2713
|
+
/**
|
|
2714
|
+
* Get the depth of a provided path, string, or the cwd
|
|
2715
|
+
*/
|
|
2716
|
+
depth(path?: Path | string): number;
|
|
2717
|
+
/**
|
|
2718
|
+
* Parse the root portion of a path string
|
|
2719
|
+
*
|
|
2720
|
+
* @internal
|
|
2721
|
+
*/
|
|
2722
|
+
abstract parseRootPath(dir: string): string;
|
|
2723
|
+
/**
|
|
2724
|
+
* create a new Path to use as root during construction.
|
|
2725
|
+
*
|
|
2726
|
+
* @internal
|
|
2727
|
+
*/
|
|
2728
|
+
abstract newRoot(fs: FSValue): PathBase;
|
|
2729
|
+
/**
|
|
2730
|
+
* Determine whether a given path string is absolute
|
|
2731
|
+
*/
|
|
2732
|
+
abstract isAbsolute(p: string): boolean;
|
|
2733
|
+
/**
|
|
2734
|
+
* Return the cache of child entries. Exposed so subclasses can create
|
|
2735
|
+
* child Path objects in a platform-specific way.
|
|
2736
|
+
*
|
|
2737
|
+
* @internal
|
|
2738
|
+
*/
|
|
2739
|
+
childrenCache(): ChildrenCache;
|
|
2740
|
+
/**
|
|
2741
|
+
* Resolve one or more path strings to a resolved string
|
|
2742
|
+
*
|
|
2743
|
+
* Same interface as require('path').resolve.
|
|
2744
|
+
*
|
|
2745
|
+
* Much faster than path.resolve() when called multiple times for the same
|
|
2746
|
+
* path, because the resolved Path objects are cached. Much slower
|
|
2747
|
+
* otherwise.
|
|
2748
|
+
*/
|
|
2749
|
+
resolve(...paths: string[]): string;
|
|
2750
|
+
/**
|
|
2751
|
+
* Resolve one or more path strings to a resolved string, returning
|
|
2752
|
+
* the posix path. Identical to .resolve() on posix systems, but on
|
|
2753
|
+
* windows will return a forward-slash separated UNC path.
|
|
2754
|
+
*
|
|
2755
|
+
* Same interface as require('path').resolve.
|
|
2756
|
+
*
|
|
2757
|
+
* Much faster than path.resolve() when called multiple times for the same
|
|
2758
|
+
* path, because the resolved Path objects are cached. Much slower
|
|
2759
|
+
* otherwise.
|
|
2760
|
+
*/
|
|
2761
|
+
resolvePosix(...paths: string[]): string;
|
|
2762
|
+
/**
|
|
2763
|
+
* find the relative path from the cwd to the supplied path string or entry
|
|
2764
|
+
*/
|
|
2765
|
+
relative(entry?: PathBase | string): string;
|
|
2766
|
+
/**
|
|
2767
|
+
* find the relative path from the cwd to the supplied path string or
|
|
2768
|
+
* entry, using / as the path delimiter, even on Windows.
|
|
2769
|
+
*/
|
|
2770
|
+
relativePosix(entry?: PathBase | string): string;
|
|
2771
|
+
/**
|
|
2772
|
+
* Return the basename for the provided string or Path object
|
|
2773
|
+
*/
|
|
2774
|
+
basename(entry?: PathBase | string): string;
|
|
2775
|
+
/**
|
|
2776
|
+
* Return the dirname for the provided string or Path object
|
|
2777
|
+
*/
|
|
2778
|
+
dirname(entry?: PathBase | string): string;
|
|
2779
|
+
/**
|
|
2780
|
+
* Return an array of known child entries.
|
|
2781
|
+
*
|
|
2782
|
+
* First argument may be either a string, or a Path object.
|
|
2783
|
+
*
|
|
2784
|
+
* If the Path cannot or does not contain any children, then an empty array
|
|
2785
|
+
* is returned.
|
|
2786
|
+
*
|
|
2787
|
+
* Results are cached, and thus may be out of date if the filesystem is
|
|
2788
|
+
* mutated.
|
|
2789
|
+
*
|
|
2790
|
+
* Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set
|
|
2791
|
+
* `{ withFileTypes: false }` to return strings.
|
|
2792
|
+
*/
|
|
2793
|
+
readdir(): Promise<PathBase[]>;
|
|
2794
|
+
readdir(opts: {
|
|
2795
|
+
withFileTypes: true;
|
|
2796
|
+
}): Promise<PathBase[]>;
|
|
2797
|
+
readdir(opts: {
|
|
2798
|
+
withFileTypes: false;
|
|
2799
|
+
}): Promise<string[]>;
|
|
2800
|
+
readdir(opts: {
|
|
2801
|
+
withFileTypes: boolean;
|
|
2802
|
+
}): Promise<PathBase[] | string[]>;
|
|
2803
|
+
readdir(entry: PathBase | string): Promise<PathBase[]>;
|
|
2804
|
+
readdir(entry: PathBase | string, opts: {
|
|
2805
|
+
withFileTypes: true;
|
|
2806
|
+
}): Promise<PathBase[]>;
|
|
2807
|
+
readdir(entry: PathBase | string, opts: {
|
|
2808
|
+
withFileTypes: false;
|
|
2809
|
+
}): Promise<string[]>;
|
|
2810
|
+
readdir(entry: PathBase | string, opts: {
|
|
2811
|
+
withFileTypes: boolean;
|
|
2812
|
+
}): Promise<PathBase[] | string[]>;
|
|
2813
|
+
/**
|
|
2814
|
+
* synchronous {@link PathScurryBase.readdir}
|
|
2815
|
+
*/
|
|
2816
|
+
readdirSync(): PathBase[];
|
|
2817
|
+
readdirSync(opts: {
|
|
2818
|
+
withFileTypes: true;
|
|
2819
|
+
}): PathBase[];
|
|
2820
|
+
readdirSync(opts: {
|
|
2821
|
+
withFileTypes: false;
|
|
2822
|
+
}): string[];
|
|
2823
|
+
readdirSync(opts: {
|
|
2824
|
+
withFileTypes: boolean;
|
|
2825
|
+
}): PathBase[] | string[];
|
|
2826
|
+
readdirSync(entry: PathBase | string): PathBase[];
|
|
2827
|
+
readdirSync(entry: PathBase | string, opts: {
|
|
2828
|
+
withFileTypes: true;
|
|
2829
|
+
}): PathBase[];
|
|
2830
|
+
readdirSync(entry: PathBase | string, opts: {
|
|
2831
|
+
withFileTypes: false;
|
|
2832
|
+
}): string[];
|
|
2833
|
+
readdirSync(entry: PathBase | string, opts: {
|
|
2834
|
+
withFileTypes: boolean;
|
|
2835
|
+
}): PathBase[] | string[];
|
|
2836
|
+
/**
|
|
2837
|
+
* Call lstat() on the string or Path object, and update all known
|
|
2838
|
+
* information that can be determined.
|
|
2839
|
+
*
|
|
2840
|
+
* Note that unlike `fs.lstat()`, the returned value does not contain some
|
|
2841
|
+
* information, such as `mode`, `dev`, `nlink`, and `ino`. If that
|
|
2842
|
+
* information is required, you will need to call `fs.lstat` yourself.
|
|
2843
|
+
*
|
|
2844
|
+
* If the Path refers to a nonexistent file, or if the lstat call fails for
|
|
2845
|
+
* any reason, `undefined` is returned. Otherwise the updated Path object is
|
|
2846
|
+
* returned.
|
|
2847
|
+
*
|
|
2848
|
+
* Results are cached, and thus may be out of date if the filesystem is
|
|
2849
|
+
* mutated.
|
|
2850
|
+
*/
|
|
2851
|
+
lstat(entry?: string | PathBase): Promise<PathBase | undefined>;
|
|
2852
|
+
/**
|
|
2853
|
+
* synchronous {@link PathScurryBase.lstat}
|
|
2854
|
+
*/
|
|
2855
|
+
lstatSync(entry?: string | PathBase): PathBase | undefined;
|
|
2856
|
+
/**
|
|
2857
|
+
* Return the Path object or string path corresponding to the target of a
|
|
2858
|
+
* symbolic link.
|
|
2859
|
+
*
|
|
2860
|
+
* If the path is not a symbolic link, or if the readlink call fails for any
|
|
2861
|
+
* reason, `undefined` is returned.
|
|
2862
|
+
*
|
|
2863
|
+
* Result is cached, and thus may be outdated if the filesystem is mutated.
|
|
2864
|
+
*
|
|
2865
|
+
* `{withFileTypes}` option defaults to `false`.
|
|
2866
|
+
*
|
|
2867
|
+
* On success, returns a Path object if `withFileTypes` option is true,
|
|
2868
|
+
* otherwise a string.
|
|
2869
|
+
*/
|
|
2870
|
+
readlink(): Promise<string | undefined>;
|
|
2871
|
+
readlink(opt: {
|
|
2872
|
+
withFileTypes: false;
|
|
2873
|
+
}): Promise<string | undefined>;
|
|
2874
|
+
readlink(opt: {
|
|
2875
|
+
withFileTypes: true;
|
|
2876
|
+
}): Promise<PathBase | undefined>;
|
|
2877
|
+
readlink(opt: {
|
|
2878
|
+
withFileTypes: boolean;
|
|
2879
|
+
}): Promise<PathBase | string | undefined>;
|
|
2880
|
+
readlink(entry: string | PathBase, opt?: {
|
|
2881
|
+
withFileTypes: false;
|
|
2882
|
+
}): Promise<string | undefined>;
|
|
2883
|
+
readlink(entry: string | PathBase, opt: {
|
|
2884
|
+
withFileTypes: true;
|
|
2885
|
+
}): Promise<PathBase | undefined>;
|
|
2886
|
+
readlink(entry: string | PathBase, opt: {
|
|
2887
|
+
withFileTypes: boolean;
|
|
2888
|
+
}): Promise<string | PathBase | undefined>;
|
|
2889
|
+
/**
|
|
2890
|
+
* synchronous {@link PathScurryBase.readlink}
|
|
2891
|
+
*/
|
|
2892
|
+
readlinkSync(): string | undefined;
|
|
2893
|
+
readlinkSync(opt: {
|
|
2894
|
+
withFileTypes: false;
|
|
2895
|
+
}): string | undefined;
|
|
2896
|
+
readlinkSync(opt: {
|
|
2897
|
+
withFileTypes: true;
|
|
2898
|
+
}): PathBase | undefined;
|
|
2899
|
+
readlinkSync(opt: {
|
|
2900
|
+
withFileTypes: boolean;
|
|
2901
|
+
}): PathBase | string | undefined;
|
|
2902
|
+
readlinkSync(entry: string | PathBase, opt?: {
|
|
2903
|
+
withFileTypes: false;
|
|
2904
|
+
}): string | undefined;
|
|
2905
|
+
readlinkSync(entry: string | PathBase, opt: {
|
|
2906
|
+
withFileTypes: true;
|
|
2907
|
+
}): PathBase | undefined;
|
|
2908
|
+
readlinkSync(entry: string | PathBase, opt: {
|
|
2909
|
+
withFileTypes: boolean;
|
|
2910
|
+
}): string | PathBase | undefined;
|
|
2911
|
+
/**
|
|
2912
|
+
* Return the Path object or string path corresponding to path as resolved
|
|
2913
|
+
* by realpath(3).
|
|
2914
|
+
*
|
|
2915
|
+
* If the realpath call fails for any reason, `undefined` is returned.
|
|
2916
|
+
*
|
|
2917
|
+
* Result is cached, and thus may be outdated if the filesystem is mutated.
|
|
2918
|
+
*
|
|
2919
|
+
* `{withFileTypes}` option defaults to `false`.
|
|
2920
|
+
*
|
|
2921
|
+
* On success, returns a Path object if `withFileTypes` option is true,
|
|
2922
|
+
* otherwise a string.
|
|
2923
|
+
*/
|
|
2924
|
+
realpath(): Promise<string | undefined>;
|
|
2925
|
+
realpath(opt: {
|
|
2926
|
+
withFileTypes: false;
|
|
2927
|
+
}): Promise<string | undefined>;
|
|
2928
|
+
realpath(opt: {
|
|
2929
|
+
withFileTypes: true;
|
|
2930
|
+
}): Promise<PathBase | undefined>;
|
|
2931
|
+
realpath(opt: {
|
|
2932
|
+
withFileTypes: boolean;
|
|
2933
|
+
}): Promise<PathBase | string | undefined>;
|
|
2934
|
+
realpath(entry: string | PathBase, opt?: {
|
|
2935
|
+
withFileTypes: false;
|
|
2936
|
+
}): Promise<string | undefined>;
|
|
2937
|
+
realpath(entry: string | PathBase, opt: {
|
|
2938
|
+
withFileTypes: true;
|
|
2939
|
+
}): Promise<PathBase | undefined>;
|
|
2940
|
+
realpath(entry: string | PathBase, opt: {
|
|
2941
|
+
withFileTypes: boolean;
|
|
2942
|
+
}): Promise<string | PathBase | undefined>;
|
|
2943
|
+
realpathSync(): string | undefined;
|
|
2944
|
+
realpathSync(opt: {
|
|
2945
|
+
withFileTypes: false;
|
|
2946
|
+
}): string | undefined;
|
|
2947
|
+
realpathSync(opt: {
|
|
2948
|
+
withFileTypes: true;
|
|
2949
|
+
}): PathBase | undefined;
|
|
2950
|
+
realpathSync(opt: {
|
|
2951
|
+
withFileTypes: boolean;
|
|
2952
|
+
}): PathBase | string | undefined;
|
|
2953
|
+
realpathSync(entry: string | PathBase, opt?: {
|
|
2954
|
+
withFileTypes: false;
|
|
2955
|
+
}): string | undefined;
|
|
2956
|
+
realpathSync(entry: string | PathBase, opt: {
|
|
2957
|
+
withFileTypes: true;
|
|
2958
|
+
}): PathBase | undefined;
|
|
2959
|
+
realpathSync(entry: string | PathBase, opt: {
|
|
2960
|
+
withFileTypes: boolean;
|
|
2961
|
+
}): string | PathBase | undefined;
|
|
2962
|
+
/**
|
|
2963
|
+
* Asynchronously walk the directory tree, returning an array of
|
|
2964
|
+
* all path strings or Path objects found.
|
|
2965
|
+
*
|
|
2966
|
+
* Note that this will be extremely memory-hungry on large filesystems.
|
|
2967
|
+
* In such cases, it may be better to use the stream or async iterator
|
|
2968
|
+
* walk implementation.
|
|
2969
|
+
*/
|
|
2970
|
+
walk(): Promise<PathBase[]>;
|
|
2971
|
+
walk(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise<PathBase[]>;
|
|
2972
|
+
walk(opts: WalkOptionsWithFileTypesFalse): Promise<string[]>;
|
|
2973
|
+
walk(opts: WalkOptions): Promise<string[] | PathBase[]>;
|
|
2974
|
+
walk(entry: string | PathBase): Promise<PathBase[]>;
|
|
2975
|
+
walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise<PathBase[]>;
|
|
2976
|
+
walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Promise<string[]>;
|
|
2977
|
+
walk(entry: string | PathBase, opts: WalkOptions): Promise<PathBase[] | string[]>;
|
|
2978
|
+
/**
|
|
2979
|
+
* Synchronously walk the directory tree, returning an array of
|
|
2980
|
+
* all path strings or Path objects found.
|
|
2981
|
+
*
|
|
2982
|
+
* Note that this will be extremely memory-hungry on large filesystems.
|
|
2983
|
+
* In such cases, it may be better to use the stream or async iterator
|
|
2984
|
+
* walk implementation.
|
|
2985
|
+
*/
|
|
2986
|
+
walkSync(): PathBase[];
|
|
2987
|
+
walkSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): PathBase[];
|
|
2988
|
+
walkSync(opts: WalkOptionsWithFileTypesFalse): string[];
|
|
2989
|
+
walkSync(opts: WalkOptions): string[] | PathBase[];
|
|
2990
|
+
walkSync(entry: string | PathBase): PathBase[];
|
|
2991
|
+
walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): PathBase[];
|
|
2992
|
+
walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): string[];
|
|
2993
|
+
walkSync(entry: string | PathBase, opts: WalkOptions): PathBase[] | string[];
|
|
2994
|
+
/**
|
|
2995
|
+
* Support for `for await`
|
|
2996
|
+
*
|
|
2997
|
+
* Alias for {@link PathScurryBase.iterate}
|
|
2998
|
+
*
|
|
2999
|
+
* Note: As of Node 19, this is very slow, compared to other methods of
|
|
3000
|
+
* walking. Consider using {@link PathScurryBase.stream} if memory overhead
|
|
3001
|
+
* and backpressure are concerns, or {@link PathScurryBase.walk} if not.
|
|
3002
|
+
*/
|
|
3003
|
+
[Symbol.asyncIterator](): AsyncGenerator<PathBase, void, void>;
|
|
3004
|
+
/**
|
|
3005
|
+
* Async generator form of {@link PathScurryBase.walk}
|
|
3006
|
+
*
|
|
3007
|
+
* Note: As of Node 19, this is very slow, compared to other methods of
|
|
3008
|
+
* walking, especially if most/all of the directory tree has been previously
|
|
3009
|
+
* walked. Consider using {@link PathScurryBase.stream} if memory overhead
|
|
3010
|
+
* and backpressure are concerns, or {@link PathScurryBase.walk} if not.
|
|
3011
|
+
*/
|
|
3012
|
+
iterate(): AsyncGenerator<PathBase, void, void>;
|
|
3013
|
+
iterate(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator<PathBase, void, void>;
|
|
3014
|
+
iterate(opts: WalkOptionsWithFileTypesFalse): AsyncGenerator<string, void, void>;
|
|
3015
|
+
iterate(opts: WalkOptions): AsyncGenerator<string | PathBase, void, void>;
|
|
3016
|
+
iterate(entry: string | PathBase): AsyncGenerator<PathBase, void, void>;
|
|
3017
|
+
iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator<PathBase, void, void>;
|
|
3018
|
+
iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): AsyncGenerator<string, void, void>;
|
|
3019
|
+
iterate(entry: string | PathBase, opts: WalkOptions): AsyncGenerator<PathBase | string, void, void>;
|
|
3020
|
+
/**
|
|
3021
|
+
* Iterating over a PathScurry performs a synchronous walk.
|
|
3022
|
+
*
|
|
3023
|
+
* Alias for {@link PathScurryBase.iterateSync}
|
|
3024
|
+
*/
|
|
3025
|
+
[Symbol.iterator](): Generator<PathBase, void, void>;
|
|
3026
|
+
iterateSync(): Generator<PathBase, void, void>;
|
|
3027
|
+
iterateSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator<PathBase, void, void>;
|
|
3028
|
+
iterateSync(opts: WalkOptionsWithFileTypesFalse): Generator<string, void, void>;
|
|
3029
|
+
iterateSync(opts: WalkOptions): Generator<string | PathBase, void, void>;
|
|
3030
|
+
iterateSync(entry: string | PathBase): Generator<PathBase, void, void>;
|
|
3031
|
+
iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator<PathBase, void, void>;
|
|
3032
|
+
iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Generator<string, void, void>;
|
|
3033
|
+
iterateSync(entry: string | PathBase, opts: WalkOptions): Generator<PathBase | string, void, void>;
|
|
3034
|
+
/**
|
|
3035
|
+
* Stream form of {@link PathScurryBase.walk}
|
|
3036
|
+
*
|
|
3037
|
+
* Returns a Minipass stream that emits {@link PathBase} objects by default,
|
|
3038
|
+
* or strings if `{ withFileTypes: false }` is set in the options.
|
|
3039
|
+
*/
|
|
3040
|
+
stream(): Minipass<PathBase>;
|
|
3041
|
+
stream(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass<PathBase>;
|
|
3042
|
+
stream(opts: WalkOptionsWithFileTypesFalse): Minipass<string>;
|
|
3043
|
+
stream(opts: WalkOptions): Minipass<string | PathBase>;
|
|
3044
|
+
stream(entry: string | PathBase): Minipass<PathBase>;
|
|
3045
|
+
stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass<PathBase>;
|
|
3046
|
+
stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass<string>;
|
|
3047
|
+
stream(entry: string | PathBase, opts: WalkOptions): Minipass<string> | Minipass<PathBase>;
|
|
3048
|
+
/**
|
|
3049
|
+
* Synchronous form of {@link PathScurryBase.stream}
|
|
3050
|
+
*
|
|
3051
|
+
* Returns a Minipass stream that emits {@link PathBase} objects by default,
|
|
3052
|
+
* or strings if `{ withFileTypes: false }` is set in the options.
|
|
3053
|
+
*
|
|
3054
|
+
* Will complete the walk in a single tick if the stream is consumed fully.
|
|
3055
|
+
* Otherwise, will pause as needed for stream backpressure.
|
|
3056
|
+
*/
|
|
3057
|
+
streamSync(): Minipass<PathBase>;
|
|
3058
|
+
streamSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass<PathBase>;
|
|
3059
|
+
streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass<string>;
|
|
3060
|
+
streamSync(opts: WalkOptions): Minipass<string | PathBase>;
|
|
3061
|
+
streamSync(entry: string | PathBase): Minipass<PathBase>;
|
|
3062
|
+
streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass<PathBase>;
|
|
3063
|
+
streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass<string>;
|
|
3064
|
+
streamSync(entry: string | PathBase, opts: WalkOptions): Minipass<string> | Minipass<PathBase>;
|
|
3065
|
+
chdir(path?: string | Path): void;
|
|
3066
|
+
}
|
|
3067
|
+
/**
|
|
3068
|
+
* Options provided to all walk methods.
|
|
3069
|
+
*/
|
|
3070
|
+
interface WalkOptions {
|
|
3071
|
+
/**
|
|
3072
|
+
* Return results as {@link PathBase} objects rather than strings.
|
|
3073
|
+
* When set to false, results are fully resolved paths, as returned by
|
|
3074
|
+
* {@link PathBase.fullpath}.
|
|
3075
|
+
* @default true
|
|
3076
|
+
*/
|
|
3077
|
+
withFileTypes?: boolean;
|
|
3078
|
+
/**
|
|
3079
|
+
* Attempt to read directory entries from symbolic links. Otherwise, only
|
|
3080
|
+
* actual directories are traversed. Regardless of this setting, a given
|
|
3081
|
+
* target path will only ever be walked once, meaning that a symbolic link
|
|
3082
|
+
* to a previously traversed directory will never be followed.
|
|
3083
|
+
*
|
|
3084
|
+
* Setting this imposes a slight performance penalty, because `readlink`
|
|
3085
|
+
* must be called on all symbolic links encountered, in order to avoid
|
|
3086
|
+
* infinite cycles.
|
|
3087
|
+
* @default false
|
|
3088
|
+
*/
|
|
3089
|
+
follow?: boolean;
|
|
3090
|
+
/**
|
|
3091
|
+
* Only return entries where the provided function returns true.
|
|
3092
|
+
*
|
|
3093
|
+
* This will not prevent directories from being traversed, even if they do
|
|
3094
|
+
* not pass the filter, though it will prevent directories themselves from
|
|
3095
|
+
* being included in the result set. See {@link walkFilter}
|
|
3096
|
+
*
|
|
3097
|
+
* Asynchronous functions are not supported here.
|
|
3098
|
+
*
|
|
3099
|
+
* By default, if no filter is provided, all entries and traversed
|
|
3100
|
+
* directories are included.
|
|
3101
|
+
*/
|
|
3102
|
+
filter?: (entry: PathBase) => boolean;
|
|
3103
|
+
/**
|
|
3104
|
+
* Only traverse directories (and in the case of {@link follow} being set to
|
|
3105
|
+
* true, symbolic links to directories) if the provided function returns
|
|
3106
|
+
* true.
|
|
3107
|
+
*
|
|
3108
|
+
* This will not prevent directories from being included in the result set,
|
|
3109
|
+
* even if they do not pass the supplied filter function. See {@link filter}
|
|
3110
|
+
* to do that.
|
|
3111
|
+
*
|
|
3112
|
+
* Asynchronous functions are not supported here.
|
|
3113
|
+
*/
|
|
3114
|
+
walkFilter?: (entry: PathBase) => boolean;
|
|
3115
|
+
}
|
|
3116
|
+
type WalkOptionsWithFileTypesUnset = WalkOptions & {
|
|
3117
|
+
withFileTypes?: undefined;
|
|
3118
|
+
};
|
|
3119
|
+
type WalkOptionsWithFileTypesTrue = WalkOptions & {
|
|
3120
|
+
withFileTypes: true;
|
|
3121
|
+
};
|
|
3122
|
+
type WalkOptionsWithFileTypesFalse = WalkOptions & {
|
|
3123
|
+
withFileTypes: false;
|
|
3124
|
+
};
|
|
3125
|
+
/**
|
|
3126
|
+
* Windows implementation of {@link PathScurryBase}
|
|
3127
|
+
*
|
|
3128
|
+
* Defaults to case insensitve, uses `'\\'` to generate path strings. Uses
|
|
3129
|
+
* {@link PathWin32} for Path objects.
|
|
3130
|
+
*/
|
|
3131
|
+
declare class PathScurryWin32 extends PathScurryBase {
|
|
3132
|
+
/**
|
|
3133
|
+
* separator for generating path strings
|
|
3134
|
+
*/
|
|
3135
|
+
sep: '\\';
|
|
3136
|
+
constructor(cwd?: URL | string, opts?: PathScurryOpts);
|
|
3137
|
+
/**
|
|
3138
|
+
* @internal
|
|
3139
|
+
*/
|
|
3140
|
+
parseRootPath(dir: string): string;
|
|
3141
|
+
/**
|
|
3142
|
+
* @internal
|
|
3143
|
+
*/
|
|
3144
|
+
newRoot(fs: FSValue): PathWin32;
|
|
3145
|
+
/**
|
|
3146
|
+
* Return true if the provided path string is an absolute path
|
|
3147
|
+
*/
|
|
3148
|
+
isAbsolute(p: string): boolean;
|
|
3149
|
+
}
|
|
3150
|
+
/**
|
|
3151
|
+
* {@link PathScurryBase} implementation for all posix systems other than Darwin.
|
|
3152
|
+
*
|
|
3153
|
+
* Defaults to case-sensitive matching, uses `'/'` to generate path strings.
|
|
3154
|
+
*
|
|
3155
|
+
* Uses {@link PathPosix} for Path objects.
|
|
3156
|
+
*/
|
|
3157
|
+
declare class PathScurryPosix extends PathScurryBase {
|
|
3158
|
+
/**
|
|
3159
|
+
* separator for generating path strings
|
|
3160
|
+
*/
|
|
3161
|
+
sep: '/';
|
|
3162
|
+
constructor(cwd?: URL | string, opts?: PathScurryOpts);
|
|
3163
|
+
/**
|
|
3164
|
+
* @internal
|
|
3165
|
+
*/
|
|
3166
|
+
parseRootPath(_dir: string): string;
|
|
3167
|
+
/**
|
|
3168
|
+
* @internal
|
|
3169
|
+
*/
|
|
3170
|
+
newRoot(fs: FSValue): PathPosix;
|
|
3171
|
+
/**
|
|
3172
|
+
* Return true if the provided path string is an absolute path
|
|
3173
|
+
*/
|
|
3174
|
+
isAbsolute(p: string): boolean;
|
|
3175
|
+
}
|
|
3176
|
+
/**
|
|
3177
|
+
* {@link PathScurryBase} implementation for Darwin (macOS) systems.
|
|
3178
|
+
*
|
|
3179
|
+
* Defaults to case-insensitive matching, uses `'/'` for generating path
|
|
3180
|
+
* strings.
|
|
3181
|
+
*
|
|
3182
|
+
* Uses {@link PathPosix} for Path objects.
|
|
3183
|
+
*/
|
|
3184
|
+
declare class PathScurryDarwin extends PathScurryPosix {
|
|
3185
|
+
constructor(cwd?: URL | string, opts?: PathScurryOpts);
|
|
3186
|
+
}
|
|
3187
|
+
/**
|
|
3188
|
+
* Default {@link PathBase} implementation for the current platform.
|
|
3189
|
+
*
|
|
3190
|
+
* {@link PathWin32} on Windows systems, {@link PathPosix} on all others.
|
|
3191
|
+
*/
|
|
3192
|
+
declare const Path: typeof PathWin32 | typeof PathPosix;
|
|
3193
|
+
type Path = PathBase | InstanceType<typeof Path>;
|
|
3194
|
+
/**
|
|
3195
|
+
* Default {@link PathScurryBase} implementation for the current platform.
|
|
3196
|
+
*
|
|
3197
|
+
* {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on
|
|
3198
|
+
* Darwin (macOS) systems, {@link PathScurryPosix} on all others.
|
|
3199
|
+
*/
|
|
3200
|
+
declare const PathScurry: typeof PathScurryWin32 | typeof PathScurryDarwin | typeof PathScurryPosix;
|
|
3201
|
+
type PathScurry = PathScurryBase | InstanceType<typeof PathScurry>;
|
|
3202
|
+
|
|
3203
|
+
type MMPattern = string | RegExp | typeof GLOBSTAR;
|
|
3204
|
+
declare const customInspect: unique symbol;
|
|
3205
|
+
/**
|
|
3206
|
+
* An immutable-ish view on an array of glob parts and their parsed
|
|
3207
|
+
* results
|
|
3208
|
+
*/
|
|
3209
|
+
declare class Pattern {
|
|
3210
|
+
#private;
|
|
3211
|
+
readonly length: number;
|
|
3212
|
+
constructor(patternList: MMPattern[], globList: string[], index: number, platform: NodeJS.Platform);
|
|
3213
|
+
[customInspect](): string;
|
|
3214
|
+
/**
|
|
3215
|
+
* The first entry in the parsed list of patterns
|
|
3216
|
+
*/
|
|
3217
|
+
pattern(): MMPattern;
|
|
3218
|
+
/**
|
|
3219
|
+
* true of if pattern() returns a string
|
|
3220
|
+
*/
|
|
3221
|
+
isString(): boolean;
|
|
3222
|
+
/**
|
|
3223
|
+
* true of if pattern() returns GLOBSTAR
|
|
3224
|
+
*/
|
|
3225
|
+
isGlobstar(): boolean;
|
|
3226
|
+
/**
|
|
3227
|
+
* true if pattern() returns a regexp
|
|
3228
|
+
*/
|
|
3229
|
+
isRegExp(): boolean;
|
|
3230
|
+
/**
|
|
3231
|
+
* The /-joined set of glob parts that make up this pattern
|
|
3232
|
+
*/
|
|
3233
|
+
globString(): string;
|
|
3234
|
+
/**
|
|
3235
|
+
* true if there are more pattern parts after this one
|
|
3236
|
+
*/
|
|
3237
|
+
hasMore(): boolean;
|
|
3238
|
+
/**
|
|
3239
|
+
* The rest of the pattern after this part, or null if this is the end
|
|
3240
|
+
*/
|
|
3241
|
+
rest(): Pattern | null;
|
|
3242
|
+
/**
|
|
3243
|
+
* true if the pattern represents a //unc/path/ on windows
|
|
3244
|
+
*/
|
|
3245
|
+
isUNC(): boolean;
|
|
3246
|
+
/**
|
|
3247
|
+
* True if the pattern starts with a drive letter on Windows
|
|
3248
|
+
*/
|
|
3249
|
+
isDrive(): boolean;
|
|
3250
|
+
/**
|
|
3251
|
+
* True if the pattern is rooted on an absolute path
|
|
3252
|
+
*/
|
|
3253
|
+
isAbsolute(): boolean;
|
|
3254
|
+
/**
|
|
3255
|
+
* consume the root of the pattern, and return it
|
|
3256
|
+
*/
|
|
3257
|
+
root(): string;
|
|
3258
|
+
/**
|
|
3259
|
+
* Check to see if the current globstar pattern is allowed to follow
|
|
3260
|
+
* a symbolic link.
|
|
3261
|
+
*/
|
|
3262
|
+
checkFollowGlobstar(): boolean;
|
|
3263
|
+
/**
|
|
3264
|
+
* Mark that the current globstar pattern is following a symbolic link
|
|
3265
|
+
*/
|
|
3266
|
+
markFollowGlobstar(): boolean;
|
|
3267
|
+
}
|
|
3268
|
+
|
|
3269
|
+
/**
|
|
3270
|
+
* Single-use utility classes to provide functionality to the {@link Glob}
|
|
3271
|
+
* methods.
|
|
3272
|
+
*
|
|
3273
|
+
* @module
|
|
3274
|
+
*/
|
|
3275
|
+
|
|
3276
|
+
interface GlobWalkerOpts {
|
|
3277
|
+
absolute?: boolean;
|
|
3278
|
+
allowWindowsEscape?: boolean;
|
|
3279
|
+
cwd?: string | URL;
|
|
3280
|
+
dot?: boolean;
|
|
3281
|
+
dotRelative?: boolean;
|
|
3282
|
+
follow?: boolean;
|
|
3283
|
+
ignore?: string | string[] | IgnoreLike;
|
|
3284
|
+
mark?: boolean;
|
|
3285
|
+
matchBase?: boolean;
|
|
3286
|
+
maxDepth?: number;
|
|
3287
|
+
nobrace?: boolean;
|
|
3288
|
+
nocase?: boolean;
|
|
3289
|
+
nodir?: boolean;
|
|
3290
|
+
noext?: boolean;
|
|
3291
|
+
noglobstar?: boolean;
|
|
3292
|
+
platform?: NodeJS.Platform;
|
|
3293
|
+
posix?: boolean;
|
|
3294
|
+
realpath?: boolean;
|
|
3295
|
+
root?: string;
|
|
3296
|
+
stat?: boolean;
|
|
3297
|
+
signal?: AbortSignal;
|
|
3298
|
+
windowsPathsNoEscape?: boolean;
|
|
3299
|
+
withFileTypes?: boolean;
|
|
3300
|
+
includeChildMatches?: boolean;
|
|
3301
|
+
}
|
|
3302
|
+
type GWOFileTypesTrue = GlobWalkerOpts & {
|
|
3303
|
+
withFileTypes: true;
|
|
3304
|
+
};
|
|
3305
|
+
type GWOFileTypesFalse = GlobWalkerOpts & {
|
|
3306
|
+
withFileTypes: false;
|
|
3307
|
+
};
|
|
3308
|
+
type GWOFileTypesUnset = GlobWalkerOpts & {
|
|
3309
|
+
withFileTypes?: undefined;
|
|
3310
|
+
};
|
|
3311
|
+
type Result$1<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Path : O extends GWOFileTypesFalse ? string : O extends GWOFileTypesUnset ? string : Path | string;
|
|
3312
|
+
type MatchStream<O extends GlobWalkerOpts> = Minipass<Result$1<O>, Result$1<O>>;
|
|
3313
|
+
|
|
3314
|
+
interface IgnoreLike {
|
|
3315
|
+
ignored?: (p: Path) => boolean;
|
|
3316
|
+
childrenIgnored?: (p: Path) => boolean;
|
|
3317
|
+
add?: (ignore: string) => void;
|
|
3318
|
+
}
|
|
3319
|
+
/**
|
|
3320
|
+
* Class used to process ignored patterns
|
|
3321
|
+
*/
|
|
3322
|
+
declare class Ignore implements IgnoreLike {
|
|
3323
|
+
relative: Minimatch[];
|
|
3324
|
+
relativeChildren: Minimatch[];
|
|
3325
|
+
absolute: Minimatch[];
|
|
3326
|
+
absoluteChildren: Minimatch[];
|
|
3327
|
+
platform: NodeJS.Platform;
|
|
3328
|
+
mmopts: MinimatchOptions;
|
|
3329
|
+
constructor(ignored: string[], { nobrace, nocase, noext, noglobstar, platform, }: GlobWalkerOpts);
|
|
3330
|
+
add(ign: string): void;
|
|
3331
|
+
ignored(p: Path): boolean;
|
|
3332
|
+
childrenIgnored(p: Path): boolean;
|
|
3333
|
+
}
|
|
3334
|
+
|
|
3335
|
+
/**
|
|
3336
|
+
* A `GlobOptions` object may be provided to any of the exported methods, and
|
|
3337
|
+
* must be provided to the `Glob` constructor.
|
|
3338
|
+
*
|
|
3339
|
+
* All options are optional, boolean, and false by default, unless otherwise
|
|
3340
|
+
* noted.
|
|
3341
|
+
*
|
|
3342
|
+
* All resolved options are added to the Glob object as properties.
|
|
3343
|
+
*
|
|
3344
|
+
* If you are running many `glob` operations, you can pass a Glob object as the
|
|
3345
|
+
* `options` argument to a subsequent operation to share the previously loaded
|
|
3346
|
+
* cache.
|
|
3347
|
+
*/
|
|
3348
|
+
interface GlobOptions {
|
|
3349
|
+
/**
|
|
3350
|
+
* Set to `true` to always receive absolute paths for
|
|
3351
|
+
* matched files. Set to `false` to always return relative paths.
|
|
3352
|
+
*
|
|
3353
|
+
* When this option is not set, absolute paths are returned for patterns
|
|
3354
|
+
* that are absolute, and otherwise paths are returned that are relative
|
|
3355
|
+
* to the `cwd` setting.
|
|
3356
|
+
*
|
|
3357
|
+
* This does _not_ make an extra system call to get
|
|
3358
|
+
* the realpath, it only does string path resolution.
|
|
3359
|
+
*
|
|
3360
|
+
* Conflicts with {@link withFileTypes}
|
|
3361
|
+
*/
|
|
3362
|
+
absolute?: boolean;
|
|
3363
|
+
/**
|
|
3364
|
+
* Set to false to enable {@link windowsPathsNoEscape}
|
|
3365
|
+
*
|
|
3366
|
+
* @deprecated
|
|
3367
|
+
*/
|
|
3368
|
+
allowWindowsEscape?: boolean;
|
|
3369
|
+
/**
|
|
3370
|
+
* The current working directory in which to search. Defaults to
|
|
3371
|
+
* `process.cwd()`.
|
|
3372
|
+
*
|
|
3373
|
+
* May be eiher a string path or a `file://` URL object or string.
|
|
3374
|
+
*/
|
|
3375
|
+
cwd?: string | URL;
|
|
3376
|
+
/**
|
|
3377
|
+
* Include `.dot` files in normal matches and `globstar`
|
|
3378
|
+
* matches. Note that an explicit dot in a portion of the pattern
|
|
3379
|
+
* will always match dot files.
|
|
3380
|
+
*/
|
|
3381
|
+
dot?: boolean;
|
|
3382
|
+
/**
|
|
3383
|
+
* Prepend all relative path strings with `./` (or `.\` on Windows).
|
|
3384
|
+
*
|
|
3385
|
+
* Without this option, returned relative paths are "bare", so instead of
|
|
3386
|
+
* returning `'./foo/bar'`, they are returned as `'foo/bar'`.
|
|
3387
|
+
*
|
|
3388
|
+
* Relative patterns starting with `'../'` are not prepended with `./`, even
|
|
3389
|
+
* if this option is set.
|
|
3390
|
+
*/
|
|
3391
|
+
dotRelative?: boolean;
|
|
3392
|
+
/**
|
|
3393
|
+
* Follow symlinked directories when expanding `**`
|
|
3394
|
+
* patterns. This can result in a lot of duplicate references in
|
|
3395
|
+
* the presence of cyclic links, and make performance quite bad.
|
|
3396
|
+
*
|
|
3397
|
+
* By default, a `**` in a pattern will follow 1 symbolic link if
|
|
3398
|
+
* it is not the first item in the pattern, or none if it is the
|
|
3399
|
+
* first item in the pattern, following the same behavior as Bash.
|
|
3400
|
+
*/
|
|
3401
|
+
follow?: boolean;
|
|
3402
|
+
/**
|
|
3403
|
+
* string or string[], or an object with `ignored` and `childrenIgnored`
|
|
3404
|
+
* methods.
|
|
3405
|
+
*
|
|
3406
|
+
* If a string or string[] is provided, then this is treated as a glob
|
|
3407
|
+
* pattern or array of glob patterns to exclude from matches. To ignore all
|
|
3408
|
+
* children within a directory, as well as the entry itself, append `'/**'`
|
|
3409
|
+
* to the ignore pattern.
|
|
3410
|
+
*
|
|
3411
|
+
* **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of
|
|
3412
|
+
* any other settings.
|
|
3413
|
+
*
|
|
3414
|
+
* If an object is provided that has `ignored(path)` and/or
|
|
3415
|
+
* `childrenIgnored(path)` methods, then these methods will be called to
|
|
3416
|
+
* determine whether any Path is a match or if its children should be
|
|
3417
|
+
* traversed, respectively.
|
|
3418
|
+
*/
|
|
3419
|
+
ignore?: string | string[] | IgnoreLike;
|
|
3420
|
+
/**
|
|
3421
|
+
* Treat brace expansion like `{a,b}` as a "magic" pattern. Has no
|
|
3422
|
+
* effect if {@link nobrace} is set.
|
|
3423
|
+
*
|
|
3424
|
+
* Only has effect on the {@link hasMagic} function.
|
|
3425
|
+
*/
|
|
3426
|
+
magicalBraces?: boolean;
|
|
3427
|
+
/**
|
|
3428
|
+
* Add a `/` character to directory matches. Note that this requires
|
|
3429
|
+
* additional stat calls in some cases.
|
|
3430
|
+
*/
|
|
3431
|
+
mark?: boolean;
|
|
3432
|
+
/**
|
|
3433
|
+
* Perform a basename-only match if the pattern does not contain any slash
|
|
3434
|
+
* characters. That is, `*.js` would be treated as equivalent to
|
|
3435
|
+
* `**\/*.js`, matching all js files in all directories.
|
|
3436
|
+
*/
|
|
3437
|
+
matchBase?: boolean;
|
|
3438
|
+
/**
|
|
3439
|
+
* Limit the directory traversal to a given depth below the cwd.
|
|
3440
|
+
* Note that this does NOT prevent traversal to sibling folders,
|
|
3441
|
+
* root patterns, and so on. It only limits the maximum folder depth
|
|
3442
|
+
* that the walk will descend, relative to the cwd.
|
|
3443
|
+
*/
|
|
3444
|
+
maxDepth?: number;
|
|
3445
|
+
/**
|
|
3446
|
+
* Do not expand `{a,b}` and `{1..3}` brace sets.
|
|
3447
|
+
*/
|
|
3448
|
+
nobrace?: boolean;
|
|
3449
|
+
/**
|
|
3450
|
+
* Perform a case-insensitive match. This defaults to `true` on macOS and
|
|
3451
|
+
* Windows systems, and `false` on all others.
|
|
3452
|
+
*
|
|
3453
|
+
* **Note** `nocase` should only be explicitly set when it is
|
|
3454
|
+
* known that the filesystem's case sensitivity differs from the
|
|
3455
|
+
* platform default. If set `true` on case-sensitive file
|
|
3456
|
+
* systems, or `false` on case-insensitive file systems, then the
|
|
3457
|
+
* walk may return more or less results than expected.
|
|
3458
|
+
*/
|
|
3459
|
+
nocase?: boolean;
|
|
3460
|
+
/**
|
|
3461
|
+
* Do not match directories, only files. (Note: to match
|
|
3462
|
+
* _only_ directories, put a `/` at the end of the pattern.)
|
|
3463
|
+
*/
|
|
3464
|
+
nodir?: boolean;
|
|
3465
|
+
/**
|
|
3466
|
+
* Do not match "extglob" patterns such as `+(a|b)`.
|
|
3467
|
+
*/
|
|
3468
|
+
noext?: boolean;
|
|
3469
|
+
/**
|
|
3470
|
+
* Do not match `**` against multiple filenames. (Ie, treat it as a normal
|
|
3471
|
+
* `*` instead.)
|
|
3472
|
+
*
|
|
3473
|
+
* Conflicts with {@link matchBase}
|
|
3474
|
+
*/
|
|
3475
|
+
noglobstar?: boolean;
|
|
3476
|
+
/**
|
|
3477
|
+
* Defaults to value of `process.platform` if available, or `'linux'` if
|
|
3478
|
+
* not. Setting `platform:'win32'` on non-Windows systems may cause strange
|
|
3479
|
+
* behavior.
|
|
3480
|
+
*/
|
|
3481
|
+
platform?: NodeJS.Platform;
|
|
3482
|
+
/**
|
|
3483
|
+
* Set to true to call `fs.realpath` on all of the
|
|
3484
|
+
* results. In the case of an entry that cannot be resolved, the
|
|
3485
|
+
* entry is omitted. This incurs a slight performance penalty, of
|
|
3486
|
+
* course, because of the added system calls.
|
|
3487
|
+
*/
|
|
3488
|
+
realpath?: boolean;
|
|
3489
|
+
/**
|
|
3490
|
+
*
|
|
3491
|
+
* A string path resolved against the `cwd` option, which
|
|
3492
|
+
* is used as the starting point for absolute patterns that start
|
|
3493
|
+
* with `/`, (but not drive letters or UNC paths on Windows).
|
|
3494
|
+
*
|
|
3495
|
+
* Note that this _doesn't_ necessarily limit the walk to the
|
|
3496
|
+
* `root` directory, and doesn't affect the cwd starting point for
|
|
3497
|
+
* non-absolute patterns. A pattern containing `..` will still be
|
|
3498
|
+
* able to traverse out of the root directory, if it is not an
|
|
3499
|
+
* actual root directory on the filesystem, and any non-absolute
|
|
3500
|
+
* patterns will be matched in the `cwd`. For example, the
|
|
3501
|
+
* pattern `/../*` with `{root:'/some/path'}` will return all
|
|
3502
|
+
* files in `/some`, not all files in `/some/path`. The pattern
|
|
3503
|
+
* `*` with `{root:'/some/path'}` will return all the entries in
|
|
3504
|
+
* the cwd, not the entries in `/some/path`.
|
|
3505
|
+
*
|
|
3506
|
+
* To start absolute and non-absolute patterns in the same
|
|
3507
|
+
* path, you can use `{root:''}`. However, be aware that on
|
|
3508
|
+
* Windows systems, a pattern like `x:/*` or `//host/share/*` will
|
|
3509
|
+
* _always_ start in the `x:/` or `//host/share` directory,
|
|
3510
|
+
* regardless of the `root` setting.
|
|
3511
|
+
*/
|
|
3512
|
+
root?: string;
|
|
3513
|
+
/**
|
|
3514
|
+
* A [PathScurry](http://npm.im/path-scurry) object used
|
|
3515
|
+
* to traverse the file system. If the `nocase` option is set
|
|
3516
|
+
* explicitly, then any provided `scurry` object must match this
|
|
3517
|
+
* setting.
|
|
3518
|
+
*/
|
|
3519
|
+
scurry?: PathScurry;
|
|
3520
|
+
/**
|
|
3521
|
+
* Call `lstat()` on all entries, whether required or not to determine
|
|
3522
|
+
* if it's a valid match. When used with {@link withFileTypes}, this means
|
|
3523
|
+
* that matches will include data such as modified time, permissions, and
|
|
3524
|
+
* so on. Note that this will incur a performance cost due to the added
|
|
3525
|
+
* system calls.
|
|
3526
|
+
*/
|
|
3527
|
+
stat?: boolean;
|
|
3528
|
+
/**
|
|
3529
|
+
* An AbortSignal which will cancel the Glob walk when
|
|
3530
|
+
* triggered.
|
|
3531
|
+
*/
|
|
3532
|
+
signal?: AbortSignal;
|
|
3533
|
+
/**
|
|
3534
|
+
* Use `\\` as a path separator _only_, and
|
|
3535
|
+
* _never_ as an escape character. If set, all `\\` characters are
|
|
3536
|
+
* replaced with `/` in the pattern.
|
|
3537
|
+
*
|
|
3538
|
+
* Note that this makes it **impossible** to match against paths
|
|
3539
|
+
* containing literal glob pattern characters, but allows matching
|
|
3540
|
+
* with patterns constructed using `path.join()` and
|
|
3541
|
+
* `path.resolve()` on Windows platforms, mimicking the (buggy!)
|
|
3542
|
+
* behavior of Glob v7 and before on Windows. Please use with
|
|
3543
|
+
* caution, and be mindful of [the caveat below about Windows
|
|
3544
|
+
* paths](#windows). (For legacy reasons, this is also set if
|
|
3545
|
+
* `allowWindowsEscape` is set to the exact value `false`.)
|
|
3546
|
+
*/
|
|
3547
|
+
windowsPathsNoEscape?: boolean;
|
|
3548
|
+
/**
|
|
3549
|
+
* Return [PathScurry](http://npm.im/path-scurry)
|
|
3550
|
+
* `Path` objects instead of strings. These are similar to a
|
|
3551
|
+
* NodeJS `Dirent` object, but with additional methods and
|
|
3552
|
+
* properties.
|
|
3553
|
+
*
|
|
3554
|
+
* Conflicts with {@link absolute}
|
|
3555
|
+
*/
|
|
3556
|
+
withFileTypes?: boolean;
|
|
3557
|
+
/**
|
|
3558
|
+
* An fs implementation to override some or all of the defaults. See
|
|
3559
|
+
* http://npm.im/path-scurry for details about what can be overridden.
|
|
3560
|
+
*/
|
|
3561
|
+
fs?: FSOption;
|
|
3562
|
+
/**
|
|
3563
|
+
* Just passed along to Minimatch. Note that this makes all pattern
|
|
3564
|
+
* matching operations slower and *extremely* noisy.
|
|
3565
|
+
*/
|
|
3566
|
+
debug?: boolean;
|
|
3567
|
+
/**
|
|
3568
|
+
* Return `/` delimited paths, even on Windows.
|
|
3569
|
+
*
|
|
3570
|
+
* On posix systems, this has no effect. But, on Windows, it means that
|
|
3571
|
+
* paths will be `/` delimited, and absolute paths will be their full
|
|
3572
|
+
* resolved UNC forms, eg instead of `'C:\\foo\\bar'`, it would return
|
|
3573
|
+
* `'//?/C:/foo/bar'`
|
|
3574
|
+
*/
|
|
3575
|
+
posix?: boolean;
|
|
3576
|
+
/**
|
|
3577
|
+
* Do not match any children of any matches. For example, the pattern
|
|
3578
|
+
* `**\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode.
|
|
3579
|
+
*
|
|
3580
|
+
* This is especially useful for cases like "find all `node_modules`
|
|
3581
|
+
* folders, but not the ones in `node_modules`".
|
|
3582
|
+
*
|
|
3583
|
+
* In order to support this, the `Ignore` implementation must support an
|
|
3584
|
+
* `add(pattern: string)` method. If using the default `Ignore` class, then
|
|
3585
|
+
* this is fine, but if this is set to `false`, and a custom `Ignore` is
|
|
3586
|
+
* provided that does not have an `add()` method, then it will throw an
|
|
3587
|
+
* error.
|
|
3588
|
+
*
|
|
3589
|
+
* **Caveat** It *only* ignores matches that would be a descendant of a
|
|
3590
|
+
* previous match, and only if that descendant is matched *after* the
|
|
3591
|
+
* ancestor is encountered. Since the file system walk happens in
|
|
3592
|
+
* indeterminate order, it's possible that a match will already be added
|
|
3593
|
+
* before its ancestor, if multiple or braced patterns are used.
|
|
3594
|
+
*
|
|
3595
|
+
* For example:
|
|
3596
|
+
*
|
|
3597
|
+
* ```ts
|
|
3598
|
+
* const results = await glob([
|
|
3599
|
+
* // likely to match first, since it's just a stat
|
|
3600
|
+
* 'a/b/c/d/e/f',
|
|
3601
|
+
*
|
|
3602
|
+
* // this pattern is more complicated! It must to various readdir()
|
|
3603
|
+
* // calls and test the results against a regular expression, and that
|
|
3604
|
+
* // is certainly going to take a little bit longer.
|
|
3605
|
+
* //
|
|
3606
|
+
* // So, later on, it encounters a match at 'a/b/c/d/e', but it's too
|
|
3607
|
+
* // late to ignore a/b/c/d/e/f, because it's already been emitted.
|
|
3608
|
+
* 'a/[bdf]/?/[a-z]/*',
|
|
3609
|
+
* ], { includeChildMatches: false })
|
|
3610
|
+
* ```
|
|
3611
|
+
*
|
|
3612
|
+
* It's best to only set this to `false` if you can be reasonably sure that
|
|
3613
|
+
* no components of the pattern will potentially match one another's file
|
|
3614
|
+
* system descendants, or if the occasional included child entry will not
|
|
3615
|
+
* cause problems.
|
|
3616
|
+
*
|
|
3617
|
+
* @default true
|
|
3618
|
+
*/
|
|
3619
|
+
includeChildMatches?: boolean;
|
|
3620
|
+
/**
|
|
3621
|
+
* max number of `{...}` patterns to expand. Default `1_000`.
|
|
3622
|
+
*
|
|
3623
|
+
* Note: this is much less than minimatch's default of `100_000`,
|
|
3624
|
+
* because Glob has higher memory requirements due to walking
|
|
3625
|
+
* the file system tree.
|
|
3626
|
+
*/
|
|
3627
|
+
braceExpandMax?: number;
|
|
3628
|
+
}
|
|
3629
|
+
type GlobOptionsWithFileTypesTrue = GlobOptions & {
|
|
3630
|
+
withFileTypes: true;
|
|
3631
|
+
absolute?: undefined;
|
|
3632
|
+
mark?: undefined;
|
|
3633
|
+
posix?: undefined;
|
|
3634
|
+
};
|
|
3635
|
+
type GlobOptionsWithFileTypesFalse = GlobOptions & {
|
|
3636
|
+
withFileTypes?: false;
|
|
3637
|
+
};
|
|
3638
|
+
type GlobOptionsWithFileTypesUnset = GlobOptions & {
|
|
3639
|
+
withFileTypes?: undefined;
|
|
3640
|
+
};
|
|
3641
|
+
type Result<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? Path : Opts extends GlobOptionsWithFileTypesFalse ? string : Opts extends GlobOptionsWithFileTypesUnset ? string : string | Path;
|
|
3642
|
+
type Results<Opts> = Result<Opts>[];
|
|
3643
|
+
type FileTypes<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? true : Opts extends GlobOptionsWithFileTypesFalse ? false : Opts extends GlobOptionsWithFileTypesUnset ? false : boolean;
|
|
3644
|
+
/**
|
|
3645
|
+
* An object that can perform glob pattern traversals.
|
|
3646
|
+
*/
|
|
3647
|
+
declare class Glob<Opts extends GlobOptions> implements GlobOptions {
|
|
3648
|
+
absolute?: boolean;
|
|
3649
|
+
cwd: string;
|
|
3650
|
+
root?: string;
|
|
3651
|
+
dot: boolean;
|
|
3652
|
+
dotRelative: boolean;
|
|
3653
|
+
follow: boolean;
|
|
3654
|
+
ignore?: string | string[] | IgnoreLike;
|
|
3655
|
+
magicalBraces: boolean;
|
|
3656
|
+
mark?: boolean;
|
|
3657
|
+
matchBase: boolean;
|
|
3658
|
+
maxDepth: number;
|
|
3659
|
+
nobrace: boolean;
|
|
3660
|
+
nocase: boolean;
|
|
3661
|
+
nodir: boolean;
|
|
3662
|
+
noext: boolean;
|
|
3663
|
+
noglobstar: boolean;
|
|
3664
|
+
pattern: string[];
|
|
3665
|
+
platform: NodeJS.Platform;
|
|
3666
|
+
realpath: boolean;
|
|
3667
|
+
scurry: PathScurry;
|
|
3668
|
+
stat: boolean;
|
|
3669
|
+
signal?: AbortSignal;
|
|
3670
|
+
windowsPathsNoEscape: boolean;
|
|
3671
|
+
withFileTypes: FileTypes<Opts>;
|
|
3672
|
+
includeChildMatches: boolean;
|
|
3673
|
+
/**
|
|
3674
|
+
* The options provided to the constructor.
|
|
3675
|
+
*/
|
|
3676
|
+
opts: Opts;
|
|
3677
|
+
/**
|
|
3678
|
+
* An array of parsed immutable {@link Pattern} objects.
|
|
3679
|
+
*/
|
|
3680
|
+
patterns: Pattern[];
|
|
3681
|
+
/**
|
|
3682
|
+
* All options are stored as properties on the `Glob` object.
|
|
3683
|
+
*
|
|
3684
|
+
* See {@link GlobOptions} for full options descriptions.
|
|
3685
|
+
*
|
|
3686
|
+
* Note that a previous `Glob` object can be passed as the
|
|
3687
|
+
* `GlobOptions` to another `Glob` instantiation to re-use settings
|
|
3688
|
+
* and caches with a new pattern.
|
|
3689
|
+
*
|
|
3690
|
+
* Traversal functions can be called multiple times to run the walk
|
|
3691
|
+
* again.
|
|
3692
|
+
*/
|
|
3693
|
+
constructor(pattern: string | string[], opts: Opts);
|
|
3694
|
+
/**
|
|
3695
|
+
* Returns a Promise that resolves to the results array.
|
|
3696
|
+
*/
|
|
3697
|
+
walk(): Promise<Results<Opts>>;
|
|
3698
|
+
/**
|
|
3699
|
+
* synchronous {@link Glob.walk}
|
|
3700
|
+
*/
|
|
3701
|
+
walkSync(): Results<Opts>;
|
|
3702
|
+
/**
|
|
3703
|
+
* Stream results asynchronously.
|
|
3704
|
+
*/
|
|
3705
|
+
stream(): Minipass<Result<Opts>, Result<Opts>>;
|
|
3706
|
+
/**
|
|
3707
|
+
* Stream results synchronously.
|
|
3708
|
+
*/
|
|
3709
|
+
streamSync(): Minipass<Result<Opts>, Result<Opts>>;
|
|
3710
|
+
/**
|
|
3711
|
+
* Default sync iteration function. Returns a Generator that
|
|
3712
|
+
* iterates over the results.
|
|
3713
|
+
*/
|
|
3714
|
+
iterateSync(): Generator<Result<Opts>, void, void>;
|
|
3715
|
+
[Symbol.iterator](): Generator<Result<Opts>, void, void>;
|
|
3716
|
+
/**
|
|
3717
|
+
* Default async iteration function. Returns an AsyncGenerator that
|
|
3718
|
+
* iterates over the results.
|
|
3719
|
+
*/
|
|
3720
|
+
iterate(): AsyncGenerator<Result<Opts>, void, void>;
|
|
3721
|
+
[Symbol.asyncIterator](): AsyncGenerator<Result<Opts>, void, void>;
|
|
3722
|
+
}
|
|
3723
|
+
|
|
3724
|
+
/**
|
|
3725
|
+
* Return true if the patterns provided contain any magic glob characters,
|
|
3726
|
+
* given the options provided.
|
|
3727
|
+
*
|
|
3728
|
+
* Brace expansion is not considered "magic" unless the `magicalBraces` option
|
|
3729
|
+
* is set, as brace expansion just turns one string into an array of strings.
|
|
3730
|
+
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
|
|
3731
|
+
* `'xby'` both do not contain any magic glob characters, and it's treated the
|
|
3732
|
+
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
|
|
3733
|
+
* is in the options, brace expansion _is_ treated as a pattern having magic.
|
|
3734
|
+
*/
|
|
3735
|
+
declare const hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
|
|
3736
|
+
|
|
3737
|
+
/**
|
|
3738
|
+
* Syncronous form of {@link globStream}. Will read all the matches as fast as
|
|
3739
|
+
* you consume them, even all in a single tick if you consume them immediately,
|
|
3740
|
+
* but will still respond to backpressure if they're not consumed immediately.
|
|
3741
|
+
*/
|
|
3742
|
+
declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
|
|
3743
|
+
declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
|
|
3744
|
+
declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesUnset): Minipass<string, string>;
|
|
3745
|
+
declare function globStreamSync(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
|
|
3746
|
+
/**
|
|
3747
|
+
* Return a stream that emits all the strings or `Path` objects and
|
|
3748
|
+
* then emits `end` when completed.
|
|
3749
|
+
*/
|
|
3750
|
+
declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
|
|
3751
|
+
declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
|
|
3752
|
+
declare function globStream(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Minipass<string, string>;
|
|
3753
|
+
declare function globStream(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
|
|
3754
|
+
/**
|
|
3755
|
+
* Synchronous form of {@link glob}
|
|
3756
|
+
*/
|
|
3757
|
+
declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): string[];
|
|
3758
|
+
declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Path[];
|
|
3759
|
+
declare function globSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): string[];
|
|
3760
|
+
declare function globSync(pattern: string | string[], options: GlobOptions): Path[] | string[];
|
|
3761
|
+
/**
|
|
3762
|
+
* Perform an asynchronous glob search for the pattern(s) specified. Returns
|
|
3763
|
+
* [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the
|
|
3764
|
+
* {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for
|
|
3765
|
+
* full option descriptions.
|
|
3766
|
+
*/
|
|
3767
|
+
declare function glob_(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Promise<string[]>;
|
|
3768
|
+
declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Promise<Path[]>;
|
|
3769
|
+
declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Promise<string[]>;
|
|
3770
|
+
declare function glob_(pattern: string | string[], options: GlobOptions): Promise<Path[] | string[]>;
|
|
3771
|
+
/**
|
|
3772
|
+
* Return a sync iterator for walking glob pattern matches.
|
|
3773
|
+
*/
|
|
3774
|
+
declare function globIterateSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Generator<string, void, void>;
|
|
3775
|
+
declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Generator<Path, void, void>;
|
|
3776
|
+
declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Generator<string, void, void>;
|
|
3777
|
+
declare function globIterateSync(pattern: string | string[], options: GlobOptions): Generator<Path, void, void> | Generator<string, void, void>;
|
|
3778
|
+
/**
|
|
3779
|
+
* Return an async iterator for walking glob pattern matches.
|
|
3780
|
+
*/
|
|
3781
|
+
declare function globIterate(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): AsyncGenerator<string, void, void>;
|
|
3782
|
+
declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): AsyncGenerator<Path, void, void>;
|
|
3783
|
+
declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): AsyncGenerator<string, void, void>;
|
|
3784
|
+
declare function globIterate(pattern: string | string[], options: GlobOptions): AsyncGenerator<Path, void, void> | AsyncGenerator<string, void, void>;
|
|
3785
|
+
declare const streamSync: typeof globStreamSync;
|
|
3786
|
+
declare const stream: typeof globStream & {
|
|
3787
|
+
sync: typeof globStreamSync;
|
|
3788
|
+
};
|
|
3789
|
+
declare const iterateSync: typeof globIterateSync;
|
|
3790
|
+
declare const iterate: typeof globIterate & {
|
|
3791
|
+
sync: typeof globIterateSync;
|
|
3792
|
+
};
|
|
3793
|
+
declare const sync: typeof globSync & {
|
|
3794
|
+
stream: typeof globStreamSync;
|
|
3795
|
+
iterate: typeof globIterateSync;
|
|
3796
|
+
};
|
|
3797
|
+
declare const glob: typeof glob_ & {
|
|
3798
|
+
glob: typeof glob_;
|
|
3799
|
+
globSync: typeof globSync;
|
|
3800
|
+
sync: typeof globSync & {
|
|
3801
|
+
stream: typeof globStreamSync;
|
|
3802
|
+
iterate: typeof globIterateSync;
|
|
3803
|
+
};
|
|
3804
|
+
globStream: typeof globStream;
|
|
3805
|
+
stream: typeof globStream & {
|
|
3806
|
+
sync: typeof globStreamSync;
|
|
3807
|
+
};
|
|
3808
|
+
globStreamSync: typeof globStreamSync;
|
|
3809
|
+
streamSync: typeof globStreamSync;
|
|
3810
|
+
globIterate: typeof globIterate;
|
|
3811
|
+
iterate: typeof globIterate & {
|
|
3812
|
+
sync: typeof globIterateSync;
|
|
3813
|
+
};
|
|
3814
|
+
globIterateSync: typeof globIterateSync;
|
|
3815
|
+
iterateSync: typeof globIterateSync;
|
|
3816
|
+
Glob: typeof Glob;
|
|
3817
|
+
hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
|
|
3818
|
+
escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
|
3819
|
+
unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
|
3820
|
+
};
|
|
3821
|
+
|
|
3822
|
+
export { Glob, Ignore, Path, escape, glob, globIterate, globIterateSync, globStream, globStreamSync, globSync, hasMagic, iterate, iterateSync, stream, streamSync, sync, unescape };
|
|
3823
|
+
export type { FSOption, GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset, IgnoreLike, MatchStream, WalkOptions, WalkOptionsWithFileTypesTrue, WalkOptionsWithFileTypesUnset };
|