@quantiya/codevibe-claude-plugin 2.0.26 → 2.0.27
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/.claude-plugin/plugin.json +1 -1
- package/node_modules/@quantiya/codevibe-core/dist/__tests__/terminal-menu.test.d.ts +1 -0
- package/node_modules/@quantiya/codevibe-core/dist/index.d.ts +2 -0
- package/node_modules/@quantiya/codevibe-core/dist/index.js +321 -317
- package/node_modules/@quantiya/codevibe-core/dist/prompt-parser.d.ts +3 -1
- package/node_modules/@quantiya/codevibe-core/dist/terminal-menu.d.ts +22 -0
- package/node_modules/@quantiya/codevibe-core/package.json +1 -1
- package/node_modules/es-toolkit/CHANGELOG.md +38 -3
- package/node_modules/es-toolkit/dist/browser.global.js +4 -4
- package/node_modules/es-toolkit/dist/compat/array/differenceWith.js +2 -1
- package/node_modules/es-toolkit/dist/compat/array/differenceWith.mjs +2 -1
- package/node_modules/es-toolkit/dist/compat/array/findLastIndex.js +5 -3
- package/node_modules/es-toolkit/dist/compat/array/findLastIndex.mjs +5 -3
- package/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.js +1 -1
- package/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.mjs +1 -1
- package/node_modules/es-toolkit/dist/compat/array/without.js +8 -2
- package/node_modules/es-toolkit/dist/compat/array/without.mjs +8 -2
- package/node_modules/es-toolkit/dist/compat/array/xorWith.js +4 -6
- package/node_modules/es-toolkit/dist/compat/array/xorWith.mjs +4 -6
- package/node_modules/es-toolkit/dist/compat/compat.js +1 -1
- package/node_modules/es-toolkit/dist/compat/compat.mjs +1 -1
- package/node_modules/es-toolkit/dist/compat/function/debounce.js +1 -1
- package/node_modules/es-toolkit/dist/compat/function/debounce.mjs +1 -1
- package/node_modules/es-toolkit/dist/compat/index.js +1 -1
- package/node_modules/es-toolkit/dist/compat/index.mjs +1 -1
- package/node_modules/es-toolkit/dist/compat/object/has.js +3 -2
- package/node_modules/es-toolkit/dist/compat/object/has.mjs +3 -2
- package/node_modules/es-toolkit/dist/compat/object/hasIn.js +3 -2
- package/node_modules/es-toolkit/dist/compat/object/hasIn.mjs +3 -2
- package/node_modules/es-toolkit/dist/compat/object/mergeWith.js +1 -1
- package/node_modules/es-toolkit/dist/compat/object/mergeWith.mjs +1 -1
- package/node_modules/es-toolkit/dist/compat/object/omitBy.js +1 -1
- package/node_modules/es-toolkit/dist/compat/object/omitBy.mjs +1 -1
- package/node_modules/es-toolkit/dist/compat/object/pickBy.js +1 -1
- package/node_modules/es-toolkit/dist/compat/object/pickBy.mjs +1 -1
- package/node_modules/es-toolkit/dist/compat/util/toString.js +3 -1
- package/node_modules/es-toolkit/dist/compat/util/toString.mjs +3 -1
- package/node_modules/es-toolkit/dist/fp/flowAsync.d.mts +213 -0
- package/node_modules/es-toolkit/dist/fp/flowAsync.d.ts +213 -0
- package/node_modules/es-toolkit/dist/fp/flowAsync.js +37 -0
- package/node_modules/es-toolkit/dist/fp/flowAsync.mjs +37 -0
- package/node_modules/es-toolkit/dist/fp/index.d.mts +2 -1
- package/node_modules/es-toolkit/dist/fp/index.d.ts +2 -1
- package/node_modules/es-toolkit/dist/fp/index.js +2 -0
- package/node_modules/es-toolkit/dist/fp/index.mjs +2 -1
- package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.d.mts +23 -0
- package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.d.ts +23 -0
- package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.js +28 -0
- package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.mjs +28 -0
- package/node_modules/es-toolkit/dist/fp/iterator/chunk.d.mts +19 -0
- package/node_modules/es-toolkit/dist/fp/iterator/chunk.d.ts +19 -0
- package/node_modules/es-toolkit/dist/fp/iterator/chunk.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/chunk.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/count.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/count.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/count.js +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/count.mjs +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/drop.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/drop.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/drop.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/drop.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.d.mts +18 -0
- package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.d.ts +18 -0
- package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.js +23 -0
- package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.mjs +23 -0
- package/node_modules/es-toolkit/dist/fp/iterator/every.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/every.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/every.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/every.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/filter.d.mts +37 -0
- package/node_modules/es-toolkit/dist/fp/iterator/filter.d.ts +37 -0
- package/node_modules/es-toolkit/dist/fp/iterator/filter.js +8 -0
- package/node_modules/es-toolkit/dist/fp/iterator/filter.mjs +8 -0
- package/node_modules/es-toolkit/dist/fp/iterator/find.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/find.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/find.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/find.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/flatMap.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/flatMap.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/flatMap.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/flatMap.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/forEach.d.mts +22 -0
- package/node_modules/es-toolkit/dist/fp/iterator/forEach.d.ts +22 -0
- package/node_modules/es-toolkit/dist/fp/iterator/forEach.js +26 -0
- package/node_modules/es-toolkit/dist/fp/iterator/forEach.mjs +26 -0
- package/node_modules/es-toolkit/dist/fp/iterator/head.d.mts +19 -0
- package/node_modules/es-toolkit/dist/fp/iterator/head.d.ts +19 -0
- package/node_modules/es-toolkit/dist/fp/iterator/head.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/head.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/index.d.mts +22 -0
- package/node_modules/es-toolkit/dist/fp/iterator/index.d.ts +22 -0
- package/node_modules/es-toolkit/dist/fp/iterator/index.js +43 -0
- package/node_modules/es-toolkit/dist/fp/iterator/index.mjs +22 -0
- package/node_modules/es-toolkit/dist/fp/iterator/map.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/map.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/map.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/map.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/partition.d.mts +22 -0
- package/node_modules/es-toolkit/dist/fp/iterator/partition.d.ts +22 -0
- package/node_modules/es-toolkit/dist/fp/iterator/partition.js +27 -0
- package/node_modules/es-toolkit/dist/fp/iterator/partition.mjs +27 -0
- package/node_modules/es-toolkit/dist/fp/iterator/reduce.d.mts +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/reduce.d.ts +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/reduce.js +28 -0
- package/node_modules/es-toolkit/dist/fp/iterator/reduce.mjs +28 -0
- package/node_modules/es-toolkit/dist/fp/iterator/scan.d.mts +21 -0
- package/node_modules/es-toolkit/dist/fp/iterator/scan.d.ts +21 -0
- package/node_modules/es-toolkit/dist/fp/iterator/scan.js +26 -0
- package/node_modules/es-toolkit/dist/fp/iterator/scan.mjs +26 -0
- package/node_modules/es-toolkit/dist/fp/iterator/some.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/some.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/some.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/some.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/take.d.mts +21 -0
- package/node_modules/es-toolkit/dist/fp/iterator/take.d.ts +21 -0
- package/node_modules/es-toolkit/dist/fp/iterator/take.js +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/take.mjs +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.d.mts +19 -0
- package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.d.ts +19 -0
- package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/toArray.d.mts +21 -0
- package/node_modules/es-toolkit/dist/fp/iterator/toArray.d.ts +21 -0
- package/node_modules/es-toolkit/dist/fp/iterator/toArray.js +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/toArray.mjs +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.js +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.mjs +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/zip.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/zip.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/zip.js +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/zip.mjs +25 -0
- package/node_modules/es-toolkit/dist/index.d.mts +3 -1
- package/node_modules/es-toolkit/dist/index.d.ts +3 -1
- package/node_modules/es-toolkit/dist/index.js +4 -0
- package/node_modules/es-toolkit/dist/index.mjs +3 -1
- package/node_modules/es-toolkit/dist/iterator/_internal/iterator.js +74 -0
- package/node_modules/es-toolkit/dist/iterator/_internal/iterator.mjs +74 -0
- package/node_modules/es-toolkit/dist/iterator/cartesianProduct.d.mts +33 -0
- package/node_modules/es-toolkit/dist/iterator/cartesianProduct.d.ts +33 -0
- package/node_modules/es-toolkit/dist/iterator/cartesianProduct.js +95 -0
- package/node_modules/es-toolkit/dist/iterator/cartesianProduct.mjs +95 -0
- package/node_modules/es-toolkit/dist/iterator/chunk.d.mts +21 -0
- package/node_modules/es-toolkit/dist/iterator/chunk.d.ts +21 -0
- package/node_modules/es-toolkit/dist/iterator/chunk.js +40 -0
- package/node_modules/es-toolkit/dist/iterator/chunk.mjs +40 -0
- package/node_modules/es-toolkit/dist/iterator/count.d.mts +18 -0
- package/node_modules/es-toolkit/dist/iterator/count.d.ts +18 -0
- package/node_modules/es-toolkit/dist/iterator/count.js +26 -0
- package/node_modules/es-toolkit/dist/iterator/count.mjs +26 -0
- package/node_modules/es-toolkit/dist/iterator/dropWhile.d.mts +20 -0
- package/node_modules/es-toolkit/dist/iterator/dropWhile.d.ts +20 -0
- package/node_modules/es-toolkit/dist/iterator/dropWhile.js +52 -0
- package/node_modules/es-toolkit/dist/iterator/dropWhile.mjs +52 -0
- package/node_modules/es-toolkit/dist/iterator/head.d.mts +21 -0
- package/node_modules/es-toolkit/dist/iterator/head.d.ts +21 -0
- package/node_modules/es-toolkit/dist/iterator/head.js +26 -0
- package/node_modules/es-toolkit/dist/iterator/head.mjs +26 -0
- package/node_modules/es-toolkit/dist/iterator/index.d.mts +13 -0
- package/node_modules/es-toolkit/dist/iterator/index.d.ts +13 -0
- package/node_modules/es-toolkit/dist/iterator/index.js +25 -0
- package/node_modules/es-toolkit/dist/iterator/index.mjs +13 -0
- package/node_modules/es-toolkit/dist/iterator/iterate.d.mts +20 -0
- package/node_modules/es-toolkit/dist/iterator/iterate.d.ts +20 -0
- package/node_modules/es-toolkit/dist/iterator/iterate.js +32 -0
- package/node_modules/es-toolkit/dist/iterator/iterate.mjs +32 -0
- package/node_modules/es-toolkit/dist/iterator/partition.d.mts +18 -0
- package/node_modules/es-toolkit/dist/iterator/partition.d.ts +18 -0
- package/node_modules/es-toolkit/dist/iterator/partition.js +36 -0
- package/node_modules/es-toolkit/dist/iterator/partition.mjs +36 -0
- package/node_modules/es-toolkit/dist/iterator/range.d.mts +42 -0
- package/node_modules/es-toolkit/dist/iterator/range.d.ts +42 -0
- package/node_modules/es-toolkit/dist/iterator/range.js +25 -0
- package/node_modules/es-toolkit/dist/iterator/range.mjs +25 -0
- package/node_modules/es-toolkit/dist/iterator/scan.d.mts +23 -0
- package/node_modules/es-toolkit/dist/iterator/scan.d.ts +23 -0
- package/node_modules/es-toolkit/dist/iterator/scan.js +47 -0
- package/node_modules/es-toolkit/dist/iterator/scan.mjs +47 -0
- package/node_modules/es-toolkit/dist/iterator/takeWhile.d.mts +20 -0
- package/node_modules/es-toolkit/dist/iterator/takeWhile.d.ts +20 -0
- package/node_modules/es-toolkit/dist/iterator/takeWhile.js +34 -0
- package/node_modules/es-toolkit/dist/iterator/takeWhile.mjs +34 -0
- package/node_modules/es-toolkit/dist/iterator/uniqBy.d.mts +22 -0
- package/node_modules/es-toolkit/dist/iterator/uniqBy.d.ts +22 -0
- package/node_modules/es-toolkit/dist/iterator/uniqBy.js +43 -0
- package/node_modules/es-toolkit/dist/iterator/uniqBy.mjs +43 -0
- package/node_modules/es-toolkit/dist/iterator/zip.d.mts +23 -0
- package/node_modules/es-toolkit/dist/iterator/zip.d.ts +23 -0
- package/node_modules/es-toolkit/dist/iterator/zip.js +45 -0
- package/node_modules/es-toolkit/dist/iterator/zip.mjs +45 -0
- package/node_modules/es-toolkit/dist/object/merge.d.mts +3 -1
- package/node_modules/es-toolkit/dist/object/merge.d.ts +3 -1
- package/node_modules/es-toolkit/dist/object/merge.js +0 -40
- package/node_modules/es-toolkit/dist/object/merge.mjs +0 -40
- package/node_modules/es-toolkit/dist/object/omitBy.d.mts +4 -2
- package/node_modules/es-toolkit/dist/object/omitBy.d.ts +4 -2
- package/node_modules/es-toolkit/dist/object/omitBy.js +4 -3
- package/node_modules/es-toolkit/dist/object/omitBy.mjs +4 -3
- package/node_modules/es-toolkit/dist/object/pickBy.d.mts +4 -2
- package/node_modules/es-toolkit/dist/object/pickBy.d.ts +4 -2
- package/node_modules/es-toolkit/dist/object/pickBy.js +4 -3
- package/node_modules/es-toolkit/dist/object/pickBy.mjs +4 -3
- package/node_modules/es-toolkit/dist/types/EmptyObject.d.mts +21 -0
- package/node_modules/es-toolkit/dist/types/EmptyObject.d.ts +21 -0
- package/node_modules/es-toolkit/dist/types/IsEqual.d.mts +18 -0
- package/node_modules/es-toolkit/dist/types/IsEqual.d.ts +18 -0
- package/node_modules/es-toolkit/dist/types/JSONValue.d.mts +24 -0
- package/node_modules/es-toolkit/dist/types/JSONValue.d.ts +24 -0
- package/node_modules/es-toolkit/dist/types/Merge.d.mts +37 -0
- package/node_modules/es-toolkit/dist/types/Merge.d.ts +37 -0
- package/node_modules/es-toolkit/dist/types/ObjectKeys.d.mts +19 -0
- package/node_modules/es-toolkit/dist/types/ObjectKeys.d.ts +19 -0
- package/node_modules/es-toolkit/dist/types/Primitive.d.mts +14 -0
- package/node_modules/es-toolkit/dist/types/Primitive.d.ts +14 -0
- package/node_modules/es-toolkit/dist/types/SetOptional.d.mts +20 -0
- package/node_modules/es-toolkit/dist/types/SetOptional.d.ts +20 -0
- package/node_modules/es-toolkit/dist/types/SetRequired.d.mts +20 -0
- package/node_modules/es-toolkit/dist/types/SetRequired.d.ts +20 -0
- package/node_modules/es-toolkit/dist/types/UnknownRecord.d.mts +24 -0
- package/node_modules/es-toolkit/dist/types/UnknownRecord.d.ts +24 -0
- package/node_modules/es-toolkit/dist/types/index.d.mts +11 -2
- package/node_modules/es-toolkit/dist/types/index.d.ts +11 -2
- package/node_modules/es-toolkit/dist/util/attempt.d.mts +1 -1
- package/node_modules/es-toolkit/dist/util/attempt.d.ts +1 -1
- package/node_modules/es-toolkit/dist/util/attemptAsync.d.mts +1 -1
- package/node_modules/es-toolkit/dist/util/attemptAsync.d.ts +1 -1
- package/node_modules/es-toolkit/dist/util/defer.d.mts +27 -0
- package/node_modules/es-toolkit/dist/util/defer.d.ts +27 -0
- package/node_modules/es-toolkit/dist/util/defer.js +31 -0
- package/node_modules/es-toolkit/dist/util/defer.mjs +31 -0
- package/node_modules/es-toolkit/dist/util/deferAsync.d.mts +30 -0
- package/node_modules/es-toolkit/dist/util/deferAsync.d.ts +30 -0
- package/node_modules/es-toolkit/dist/util/deferAsync.js +34 -0
- package/node_modules/es-toolkit/dist/util/deferAsync.mjs +34 -0
- package/node_modules/es-toolkit/dist/util/index.d.mts +3 -1
- package/node_modules/es-toolkit/dist/util/index.d.ts +3 -1
- package/node_modules/es-toolkit/dist/util/index.js +4 -0
- package/node_modules/es-toolkit/dist/util/index.mjs +3 -1
- package/node_modules/es-toolkit/fp/iterator.d.ts +1 -0
- package/node_modules/es-toolkit/fp/iterator.js +1 -0
- package/node_modules/es-toolkit/iterator.d.ts +1 -0
- package/node_modules/es-toolkit/iterator.js +1 -0
- package/node_modules/es-toolkit/package.json +44 -1
- package/node_modules/node-abi/abi_registry.json +7 -0
- package/node_modules/node-abi/package.json +1 -1
- package/node_modules/qs/.github/THREAT_MODEL.md +3 -3
- package/node_modules/qs/CHANGELOG.md +15 -0
- package/node_modules/qs/README.md +19 -1
- package/node_modules/qs/dist/qs.js +21 -21
- package/node_modules/qs/eslint.config.mjs +1 -1
- package/node_modules/qs/lib/parse.js +3 -4
- package/node_modules/qs/lib/stringify.js +23 -8
- package/node_modules/qs/lib/utils.js +10 -3
- package/node_modules/qs/package.json +4 -4
- package/node_modules/qs/test/parse.js +192 -3
- package/node_modules/qs/test/stringify.js +317 -0
- package/node_modules/qs/test/utils.js +12 -0
- package/node_modules/type-fest/index.d.ts +6 -7
- package/node_modules/type-fest/package.json +1 -1
- package/node_modules/type-fest/readme.md +6 -5
- package/node_modules/type-fest/source/delimiter-case.d.ts +1 -1
- package/node_modules/type-fest/source/get.d.ts +1 -1
- package/node_modules/type-fest/source/internal/object.d.ts +30 -1
- package/node_modules/type-fest/source/is-boolean-literal.d.ts +39 -0
- package/node_modules/type-fest/source/is-literal.d.ts +43 -269
- package/node_modules/type-fest/source/is-numeric-literal.d.ts +50 -0
- package/node_modules/type-fest/source/is-string-literal.d.ts +72 -0
- package/node_modules/type-fest/source/is-symbol-literal.d.ts +39 -0
- package/node_modules/type-fest/source/jsonify.d.ts +1 -5
- package/node_modules/type-fest/source/remove-prefix.d.ts +1 -1
- package/node_modules/type-fest/source/remove-suffix.d.ts +1 -1
- package/node_modules/type-fest/source/rename-keys.d.ts +163 -0
- package/node_modules/type-fest/source/shared-union-fields-deep.d.ts +4 -3
- package/node_modules/type-fest/source/split.d.ts +1 -1
- package/node_modules/type-fest/source/string-repeat.d.ts +1 -1
- package/node_modules/type-fest/source/string-to-array.d.ts +1 -1
- package/node_modules/type-fest/source/tsconfig-json.d.ts +1 -1
- package/node_modules/type-fest/source/typed-array.d.ts +1 -0
- package/node_modules/type-fest/source/writable.d.ts +2 -2
- package/package.json +2 -2
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/LICENSE.md +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/README.md +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/common.gypi +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/except.gypi +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/index.js +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/napi-inl.deprecated.h +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/napi-inl.h +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/napi.h +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/node_api.gyp +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/noexcept.gypi +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/nothing.c +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/package-support.json +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/package.json +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/tools/README.md +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/tools/check-napi.js +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/tools/clang-format.js +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/tools/conversion.js +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/tools/eslint-format.js +0 -0
|
@@ -136,6 +136,144 @@ test('stringify()', function (t) {
|
|
|
136
136
|
st.end();
|
|
137
137
|
});
|
|
138
138
|
|
|
139
|
+
t.test('encodes dot in key of object with a primitive value when encodeDotInKeys and allowDots is provided', function (st) {
|
|
140
|
+
st.equal(
|
|
141
|
+
qs.stringify(
|
|
142
|
+
{ 'name.obj': 'John' },
|
|
143
|
+
{ allowDots: true, encodeDotInKeys: true }
|
|
144
|
+
),
|
|
145
|
+
'name%252Eobj=John',
|
|
146
|
+
'with allowDots true and encodeDotInKeys true'
|
|
147
|
+
);
|
|
148
|
+
st.equal(
|
|
149
|
+
qs.stringify(
|
|
150
|
+
{ 'name.obj': 'John' },
|
|
151
|
+
{ allowDots: false, encodeDotInKeys: true }
|
|
152
|
+
),
|
|
153
|
+
'name%252Eobj=John',
|
|
154
|
+
'with allowDots false and encodeDotInKeys true'
|
|
155
|
+
);
|
|
156
|
+
st.equal(
|
|
157
|
+
qs.stringify(
|
|
158
|
+
{ 'name.obj': 'John' },
|
|
159
|
+
{ encodeDotInKeys: true, allowDots: true, encodeValuesOnly: true }
|
|
160
|
+
),
|
|
161
|
+
'name%2Eobj=John',
|
|
162
|
+
'with encodeValuesOnly true'
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
// With `encodeValuesOnly` the key encoder is skipped, so the dot is encoded once
|
|
166
|
+
// (`%2E`) rather than twice. That single `%2E` decodes back to a structural dot, so
|
|
167
|
+
// unlike the default output below this does not round-trip to the original dotted key
|
|
168
|
+
// (a pre-existing `encodeValuesOnly` + `encodeDotInKeys` limitation, not new here).
|
|
169
|
+
st.deepEqual(
|
|
170
|
+
qs.parse(
|
|
171
|
+
qs.stringify(
|
|
172
|
+
{ 'name.obj': 'John' },
|
|
173
|
+
{ encodeDotInKeys: true, allowDots: true, encodeValuesOnly: true }
|
|
174
|
+
),
|
|
175
|
+
{ allowDots: true, decodeDotInKeys: true }
|
|
176
|
+
),
|
|
177
|
+
{ name: { obj: 'John' } },
|
|
178
|
+
'with encodeValuesOnly the single-encoded dot decodes structurally (does not round-trip)'
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
st.deepEqual(
|
|
182
|
+
qs.parse(
|
|
183
|
+
qs.stringify({ 'name.obj': 'John' }, { allowDots: true, encodeDotInKeys: true }),
|
|
184
|
+
{ allowDots: true, decodeDotInKeys: true }
|
|
185
|
+
),
|
|
186
|
+
{ 'name.obj': 'John' },
|
|
187
|
+
'round-trips a dotted key with a primitive value'
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
st.equal(
|
|
191
|
+
qs.stringify({ 'a.b': null }, { allowDots: true, encodeDotInKeys: true, strictNullHandling: true }),
|
|
192
|
+
'a%252Eb',
|
|
193
|
+
'encodes a dotted key with a null value'
|
|
194
|
+
);
|
|
195
|
+
st.equal(
|
|
196
|
+
qs.stringify({ 'a.b': '1', 'c.d': '2' }, { allowDots: true, encodeDotInKeys: true }),
|
|
197
|
+
'a%252Eb=1&c%252Ed=2',
|
|
198
|
+
'encodes dots in every top-level key, not just the first'
|
|
199
|
+
);
|
|
200
|
+
st.equal(
|
|
201
|
+
qs.stringify({ 'a.b.c': 'x' }, { allowDots: true, encodeDotInKeys: true }),
|
|
202
|
+
'a%252Eb%252Ec=x',
|
|
203
|
+
'encodes every dot in a key'
|
|
204
|
+
);
|
|
205
|
+
var primitiveKey = qs.stringify({ 'a.b': 'c' }, { allowDots: true, encodeDotInKeys: true }).split('=')[0];
|
|
206
|
+
st.equal(
|
|
207
|
+
qs.stringify({ 'a.b': { x: 'c' } }, { allowDots: true, encodeDotInKeys: true }).indexOf(primitiveKey + '.'),
|
|
208
|
+
0,
|
|
209
|
+
'a top-level dotted key encodes identically for primitive and object values'
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
st.end();
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
// Characterization of the CURRENT (buggy) behavior: with `allowDots` + `encodeDotInKeys`,
|
|
216
|
+
// `stringify` percent-encodes the structural `.` separators that `allowDots` inserts between
|
|
217
|
+
// nested keys, not just the literal dots inside a key, which breaks the stringify -> parse
|
|
218
|
+
// round-trip. These assertions pin that behavior so it cannot change silently: the fix in
|
|
219
|
+
// https://github.com/ljharb/qs/pull/564 changes every output below, so landing that fix MUST
|
|
220
|
+
// update this test (that is the point — it forces the behavior change to be explicit).
|
|
221
|
+
t.test('[characterization] encodeDotInKeys currently over-encodes structural separator dots (pre-#564)', function (st) {
|
|
222
|
+
st.equal(
|
|
223
|
+
qs.stringify({ a: { b: { c: 'd' } } }, { allowDots: true, encodeDotInKeys: true }),
|
|
224
|
+
'a%252Eb.c=d',
|
|
225
|
+
'over-encodes the a->b separator (#564: should become a.b.c=d)'
|
|
226
|
+
);
|
|
227
|
+
st.equal(
|
|
228
|
+
qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true, encodeDotInKeys: true }),
|
|
229
|
+
'a%252Eb%252Ec.d=e',
|
|
230
|
+
'clobbers every separator but the last (#564: should become a.b.c.d=e)'
|
|
231
|
+
);
|
|
232
|
+
st.equal(
|
|
233
|
+
qs.stringify({ 'a.b': { c: { d: 'e' } } }, { allowDots: true, encodeDotInKeys: true }),
|
|
234
|
+
'a%252Eb%252Ec.d=e',
|
|
235
|
+
'top-level dotted key: deeper separators also get encoded (#564: should become a%252Eb.c.d=e)'
|
|
236
|
+
);
|
|
237
|
+
st.equal(
|
|
238
|
+
qs.stringify({ a: { 'b.c': { d: 'e' } } }, { allowDots: true, encodeDotInKeys: true }),
|
|
239
|
+
'a%252Eb%252Ec.d=e',
|
|
240
|
+
'nested dotted key + object value: the separator around it is encoded (#564: should become a.b%252Ec.d=e)'
|
|
241
|
+
);
|
|
242
|
+
st.equal(
|
|
243
|
+
qs.stringify({ a: { b: { 'c.d': { e: 'f' } } } }, { allowDots: true, encodeDotInKeys: true }),
|
|
244
|
+
'a%252Eb%252Ec%252Ed.e=f',
|
|
245
|
+
'deeply nested dotted key: all separators encoded (#564: should become a.b.c%252Ed.e=f)'
|
|
246
|
+
);
|
|
247
|
+
|
|
248
|
+
st.equal(
|
|
249
|
+
qs.stringify({ a: { b: [1, 2] } }, { allowDots: true, encodeDotInKeys: true }),
|
|
250
|
+
'a%252Eb%5B0%5D=1&a%252Eb%5B1%5D=2',
|
|
251
|
+
'array value under nested keys: separator encoded (#564: should become a.b%5B0%5D=1&a.b%5B1%5D=2)'
|
|
252
|
+
);
|
|
253
|
+
st.equal(
|
|
254
|
+
qs.stringify({ a: { 'b.c': [1, 2] } }, { allowDots: true, encodeDotInKeys: true }),
|
|
255
|
+
'a%252Eb%252Ec%5B0%5D=1&a%252Eb%252Ec%5B1%5D=2',
|
|
256
|
+
'array value under nested dotted key (#564: should become a.b%252Ec%5B0%5D=1&a.b%252Ec%5B1%5D=2)'
|
|
257
|
+
);
|
|
258
|
+
|
|
259
|
+
st.equal(
|
|
260
|
+
qs.stringify({ a: { 'b.c': { d: 'e' } } }, { allowDots: false, encodeDotInKeys: true }),
|
|
261
|
+
'a%5Bb%252Ec%5D%5Bd%5D=e',
|
|
262
|
+
'allowDots:false object value encodes the nested-key dot, unlike the primitive-value case (#564: should become a%5Bb.c%5D%5Bd%5D=e)'
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
st.deepEqual(
|
|
266
|
+
qs.parse(
|
|
267
|
+
qs.stringify({ a: { b: { c: 'd' } } }, { allowDots: true, encodeDotInKeys: true }),
|
|
268
|
+
{ allowDots: true, decodeDotInKeys: true }
|
|
269
|
+
),
|
|
270
|
+
{ 'a.b': { c: 'd' } },
|
|
271
|
+
'the over-encoding breaks the round-trip: {a:{b:{c}}} comes back as {"a.b":{c}} (#564 restores it)'
|
|
272
|
+
);
|
|
273
|
+
|
|
274
|
+
st.end();
|
|
275
|
+
});
|
|
276
|
+
|
|
139
277
|
t.test('should encode dot in key of object, and automatically set allowDots to `true` when encodeDotInKeys is true and allowDots in undefined', function (st) {
|
|
140
278
|
st.equal(
|
|
141
279
|
qs.stringify(
|
|
@@ -328,6 +466,39 @@ test('stringify()', function (t) {
|
|
|
328
466
|
st.end();
|
|
329
467
|
});
|
|
330
468
|
|
|
469
|
+
t.test('allowEmptyArrays only short-circuits arrays with no own keys', function (st) {
|
|
470
|
+
st.equal(
|
|
471
|
+
qs.stringify({ a: [] }, { allowEmptyArrays: true }),
|
|
472
|
+
'a[]',
|
|
473
|
+
'a genuinely empty array is still emitted as `[]`'
|
|
474
|
+
);
|
|
475
|
+
|
|
476
|
+
var withKey = [];
|
|
477
|
+
withKey.extra = 'x';
|
|
478
|
+
st.equal(
|
|
479
|
+
qs.stringify({ a: withKey }, { allowEmptyArrays: true }),
|
|
480
|
+
'a%5Bextra%5D=x',
|
|
481
|
+
'an own key on an empty array is serialized rather than dropped'
|
|
482
|
+
);
|
|
483
|
+
st.equal(
|
|
484
|
+
qs.stringify({ a: withKey }, { allowEmptyArrays: true }),
|
|
485
|
+
qs.stringify({ a: withKey }),
|
|
486
|
+
'the allowEmptyArrays fast path matches the default path when the array has own keys'
|
|
487
|
+
);
|
|
488
|
+
|
|
489
|
+
var container = {};
|
|
490
|
+
var cyclic = [];
|
|
491
|
+
cyclic.back = container;
|
|
492
|
+
container.a = cyclic;
|
|
493
|
+
st['throws'](
|
|
494
|
+
function () { qs.stringify(container, { allowEmptyArrays: true }); },
|
|
495
|
+
RangeError,
|
|
496
|
+
'a cycle through an empty array with an own key is still detected'
|
|
497
|
+
);
|
|
498
|
+
|
|
499
|
+
st.end();
|
|
500
|
+
});
|
|
501
|
+
|
|
331
502
|
t.test('stringifies an array value with one item vs multiple items', function (st) {
|
|
332
503
|
st.test('non-array item', function (s2t) {
|
|
333
504
|
s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=c');
|
|
@@ -761,6 +932,33 @@ test('stringify()', function (t) {
|
|
|
761
932
|
st.end();
|
|
762
933
|
});
|
|
763
934
|
|
|
935
|
+
t.test('does not throw on a non-callable `constructor.isBuffer` key', function (st) {
|
|
936
|
+
var input = { a: { constructor: { isBuffer: 'x' } } };
|
|
937
|
+
st.doesNotThrow(function () { qs.stringify(input); });
|
|
938
|
+
st.equal(qs.stringify(input), 'a%5Bconstructor%5D%5BisBuffer%5D=x');
|
|
939
|
+
st.equal(qs.stringify({ a: { constructor: { isBuffer: { b: 'c' } } } }), 'a%5Bconstructor%5D%5BisBuffer%5D%5Bb%5D=c');
|
|
940
|
+
st.equal(qs.stringify({ a: { constructor: { isBuffer: ['b'] } } }), 'a%5Bconstructor%5D%5BisBuffer%5D%5B0%5D=b');
|
|
941
|
+
st.equal(qs.stringify({ a: { constructor: { isBuffer: true } } }), 'a%5Bconstructor%5D%5BisBuffer%5D=true');
|
|
942
|
+
st.end();
|
|
943
|
+
});
|
|
944
|
+
|
|
945
|
+
t.test('round-trips a parsed `constructor[isBuffer]` key', function (st) {
|
|
946
|
+
var str = 'x%5Bconstructor%5D%5BisBuffer%5D=y';
|
|
947
|
+
|
|
948
|
+
var plain = qs.parse(str, { plainObjects: true });
|
|
949
|
+
st.deepEqual(plain, { __proto__: null, x: { __proto__: null, constructor: { __proto__: null, isBuffer: 'y' } } }, 'plainObjects keeps the key');
|
|
950
|
+
st.doesNotThrow(function () { qs.stringify(plain); });
|
|
951
|
+
st.equal(qs.stringify(plain), str, 'plainObjects round-trips');
|
|
952
|
+
|
|
953
|
+
var proto = qs.parse(str, { allowPrototypes: true });
|
|
954
|
+
st.deepEqual(proto, { x: { constructor: { isBuffer: 'y' } } }, 'allowPrototypes keeps the key');
|
|
955
|
+
st.doesNotThrow(function () { qs.stringify(proto); });
|
|
956
|
+
st.equal(qs.stringify(proto), str, 'allowPrototypes round-trips');
|
|
957
|
+
|
|
958
|
+
st.equal(qs.stringify(qs.parse(str)), '', 'default options drop the key');
|
|
959
|
+
st.end();
|
|
960
|
+
});
|
|
961
|
+
|
|
764
962
|
t.test('stringifies an object using an alternative delimiter', function (st) {
|
|
765
963
|
st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');
|
|
766
964
|
st.end();
|
|
@@ -919,6 +1117,66 @@ test('stringify()', function (t) {
|
|
|
919
1117
|
st.end();
|
|
920
1118
|
});
|
|
921
1119
|
|
|
1120
|
+
t.test('serializes Date values unless filter transforms them', function (st) {
|
|
1121
|
+
var obj = {
|
|
1122
|
+
a: new Date(Date.UTC(2023, 2, 7, 9, 2, 41, 260)),
|
|
1123
|
+
b: [new Date(Date.UTC(2023, 2, 7, 9, 2, 41, 260))]
|
|
1124
|
+
};
|
|
1125
|
+
var iso = '2023-03-07T09%3A02%3A41.260Z';
|
|
1126
|
+
st.equal(
|
|
1127
|
+
qs.stringify(obj, { filter: function (prefix, value) { return value; } }),
|
|
1128
|
+
'a=' + iso + '&b%5B0%5D=' + iso,
|
|
1129
|
+
'Dates returned unchanged by a filter are serialized'
|
|
1130
|
+
);
|
|
1131
|
+
st.equal(
|
|
1132
|
+
qs.stringify({ a: new Date(0) }, { filter: function (prefix, value) { return value instanceof Date ? 'kept' : value; } }),
|
|
1133
|
+
'a=kept',
|
|
1134
|
+
'a filter that transforms a Date wins over default serialization'
|
|
1135
|
+
);
|
|
1136
|
+
st.end();
|
|
1137
|
+
});
|
|
1138
|
+
|
|
1139
|
+
t.test('applies default Date handling to whatever a filter function returns', function (st) {
|
|
1140
|
+
var date = new Date(Date.UTC(2023, 2, 7, 9, 2, 41, 260));
|
|
1141
|
+
var iso = '2023-03-07T09%3A02%3A41.260Z';
|
|
1142
|
+
var identity = function (prefix, value) { return value; };
|
|
1143
|
+
|
|
1144
|
+
st.equal(
|
|
1145
|
+
qs.stringify({ a: { b: date } }, { filter: identity }),
|
|
1146
|
+
'a%5Bb%5D=' + iso,
|
|
1147
|
+
'a nested Date is serialized through a filter'
|
|
1148
|
+
);
|
|
1149
|
+
st.equal(
|
|
1150
|
+
qs.stringify(
|
|
1151
|
+
{ a: date },
|
|
1152
|
+
{ filter: identity, serializeDate: function (d) { return String(d.getTime()); } }
|
|
1153
|
+
),
|
|
1154
|
+
'a=1678179761260',
|
|
1155
|
+
'`serializeDate` is honored after a filter'
|
|
1156
|
+
);
|
|
1157
|
+
st.equal(
|
|
1158
|
+
qs.stringify({ a: [date, 'x'] }, { filter: identity, arrayFormat: 'comma' }),
|
|
1159
|
+
'a=' + iso + '%2Cx',
|
|
1160
|
+
'Dates inside a comma array are serialized through a filter, not stringified as locale text'
|
|
1161
|
+
);
|
|
1162
|
+
st.equal(
|
|
1163
|
+
qs.stringify({ a: 'x' }, { filter: function (prefix, value) { return prefix === 'a' ? date : value; } }),
|
|
1164
|
+
'a=' + iso,
|
|
1165
|
+
'a Date produced by the filter is serialized'
|
|
1166
|
+
);
|
|
1167
|
+
st.equal(
|
|
1168
|
+
qs.stringify({ a: date, b: 1 }, { filter: ['a'] }),
|
|
1169
|
+
'a=' + iso,
|
|
1170
|
+
'an array filter still serializes Dates'
|
|
1171
|
+
);
|
|
1172
|
+
st['throws'](
|
|
1173
|
+
function () { qs.stringify({ a: new Date(NaN) }, { filter: identity }); },
|
|
1174
|
+
RangeError,
|
|
1175
|
+
'an invalid Date through a filter throws like the no-filter path'
|
|
1176
|
+
);
|
|
1177
|
+
st.end();
|
|
1178
|
+
});
|
|
1179
|
+
|
|
922
1180
|
t.test('can disable uri encoding', function (st) {
|
|
923
1181
|
st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b');
|
|
924
1182
|
st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c');
|
|
@@ -1445,4 +1703,63 @@ test('stringifies empty keys', function (t) {
|
|
|
1445
1703
|
|
|
1446
1704
|
st.end();
|
|
1447
1705
|
});
|
|
1706
|
+
|
|
1707
|
+
t.test('limits nesting depth with the `depth` option', function (st) {
|
|
1708
|
+
st.equal(
|
|
1709
|
+
qs.stringify({ a: { b: { c: 'd' } } }),
|
|
1710
|
+
'a%5Bb%5D%5Bc%5D=d',
|
|
1711
|
+
'the default depth is unlimited and does not alter output'
|
|
1712
|
+
);
|
|
1713
|
+
st.equal(
|
|
1714
|
+
qs.stringify({ a: { b: { c: 'd' } } }, { depth: 2 }),
|
|
1715
|
+
'a%5Bb%5D%5Bc%5D=d',
|
|
1716
|
+
'does not throw when nesting is within the depth limit'
|
|
1717
|
+
);
|
|
1718
|
+
st.equal(
|
|
1719
|
+
qs.stringify({ a: { b: 'c' } }, { depth: Infinity }),
|
|
1720
|
+
'a%5Bb%5D=c',
|
|
1721
|
+
'an explicit Infinity depth is unlimited'
|
|
1722
|
+
);
|
|
1723
|
+
st.equal(
|
|
1724
|
+
qs.stringify({ a: { b: { c: { d: 'e' } } } }, { depth: null }),
|
|
1725
|
+
qs.stringify({ a: { b: { c: { d: 'e' } } } }),
|
|
1726
|
+
'a non-number depth is ignored and treated as unlimited'
|
|
1727
|
+
);
|
|
1728
|
+
st.equal(
|
|
1729
|
+
qs.stringify({ a: 'b' }, { depth: 0 }),
|
|
1730
|
+
'a=b',
|
|
1731
|
+
'a flat object serializes with a depth of 0'
|
|
1732
|
+
);
|
|
1733
|
+
|
|
1734
|
+
var deep = {};
|
|
1735
|
+
var cursor = deep;
|
|
1736
|
+
for (var i = 0; i < 250; i++) {
|
|
1737
|
+
cursor.a = {};
|
|
1738
|
+
cursor = cursor.a;
|
|
1739
|
+
}
|
|
1740
|
+
cursor.b = 'c';
|
|
1741
|
+
st.equal(typeof qs.stringify(deep), 'string', 'the default depth serializes deeply nested objects without throwing');
|
|
1742
|
+
|
|
1743
|
+
st['throws'](
|
|
1744
|
+
function () { qs.stringify({ a: { b: { c: { d: 'e' } } } }, { depth: 2 }); },
|
|
1745
|
+
RangeError,
|
|
1746
|
+
'throws a RangeError when nesting exceeds the depth limit'
|
|
1747
|
+
);
|
|
1748
|
+
st['throws'](
|
|
1749
|
+
function () { qs.stringify({ a: { b: 'c' } }, { depth: 0 }); },
|
|
1750
|
+
RangeError,
|
|
1751
|
+
'a depth of 0 throws for any nested object'
|
|
1752
|
+
);
|
|
1753
|
+
|
|
1754
|
+
var caught;
|
|
1755
|
+
try {
|
|
1756
|
+
qs.stringify({ a: { b: { c: { d: 'e' } } } }, { depth: 2 });
|
|
1757
|
+
} catch (e) {
|
|
1758
|
+
caught = e;
|
|
1759
|
+
}
|
|
1760
|
+
st.ok(caught instanceof RangeError, 'the thrown value is a RangeError');
|
|
1761
|
+
st.equal(caught.message, 'Input depth exceeded depth option of 2', 'the RangeError names the exceeded depth');
|
|
1762
|
+
|
|
1763
|
+
st.end();
|
|
1764
|
+
});
|
|
1448
1765
|
});
|
|
@@ -604,6 +604,18 @@ test('isBuffer()', function (t) {
|
|
|
604
604
|
var fakeBuffer = { constructor: Buffer };
|
|
605
605
|
t.equal(utils.isBuffer(fakeBuffer), false, 'fake buffer is not a buffer');
|
|
606
606
|
|
|
607
|
+
forEach(['x', 1, true, {}, [], { isBuffer: true }], function (notCallable) {
|
|
608
|
+
var obj = { constructor: { isBuffer: notCallable } };
|
|
609
|
+
t.doesNotThrow(function () { utils.isBuffer(obj); }, 'non-callable `constructor.isBuffer` (' + inspect(notCallable) + ') does not throw');
|
|
610
|
+
t.equal(utils.isBuffer(obj), false, 'non-callable `constructor.isBuffer` (' + inspect(notCallable) + ') is not a buffer');
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
var nullObject = { __proto__: null, constructor: { __proto__: null, isBuffer: 'y' } };
|
|
614
|
+
t.equal(utils.isBuffer(nullObject), false, 'null object with non-callable `constructor.isBuffer` is not a buffer');
|
|
615
|
+
|
|
616
|
+
var duckBuffer = { constructor: { isBuffer: function () { return true; } } };
|
|
617
|
+
t.equal(utils.isBuffer(duckBuffer), true, 'callable `constructor.isBuffer` is still honored');
|
|
618
|
+
|
|
607
619
|
var saferBuffer = SaferBuffer.from('abc');
|
|
608
620
|
t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer');
|
|
609
621
|
|
|
@@ -103,6 +103,7 @@ export type {KeyAsString} from './source/key-as-string.d.ts';
|
|
|
103
103
|
export type {Exact} from './source/exact.d.ts';
|
|
104
104
|
export type {ReadonlyTuple} from './source/readonly-tuple.d.ts';
|
|
105
105
|
export type {OverrideProperties} from './source/override-properties.d.ts';
|
|
106
|
+
export type {RenameKeys} from './source/rename-keys.d.ts';
|
|
106
107
|
export type {OptionalKeysOf} from './source/optional-keys-of.d.ts';
|
|
107
108
|
export type {IsOptionalKeyOf} from './source/is-optional-key-of.d.ts';
|
|
108
109
|
export type {HasOptionalKeys} from './source/has-optional-keys.d.ts';
|
|
@@ -127,13 +128,11 @@ export type {UnionToTuple} from './source/union-to-tuple.d.ts';
|
|
|
127
128
|
export type {IntRange} from './source/int-range.d.ts';
|
|
128
129
|
export type {IntClosedRange} from './source/int-closed-range.d.ts';
|
|
129
130
|
export type {IsEqual} from './source/is-equal.d.ts';
|
|
130
|
-
export type {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
IsSymbolLiteral,
|
|
136
|
-
} from './source/is-literal.d.ts';
|
|
131
|
+
export type {IsLiteral} from './source/is-literal.d.ts';
|
|
132
|
+
export type {IsStringLiteral} from './source/is-string-literal.d.ts';
|
|
133
|
+
export type {IsNumericLiteral} from './source/is-numeric-literal.d.ts';
|
|
134
|
+
export type {IsBooleanLiteral} from './source/is-boolean-literal.d.ts';
|
|
135
|
+
export type {IsSymbolLiteral} from './source/is-symbol-literal.d.ts';
|
|
137
136
|
export type {IsAny} from './source/is-any.d.ts';
|
|
138
137
|
export type {IfAny} from './source/if-any.d.ts';
|
|
139
138
|
export type {IsNever} from './source/is-never.d.ts';
|
|
@@ -121,6 +121,7 @@ Click the type names for complete docs.
|
|
|
121
121
|
- [`MergeDeep`](source/merge-deep.d.ts) - Merge two objects or two arrays/tuples recursively into a new type.
|
|
122
122
|
- [`MergeExclusive`](source/merge-exclusive.d.ts) - Create a type that has mutually exclusive keys.
|
|
123
123
|
- [`OverrideProperties`](source/override-properties.d.ts) - Override existing properties of the given type. Similar to `Merge`, but enforces that the original type has the properties you want to override.
|
|
124
|
+
- [`RenameKeys`](source/rename-keys.d.ts) - Rename keys in an object type according to a map of old-to-new names.
|
|
124
125
|
- [`RequireAtLeastOne`](source/require-at-least-one.d.ts) - Create a type that requires at least one of the given keys, while keeping the remaining keys as is.
|
|
125
126
|
- [`RequireExactlyOne`](source/require-exactly-one.d.ts) - Create a type that requires exactly one of the given keys and disallows more, while keeping the remaining keys as is.
|
|
126
127
|
- [`RequireAllOrNone`](source/require-all-or-none.d.ts) - Create a type that requires all of the given keys or none of the given keys, while keeping the remaining keys as is.
|
|
@@ -164,7 +165,7 @@ Click the type names for complete docs.
|
|
|
164
165
|
- [`SetParameterType`](source/set-parameter-type.d.ts) - Create a function that replaces some parameters with the given parameters.
|
|
165
166
|
- [`Simplify`](source/simplify.d.ts) - Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
|
|
166
167
|
- [`SimplifyDeep`](source/simplify-deep.d.ts) - Deeply simplifies an object type.
|
|
167
|
-
- [`Get`](source/get.d.ts) - Get a deeply-nested property from an object using a key path, like [Lodash's `.get()`](https://lodash.com/docs
|
|
168
|
+
- [`Get`](source/get.d.ts) - Get a deeply-nested property from an object using a key path, like [Lodash's `.get()`](https://lodash.com/docs#get) function.
|
|
168
169
|
- [`KeyAsString`](source/key-as-string.d.ts) - Get keys of the given type as strings.
|
|
169
170
|
- [`Schema`](source/schema.d.ts) - Create a deep version of another object type where property values are recursively replaced into a given value type.
|
|
170
171
|
- [`Exact`](source/exact.d.ts) - Create a type that does not allow extra properties, meaning it only allows properties that are explicitly declared.
|
|
@@ -215,10 +216,10 @@ Click the type names for complete docs.
|
|
|
215
216
|
|
|
216
217
|
- [`If`](source/if.d.ts) - An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
217
218
|
- [`IsLiteral`](source/is-literal.d.ts) - Returns a boolean for whether the given type is a [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
|
|
218
|
-
- [`IsStringLiteral`](source/is-literal.d.ts) - Returns a boolean for whether the given type is a `string` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
|
|
219
|
-
- [`IsNumericLiteral`](source/is-literal.d.ts) - Returns a boolean for whether the given type is a `number` or `bigint` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
|
|
220
|
-
- [`IsBooleanLiteral`](source/is-literal.d.ts) - Returns a boolean for whether the given type is a `true` or `false` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
|
|
221
|
-
- [`IsSymbolLiteral`](source/is-literal.d.ts) - Returns a boolean for whether the given type is a `symbol` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
|
|
219
|
+
- [`IsStringLiteral`](source/is-string-literal.d.ts) - Returns a boolean for whether the given type is a `string` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
|
|
220
|
+
- [`IsNumericLiteral`](source/is-numeric-literal.d.ts) - Returns a boolean for whether the given type is a `number` or `bigint` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
|
|
221
|
+
- [`IsBooleanLiteral`](source/is-boolean-literal.d.ts) - Returns a boolean for whether the given type is a `true` or `false` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
|
|
222
|
+
- [`IsSymbolLiteral`](source/is-symbol-literal.d.ts) - Returns a boolean for whether the given type is a `symbol` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
|
|
222
223
|
- [`IsAny`](source/is-any.d.ts) - Returns a boolean for whether the given type is `any`.
|
|
223
224
|
- [`IsNever`](source/is-never.d.ts) - Returns a boolean for whether the given type is `never`.
|
|
224
225
|
- [`IsUnknown`](source/is-unknown.d.ts) - Returns a boolean for whether the given type is `unknown`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type {ApplyDefaultOptions, AsciiPunctuation, StartsWith} from './internal/index.d.ts';
|
|
2
|
-
import type {IsStringLiteral} from './is-literal.d.ts';
|
|
2
|
+
import type {IsStringLiteral} from './is-string-literal.d.ts';
|
|
3
3
|
import type {Merge} from './merge.d.ts';
|
|
4
4
|
import type {_DefaultWordsOptions, Words, WordsOptions} from './words.d.ts';
|
|
5
5
|
|
|
@@ -161,7 +161,7 @@ type PropertyOf<BaseType, Key extends string, Options extends Required<GetOption
|
|
|
161
161
|
|
|
162
162
|
// This works by first splitting the path based on `.` and `[...]` characters into a tuple of string keys. Then it recursively uses the head key to get the next property of the current object, until there are no keys left. Number keys extract the item type from arrays, or are converted to strings to extract types from tuples and dictionaries with number keys.
|
|
163
163
|
/**
|
|
164
|
-
Get a deeply-nested property from an object using a key path, like [Lodash's `.get()`](https://lodash.com/docs
|
|
164
|
+
Get a deeply-nested property from an object using a key path, like [Lodash's `.get()`](https://lodash.com/docs#get) function.
|
|
165
165
|
|
|
166
166
|
Use-case: Retrieve a property from deep inside an API response or some other complex object.
|
|
167
167
|
|
|
@@ -7,8 +7,9 @@ import type {IsAny} from '../is-any.d.ts';
|
|
|
7
7
|
import type {If} from '../if.d.ts';
|
|
8
8
|
import type {IsNever} from '../is-never.d.ts';
|
|
9
9
|
import type {StringToNumber} from '../string-to-number.d.ts';
|
|
10
|
+
import type {Primitive} from '../primitive.d.ts';
|
|
10
11
|
import type {FilterDefinedKeys, FilterOptionalKeys} from './keys.d.ts';
|
|
11
|
-
import type {MapsSetsOrArrays, NonRecursiveType} from './type.d.ts';
|
|
12
|
+
import type {IfNotAnyOrNever, MapsSetsOrArrays, NonRecursiveType} from './type.d.ts';
|
|
12
13
|
import type {ToString} from './string.d.ts';
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -274,6 +275,34 @@ export type CollapseLiterals<T> = {} extends T
|
|
|
274
275
|
? U
|
|
275
276
|
: T;
|
|
276
277
|
|
|
278
|
+
/**
|
|
279
|
+
Returns the base type of a branded type.
|
|
280
|
+
|
|
281
|
+
@example
|
|
282
|
+
```
|
|
283
|
+
type Brand = {readonly __brand: unique symbol};
|
|
284
|
+
|
|
285
|
+
type A = UnwrapBrand<string & Brand>;
|
|
286
|
+
//=> string
|
|
287
|
+
|
|
288
|
+
type B = UnwrapBrand<number & Brand>;
|
|
289
|
+
//=> number
|
|
290
|
+
|
|
291
|
+
type C = UnwrapBrand<PropertyKey & Brand>;
|
|
292
|
+
//=> PropertyKey
|
|
293
|
+
|
|
294
|
+
type D = UnwrapBrand<(1 | 200n | 'foo' | 'bar') & Brand>;
|
|
295
|
+
//=> 1 | 200n | 'foo' | 'bar'
|
|
296
|
+
```
|
|
297
|
+
*/
|
|
298
|
+
export type UnwrapBrand<T> = IfNotAnyOrNever<T, {ifNot: _UnwrapBrand<T, Primitive>}>;
|
|
299
|
+
|
|
300
|
+
type _UnwrapBrand<T, Base> = T extends Primitive
|
|
301
|
+
? T extends infer U & Pick<T, Exclude<keyof T, KeysOfUnion<Base>>>
|
|
302
|
+
? U
|
|
303
|
+
: T
|
|
304
|
+
: T;
|
|
305
|
+
|
|
277
306
|
/**
|
|
278
307
|
Normalize keys by including string and number representations wherever applicable.
|
|
279
308
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type {CollapseLiterals, UnwrapBrand} from './internal/object.d.ts';
|
|
2
|
+
import type {IfNotAnyOrNever} from './internal/type.d.ts';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
Returns a boolean for whether the given type is a `true` or `false` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
|
|
6
|
+
|
|
7
|
+
@example
|
|
8
|
+
```
|
|
9
|
+
import type {IsBooleanLiteral} from 'type-fest';
|
|
10
|
+
|
|
11
|
+
type A = IsBooleanLiteral<true>;
|
|
12
|
+
//=> true
|
|
13
|
+
|
|
14
|
+
type B = IsBooleanLiteral<false>;
|
|
15
|
+
//=> true
|
|
16
|
+
|
|
17
|
+
type C = IsBooleanLiteral<boolean>;
|
|
18
|
+
//=> false
|
|
19
|
+
|
|
20
|
+
type D = IsBooleanLiteral<true | false>;
|
|
21
|
+
//=> false
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
@category Type Guard
|
|
25
|
+
@category Utilities
|
|
26
|
+
*/
|
|
27
|
+
export type IsBooleanLiteral<T> = IfNotAnyOrNever<T, {
|
|
28
|
+
ifNot: _IsBooleanLiteral<CollapseLiterals<UnwrapBrand<T>>>;
|
|
29
|
+
ifAny: false;
|
|
30
|
+
ifNever: false;
|
|
31
|
+
}>;
|
|
32
|
+
|
|
33
|
+
type _IsBooleanLiteral<T> = boolean extends T
|
|
34
|
+
? false
|
|
35
|
+
: T extends boolean
|
|
36
|
+
? true
|
|
37
|
+
: false;
|
|
38
|
+
|
|
39
|
+
export {};
|