immosquare-cleaner 0.1.32 → 0.1.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/immosquare-cleaner/version.rb +1 -1
- data/node_modules/@eslint/eslintrc/README.md +15 -4
- data/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs +57 -18
- data/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map +1 -1
- data/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +60 -34
- data/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map +1 -1
- data/node_modules/@eslint/eslintrc/lib/config-array/config-array.js +3 -16
- data/node_modules/@eslint/eslintrc/lib/shared/config-validator.js +63 -18
- data/node_modules/@eslint/eslintrc/package.json +4 -4
- data/node_modules/@eslint/js/package.json +2 -2
- data/node_modules/@eslint/js/src/configs/eslint-all.js +9 -1
- data/node_modules/@eslint/js/src/configs/eslint-recommended.js +12 -5
- data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/LICENSE +201 -0
- data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/README.md +105 -0
- data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs +384 -0
- data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts +27 -0
- data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/index.d.ts +16 -0
- data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts +12 -0
- data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js +65 -0
- data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.js +315 -0
- data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/package.json +74 -0
- data/node_modules/@humanwhocodes/config-array/api.js +114 -16
- data/node_modules/@humanwhocodes/config-array/package.json +5 -3
- data/node_modules/@humanwhocodes/object-schema/CHANGELOG.md +7 -0
- data/node_modules/@humanwhocodes/object-schema/package.json +6 -1
- data/node_modules/@humanwhocodes/retry/LICENSE +201 -0
- data/node_modules/@humanwhocodes/retry/README.md +122 -0
- data/node_modules/@humanwhocodes/retry/dist/retrier.cjs +267 -0
- data/node_modules/@humanwhocodes/retry/dist/retrier.d.ts +24 -0
- data/node_modules/@humanwhocodes/retry/dist/retrier.js +265 -0
- data/node_modules/@humanwhocodes/retry/dist/retrier.min.js +1 -0
- data/node_modules/@humanwhocodes/retry/dist/retrier.mjs +265 -0
- data/node_modules/@humanwhocodes/retry/package.json +74 -0
- data/node_modules/@types/semver-utils/LICENSE +21 -0
- data/node_modules/@types/semver-utils/README.md +34 -0
- data/node_modules/@types/semver-utils/index.d.ts +15 -0
- data/node_modules/@types/semver-utils/package.json +25 -0
- data/node_modules/acorn/CHANGELOG.md +36 -0
- data/node_modules/acorn/README.md +8 -3
- data/node_modules/acorn/dist/acorn.d.mts +857 -26
- data/node_modules/acorn/dist/acorn.d.ts +833 -268
- data/node_modules/acorn/dist/acorn.js +33 -21
- data/node_modules/acorn/dist/acorn.mjs +33 -21
- data/node_modules/acorn/package.json +1 -1
- data/node_modules/cacheable-request/node_modules/keyv/README.md +429 -0
- data/node_modules/cacheable-request/node_modules/keyv/package.json +57 -0
- data/node_modules/cacheable-request/node_modules/keyv/src/index.d.ts +112 -0
- data/node_modules/cacheable-request/node_modules/keyv/src/index.js +264 -0
- data/node_modules/doctrine/CHANGELOG.md +0 -7
- data/node_modules/doctrine/lib/doctrine.js +1 -0
- data/node_modules/doctrine/package.json +8 -9
- data/node_modules/eslint/README.md +31 -28
- data/node_modules/eslint/bin/eslint.js +4 -3
- data/node_modules/eslint/conf/ecma-version.js +16 -0
- data/node_modules/eslint/conf/globals.js +1 -0
- data/node_modules/eslint/conf/rule-type-list.json +3 -1
- data/node_modules/eslint/lib/api.js +7 -11
- data/node_modules/eslint/lib/cli-engine/cli-engine.js +14 -3
- data/node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json +1 -29
- data/node_modules/eslint/lib/cli-engine/lint-result-cache.js +2 -2
- data/node_modules/eslint/lib/cli.js +115 -36
- data/node_modules/eslint/lib/config/default-config.js +3 -0
- data/node_modules/eslint/lib/config/flat-config-array.js +110 -24
- data/node_modules/eslint/lib/config/flat-config-helpers.js +41 -20
- data/node_modules/eslint/lib/config/flat-config-schema.js +1 -7
- data/node_modules/eslint/lib/config/rule-validator.js +42 -6
- data/node_modules/eslint/lib/eslint/eslint-helpers.js +116 -58
- data/node_modules/eslint/lib/eslint/eslint.js +892 -377
- data/node_modules/eslint/lib/eslint/index.js +2 -2
- data/node_modules/eslint/lib/eslint/legacy-eslint.js +728 -0
- data/node_modules/eslint/lib/linter/apply-disable-directives.js +59 -31
- data/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js +0 -1
- data/node_modules/eslint/lib/linter/code-path-analysis/code-path.js +32 -30
- data/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js +1 -1
- data/node_modules/eslint/lib/linter/config-comment-parser.js +8 -11
- data/node_modules/eslint/lib/linter/index.js +1 -3
- data/node_modules/eslint/lib/linter/interpolate.js +24 -2
- data/node_modules/eslint/lib/linter/linter.js +428 -207
- data/node_modules/eslint/lib/linter/report-translator.js +3 -3
- data/node_modules/eslint/lib/linter/rules.js +6 -15
- data/node_modules/eslint/lib/linter/source-code-fixer.js +1 -1
- data/node_modules/eslint/lib/linter/timing.js +16 -8
- data/node_modules/eslint/lib/options.js +35 -3
- data/node_modules/eslint/lib/rule-tester/index.js +3 -1
- data/node_modules/eslint/lib/rule-tester/rule-tester.js +424 -347
- data/node_modules/eslint/lib/rules/array-bracket-newline.js +1 -1
- data/node_modules/eslint/lib/rules/array-bracket-spacing.js +1 -1
- data/node_modules/eslint/lib/rules/block-scoped-var.js +1 -1
- data/node_modules/eslint/lib/rules/callback-return.js +2 -2
- data/node_modules/eslint/lib/rules/camelcase.js +3 -5
- data/node_modules/eslint/lib/rules/capitalized-comments.js +10 -7
- data/node_modules/eslint/lib/rules/comma-dangle.js +1 -1
- data/node_modules/eslint/lib/rules/comma-style.js +2 -2
- data/node_modules/eslint/lib/rules/complexity.js +14 -1
- data/node_modules/eslint/lib/rules/constructor-super.js +99 -100
- data/node_modules/eslint/lib/rules/default-case.js +1 -1
- data/node_modules/eslint/lib/rules/eol-last.js +2 -2
- data/node_modules/eslint/lib/rules/function-paren-newline.js +2 -2
- data/node_modules/eslint/lib/rules/indent-legacy.js +5 -5
- data/node_modules/eslint/lib/rules/indent.js +5 -5
- data/node_modules/eslint/lib/rules/index.js +1 -2
- data/node_modules/eslint/lib/rules/key-spacing.js +2 -2
- data/node_modules/eslint/lib/rules/line-comment-position.js +1 -1
- data/node_modules/eslint/lib/rules/lines-around-directive.js +2 -2
- data/node_modules/eslint/lib/rules/max-depth.js +1 -1
- data/node_modules/eslint/lib/rules/max-len.js +3 -3
- data/node_modules/eslint/lib/rules/max-lines.js +3 -3
- data/node_modules/eslint/lib/rules/max-nested-callbacks.js +1 -1
- data/node_modules/eslint/lib/rules/max-params.js +1 -1
- data/node_modules/eslint/lib/rules/max-statements.js +1 -1
- data/node_modules/eslint/lib/rules/multiline-comment-style.js +7 -7
- data/node_modules/eslint/lib/rules/new-cap.js +1 -1
- data/node_modules/eslint/lib/rules/newline-after-var.js +1 -1
- data/node_modules/eslint/lib/rules/newline-before-return.js +1 -1
- data/node_modules/eslint/lib/rules/no-case-declarations.js +13 -1
- data/node_modules/eslint/lib/rules/no-constant-binary-expression.js +7 -8
- data/node_modules/eslint/lib/rules/no-constant-condition.js +18 -7
- data/node_modules/eslint/lib/rules/no-constructor-return.js +2 -2
- data/node_modules/eslint/lib/rules/no-dupe-class-members.js +2 -2
- data/node_modules/eslint/lib/rules/no-else-return.js +1 -1
- data/node_modules/eslint/lib/rules/no-empty-function.js +2 -2
- data/node_modules/eslint/lib/rules/no-empty-static-block.js +1 -1
- data/node_modules/eslint/lib/rules/no-extend-native.js +1 -2
- data/node_modules/eslint/lib/rules/no-extra-semi.js +1 -1
- data/node_modules/eslint/lib/rules/no-fallthrough.js +41 -16
- data/node_modules/eslint/lib/rules/no-implicit-coercion.js +66 -24
- data/node_modules/eslint/lib/rules/no-inner-declarations.js +23 -2
- data/node_modules/eslint/lib/rules/no-invalid-regexp.js +1 -1
- data/node_modules/eslint/lib/rules/no-invalid-this.js +1 -1
- data/node_modules/eslint/lib/rules/no-lone-blocks.js +3 -3
- data/node_modules/eslint/lib/rules/no-loss-of-precision.js +1 -1
- data/node_modules/eslint/lib/rules/no-misleading-character-class.js +225 -69
- data/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js +1 -1
- data/node_modules/eslint/lib/rules/no-multiple-empty-lines.js +1 -1
- data/node_modules/eslint/lib/rules/no-new-native-nonconstructor.js +1 -1
- data/node_modules/eslint/lib/rules/no-new-symbol.js +8 -1
- data/node_modules/eslint/lib/rules/no-restricted-globals.js +1 -1
- data/node_modules/eslint/lib/rules/no-restricted-imports.js +186 -40
- data/node_modules/eslint/lib/rules/no-restricted-modules.js +2 -2
- data/node_modules/eslint/lib/rules/no-return-await.js +1 -1
- data/node_modules/eslint/lib/rules/no-sequences.js +1 -0
- data/node_modules/eslint/lib/rules/no-this-before-super.js +45 -13
- data/node_modules/eslint/lib/rules/no-trailing-spaces.js +2 -3
- data/node_modules/eslint/lib/rules/no-unneeded-ternary.js +1 -1
- data/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js +1 -1
- data/node_modules/eslint/lib/rules/no-unused-private-class-members.js +1 -1
- data/node_modules/eslint/lib/rules/no-unused-vars.js +197 -36
- data/node_modules/eslint/lib/rules/no-useless-assignment.js +566 -0
- data/node_modules/eslint/lib/rules/no-useless-backreference.js +1 -1
- data/node_modules/eslint/lib/rules/no-useless-computed-key.js +2 -2
- data/node_modules/eslint/lib/rules/no-useless-return.js +7 -2
- data/node_modules/eslint/lib/rules/object-curly-spacing.js +3 -3
- data/node_modules/eslint/lib/rules/object-property-newline.js +1 -1
- data/node_modules/eslint/lib/rules/one-var.js +5 -5
- data/node_modules/eslint/lib/rules/padded-blocks.js +7 -7
- data/node_modules/eslint/lib/rules/prefer-arrow-callback.js +3 -3
- data/node_modules/eslint/lib/rules/prefer-reflect.js +1 -1
- data/node_modules/eslint/lib/rules/prefer-regex-literals.js +1 -1
- data/node_modules/eslint/lib/rules/prefer-template.js +1 -1
- data/node_modules/eslint/lib/rules/radix.js +2 -2
- data/node_modules/eslint/lib/rules/semi-style.js +1 -1
- data/node_modules/eslint/lib/rules/sort-imports.js +1 -1
- data/node_modules/eslint/lib/rules/sort-keys.js +1 -1
- data/node_modules/eslint/lib/rules/sort-vars.js +1 -1
- data/node_modules/eslint/lib/rules/space-unary-ops.js +1 -1
- data/node_modules/eslint/lib/rules/strict.js +1 -1
- data/node_modules/eslint/lib/rules/use-isnan.js +101 -7
- data/node_modules/eslint/lib/rules/utils/ast-utils.js +16 -7
- data/node_modules/eslint/lib/rules/utils/char-source.js +240 -0
- data/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js +1 -1
- data/node_modules/eslint/lib/rules/utils/unicode/index.js +9 -4
- data/node_modules/eslint/lib/rules/yield-star-spacing.js +1 -1
- data/node_modules/eslint/lib/shared/runtime-info.js +1 -0
- data/node_modules/eslint/lib/shared/serialization.js +55 -0
- data/node_modules/eslint/lib/shared/stats.js +30 -0
- data/node_modules/eslint/lib/shared/string-utils.js +9 -11
- data/node_modules/eslint/lib/shared/types.js +35 -1
- data/node_modules/eslint/lib/source-code/index.js +3 -1
- data/node_modules/eslint/lib/source-code/source-code.js +299 -85
- data/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js +3 -3
- data/node_modules/eslint/lib/source-code/token-store/cursors.js +4 -2
- data/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js +3 -3
- data/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js +3 -3
- data/node_modules/eslint/lib/source-code/token-store/index.js +2 -2
- data/node_modules/eslint/lib/unsupported-api.js +3 -5
- data/node_modules/eslint/messages/no-config-found.js +1 -1
- data/node_modules/eslint/messages/plugin-conflict.js +1 -1
- data/node_modules/eslint/messages/plugin-invalid.js +1 -1
- data/node_modules/eslint/messages/plugin-missing.js +1 -1
- data/node_modules/eslint/package.json +32 -29
- data/node_modules/eslint-scope/README.md +23 -2
- data/node_modules/eslint-scope/dist/eslint-scope.cjs +84 -58
- data/node_modules/eslint-scope/lib/index.js +0 -3
- data/node_modules/eslint-scope/lib/pattern-visitor.js +4 -3
- data/node_modules/eslint-scope/lib/referencer.js +13 -11
- data/node_modules/eslint-scope/lib/scope-manager.js +2 -8
- data/node_modules/eslint-scope/lib/scope.js +64 -43
- data/node_modules/eslint-scope/lib/version.js +1 -1
- data/node_modules/eslint-scope/package.json +21 -19
- data/node_modules/eslint-visitor-keys/README.md +1 -1
- data/node_modules/eslint-visitor-keys/package.json +2 -2
- data/node_modules/espree/README.md +1 -1
- data/node_modules/espree/dist/espree.cjs +1 -1
- data/node_modules/espree/lib/version.js +1 -1
- data/node_modules/espree/package.json +18 -20
- data/node_modules/file-entry-cache/LICENSE +1 -1
- data/node_modules/file-entry-cache/README.md +6 -3
- data/node_modules/file-entry-cache/package.json +19 -43
- data/node_modules/flat-cache/README.md +8 -6
- data/node_modules/flat-cache/changelog.md +155 -205
- data/node_modules/flat-cache/package.json +16 -39
- data/node_modules/flat-cache/src/cache.js +22 -26
- data/node_modules/flat-cache/src/del.js +28 -11
- data/node_modules/flat-cache/src/utils.js +39 -41
- data/node_modules/globals/globals.json +25 -0
- data/node_modules/globals/index.d.ts +2074 -3
- data/node_modules/globals/package.json +10 -7
- data/node_modules/globals/readme.md +2 -14
- data/node_modules/keyv/package.json +4 -4
- data/node_modules/keyv/src/index.js +6 -11
- data/node_modules/npm-check-updates/build/cli.js +22 -21
- data/node_modules/npm-check-updates/build/cli.js.map +1 -1
- data/node_modules/npm-check-updates/build/index-5sFb3Tvv.js +66 -0
- data/node_modules/npm-check-updates/build/index-5sFb3Tvv.js.map +1 -0
- data/node_modules/npm-check-updates/build/index-BmUFwMVL.js +6 -0
- data/node_modules/npm-check-updates/build/index-BmUFwMVL.js.map +1 -0
- data/node_modules/npm-check-updates/build/index.d.ts +5 -2
- data/node_modules/npm-check-updates/build/index.js +560 -1
- data/node_modules/npm-check-updates/build/index.js.map +1 -1
- data/node_modules/npm-check-updates/build/package.json +4 -3
- data/node_modules/npm-check-updates/build/src/index.js +1 -1
- data/node_modules/npm-check-updates/build/src/index.js.map +1 -1
- data/node_modules/npm-check-updates/build/src/lib/libnpmconfig/index.js +2 -2
- data/node_modules/npm-check-updates/build/src/lib/libnpmconfig/index.js.map +1 -1
- data/node_modules/npm-check-updates/build/src/package-managers/bun.js +0 -6
- data/node_modules/npm-check-updates/build/src/package-managers/bun.js.map +1 -1
- data/node_modules/npm-check-updates/package.json +4 -3
- data/node_modules/type-fest/index.d.ts +95 -2
- data/node_modules/type-fest/package.json +12 -18
- data/node_modules/type-fest/readme.md +299 -52
- data/node_modules/type-fest/source/async-return-type.d.ts +4 -2
- data/node_modules/type-fest/source/asyncify.d.ts +5 -3
- data/node_modules/type-fest/source/basic.d.ts +21 -43
- data/node_modules/type-fest/{ts41 → source}/camel-case.d.ts +18 -17
- data/node_modules/type-fest/source/camel-cased-properties-deep.d.ts +54 -0
- data/node_modules/type-fest/source/camel-cased-properties.d.ts +36 -0
- data/node_modules/type-fest/source/conditional-except.d.ts +6 -4
- data/node_modules/type-fest/source/conditional-keys.d.ts +5 -1
- data/node_modules/type-fest/source/conditional-pick.d.ts +5 -3
- data/node_modules/type-fest/{ts41 → source}/delimiter-case.d.ts +16 -8
- data/node_modules/type-fest/source/delimiter-cased-properties-deep.d.ts +60 -0
- data/node_modules/type-fest/source/delimiter-cased-properties.d.ts +37 -0
- data/node_modules/type-fest/source/entries.d.ts +8 -3
- data/node_modules/type-fest/source/entry.d.ts +8 -3
- data/node_modules/type-fest/source/exact.d.ts +73 -0
- data/node_modules/type-fest/source/except.d.ts +38 -3
- data/node_modules/type-fest/source/fixed-length-array.d.ts +6 -1
- data/node_modules/type-fest/source/get.d.ts +184 -0
- data/node_modules/type-fest/source/has-optional-keys.d.ts +21 -0
- data/node_modules/type-fest/source/has-required-keys.d.ts +59 -0
- data/node_modules/type-fest/source/includes.d.ts +22 -0
- data/node_modules/type-fest/source/internal.d.ts +59 -0
- data/node_modules/type-fest/source/invariant-of.d.ts +76 -0
- data/node_modules/type-fest/source/iterable-element.d.ts +8 -0
- data/node_modules/type-fest/source/join.d.ts +30 -0
- data/node_modules/type-fest/source/jsonify.d.ts +90 -0
- data/node_modules/type-fest/{ts41 → source}/kebab-case.d.ts +7 -5
- data/node_modules/type-fest/source/kebab-cased-properties-deep.d.ts +47 -0
- data/node_modules/type-fest/source/kebab-cased-properties.d.ts +30 -0
- data/node_modules/type-fest/source/last-array-element.d.ts +28 -0
- data/node_modules/type-fest/source/literal-to-primitive.d.ts +36 -0
- data/node_modules/type-fest/source/literal-union.d.ts +7 -5
- data/node_modules/type-fest/source/merge-exclusive.d.ts +3 -1
- data/node_modules/type-fest/source/merge.d.ts +8 -3
- data/node_modules/type-fest/source/multidimensional-array.d.ts +43 -0
- data/node_modules/type-fest/source/multidimensional-readonly-array.d.ts +47 -0
- data/node_modules/type-fest/source/mutable.d.ts +4 -21
- data/node_modules/type-fest/source/numeric.d.ts +170 -0
- data/node_modules/type-fest/source/observable-like.d.ts +62 -0
- data/node_modules/type-fest/source/opaque.d.ts +45 -3
- data/node_modules/type-fest/source/optional-keys-of.d.ts +38 -0
- data/node_modules/type-fest/source/package-json.d.ts +64 -12
- data/node_modules/type-fest/source/partial-deep.d.ts +57 -16
- data/node_modules/type-fest/source/partial-on-undefined-deep.d.ts +70 -0
- data/node_modules/type-fest/{ts41 → source}/pascal-case.d.ts +6 -4
- data/node_modules/type-fest/source/pascal-cased-properties-deep.d.ts +54 -0
- data/node_modules/type-fest/source/pascal-cased-properties.d.ts +34 -0
- data/node_modules/type-fest/source/primitive.d.ts +13 -0
- data/node_modules/type-fest/source/promisable.d.ts +5 -3
- data/node_modules/type-fest/source/promise-value.d.ts +9 -7
- data/node_modules/type-fest/source/readonly-deep.d.ts +33 -7
- data/node_modules/type-fest/source/readonly-tuple.d.ts +41 -0
- data/node_modules/type-fest/source/remove-index-signature.d.ts +104 -0
- data/node_modules/type-fest/source/replace.d.ts +67 -0
- data/node_modules/type-fest/source/require-all-or-none.d.ts +36 -0
- data/node_modules/type-fest/source/require-at-least-one.d.ts +5 -3
- data/node_modules/type-fest/source/require-exactly-one.d.ts +4 -5
- data/node_modules/type-fest/source/required-keys-of.d.ts +29 -0
- data/node_modules/type-fest/source/schema.d.ts +72 -0
- data/node_modules/type-fest/source/screaming-snake-case.d.ts +33 -0
- data/node_modules/type-fest/source/set-non-nullable.d.ts +35 -0
- data/node_modules/type-fest/source/set-optional.d.ts +12 -11
- data/node_modules/type-fest/source/set-required.d.ts +12 -11
- data/node_modules/type-fest/source/set-return-type.d.ts +3 -1
- data/node_modules/type-fest/source/simplify.d.ts +83 -0
- data/node_modules/type-fest/{ts41 → source}/snake-case.d.ts +7 -4
- data/node_modules/type-fest/source/snake-cased-properties-deep.d.ts +47 -0
- data/node_modules/type-fest/source/snake-cased-properties.d.ts +30 -0
- data/node_modules/type-fest/source/split.d.ts +29 -0
- data/node_modules/type-fest/source/spread.d.ts +85 -0
- data/node_modules/type-fest/source/string-key-of.d.ts +25 -0
- data/node_modules/type-fest/source/stringified.d.ts +3 -1
- data/node_modules/type-fest/source/trim.d.ts +25 -0
- data/node_modules/type-fest/source/tsconfig-json.d.ts +316 -14
- data/node_modules/type-fest/source/typed-array.d.ts +17 -0
- data/node_modules/type-fest/source/union-to-intersection.d.ts +4 -2
- data/node_modules/type-fest/source/value-of.d.ts +3 -1
- data/node_modules/type-fest/source/writable.d.ts +40 -0
- data/package.json +2 -2
- metadata +86 -63
- data/linters/rubocop-2.7.6.yml +0 -86
- data/node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js +0 -66
- data/node_modules/@humanwhocodes/object-schema/tests/object-schema.js +0 -659
- data/node_modules/@humanwhocodes/object-schema/tests/validation-strategy.js +0 -186
- data/node_modules/eslint/conf/config-schema.js +0 -93
- data/node_modules/eslint/lib/cli-engine/formatters/checkstyle.js +0 -60
- data/node_modules/eslint/lib/cli-engine/formatters/compact.js +0 -60
- data/node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js +0 -41
- data/node_modules/eslint/lib/cli-engine/formatters/junit.js +0 -82
- data/node_modules/eslint/lib/cli-engine/formatters/tap.js +0 -95
- data/node_modules/eslint/lib/cli-engine/formatters/unix.js +0 -58
- data/node_modules/eslint/lib/cli-engine/formatters/visualstudio.js +0 -63
- data/node_modules/eslint/lib/cli-engine/xml-escape.js +0 -34
- data/node_modules/eslint/lib/eslint/flat-eslint.js +0 -1155
- data/node_modules/eslint/lib/rule-tester/flat-rule-tester.js +0 -1131
- data/node_modules/eslint/lib/rules/require-jsdoc.js +0 -122
- data/node_modules/eslint/lib/rules/utils/patterns/letters.js +0 -36
- data/node_modules/eslint/lib/rules/valid-jsdoc.js +0 -516
- data/node_modules/eslint/lib/shared/config-validator.js +0 -347
- data/node_modules/eslint/lib/shared/deprecation-warnings.js +0 -58
- data/node_modules/eslint/lib/shared/relative-module-resolver.js +0 -50
- data/node_modules/file-entry-cache/changelog.md +0 -163
- data/node_modules/flat-cache/node_modules/rimraf/CHANGELOG.md +0 -65
- data/node_modules/flat-cache/node_modules/rimraf/LICENSE +0 -15
- data/node_modules/flat-cache/node_modules/rimraf/README.md +0 -101
- data/node_modules/flat-cache/node_modules/rimraf/bin.js +0 -68
- data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/LICENSE +0 -21
- data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/README.md +0 -378
- data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/common.js +0 -238
- data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/glob.js +0 -790
- data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/LICENSE +0 -15
- data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/README.md +0 -230
- data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/minimatch.js +0 -947
- data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/LICENSE +0 -21
- data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -129
- data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -201
- data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -47
- data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +0 -33
- data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/package.json +0 -55
- data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/sync.js +0 -486
- data/node_modules/flat-cache/node_modules/rimraf/package.json +0 -32
- data/node_modules/flat-cache/node_modules/rimraf/rimraf.js +0 -360
- data/node_modules/npm-check-updates/build/index-CI_x-D21.js +0 -593
- data/node_modules/npm-check-updates/build/index-CI_x-D21.js.map +0 -1
- data/node_modules/npm-check-updates/build/index-Ci8A2QXv.js +0 -6
- data/node_modules/npm-check-updates/build/index-Ci8A2QXv.js.map +0 -1
- data/node_modules/npm-check-updates/build/index-DgVn3Gax.js +0 -36
- data/node_modules/npm-check-updates/build/index-DgVn3Gax.js.map +0 -1
- data/node_modules/npm-check-updates/build/src/types/SpawnPleaseOptions.d.ts +0 -6
- data/node_modules/npm-check-updates/build/src/types/SpawnPleaseOptions.js +0 -3
- data/node_modules/npm-check-updates/build/src/types/SpawnPleaseOptions.js.map +0 -1
- data/node_modules/type-fest/base.d.ts +0 -38
- data/node_modules/type-fest/license +0 -9
- data/node_modules/type-fest/source/utilities.d.ts +0 -3
- data/node_modules/type-fest/ts41/index.d.ts +0 -9
@@ -0,0 +1,38 @@
|
|
1
|
+
/**
|
2
|
+
Extract all optional keys from the given type.
|
3
|
+
|
4
|
+
This is useful when you want to create a new type that contains different type values for the optional keys only.
|
5
|
+
|
6
|
+
@example
|
7
|
+
```
|
8
|
+
import type {OptionalKeysOf, Except} from 'type-fest';
|
9
|
+
|
10
|
+
interface User {
|
11
|
+
name: string;
|
12
|
+
surname: string;
|
13
|
+
|
14
|
+
luckyNumber?: number;
|
15
|
+
}
|
16
|
+
|
17
|
+
const REMOVE_FIELD = Symbol('remove field symbol');
|
18
|
+
type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
|
19
|
+
[Key in OptionalKeysOf<Entity>]?: Entity[Key] | typeof REMOVE_FIELD;
|
20
|
+
};
|
21
|
+
|
22
|
+
const update1: UpdateOperation<User> = {
|
23
|
+
name: 'Alice'
|
24
|
+
};
|
25
|
+
|
26
|
+
const update2: UpdateOperation<User> = {
|
27
|
+
name: 'Bob',
|
28
|
+
luckyNumber: REMOVE_FIELD
|
29
|
+
};
|
30
|
+
```
|
31
|
+
|
32
|
+
@category Utilities
|
33
|
+
*/
|
34
|
+
export type OptionalKeysOf<BaseType extends object> = Exclude<{
|
35
|
+
[Key in keyof BaseType]: BaseType extends Record<Key, BaseType[Key]>
|
36
|
+
? never
|
37
|
+
: Key
|
38
|
+
}[keyof BaseType], undefined>;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {LiteralUnion} from './literal-union';
|
1
|
+
import type {LiteralUnion} from './literal-union';
|
2
2
|
|
3
3
|
declare namespace PackageJson {
|
4
4
|
/**
|
@@ -200,12 +200,12 @@ declare namespace PackageJson {
|
|
200
200
|
Run with the `npm restart` command, after `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
|
201
201
|
*/
|
202
202
|
postrestart?: string;
|
203
|
-
} & Record<string, string
|
203
|
+
} & Partial<Record<string, string>>;
|
204
204
|
|
205
205
|
/**
|
206
206
|
Dependencies of the package. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or Git URL.
|
207
207
|
*/
|
208
|
-
export type Dependency = Record<string, string
|
208
|
+
export type Dependency = Partial<Record<string, string>>;
|
209
209
|
|
210
210
|
/**
|
211
211
|
Conditions which provide a way to resolve a package entry point based on the environment.
|
@@ -214,6 +214,7 @@ declare namespace PackageJson {
|
|
214
214
|
| 'import'
|
215
215
|
| 'require'
|
216
216
|
| 'node'
|
217
|
+
| 'node-addons'
|
217
218
|
| 'deno'
|
218
219
|
| 'browser'
|
219
220
|
| 'electron'
|
@@ -222,13 +223,24 @@ declare namespace PackageJson {
|
|
222
223
|
string
|
223
224
|
>;
|
224
225
|
|
226
|
+
type ExportConditions = {[condition in ExportCondition]: Exports};
|
227
|
+
|
225
228
|
/**
|
226
229
|
Entry points of a module, optionally with conditions and subpath exports.
|
227
230
|
*/
|
228
231
|
export type Exports =
|
232
|
+
| null
|
229
233
|
| string
|
230
|
-
|
|
231
|
-
|
|
234
|
+
| Array<string | ExportConditions>
|
235
|
+
| ExportConditions
|
236
|
+
| {[path: string]: Exports}; // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
|
237
|
+
|
238
|
+
/**
|
239
|
+
Import map entries of a module, optionally with conditions.
|
240
|
+
*/
|
241
|
+
export type Imports = { // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
|
242
|
+
[key: string]: string | {[key in ExportCondition]: Exports};
|
243
|
+
};
|
232
244
|
|
233
245
|
export interface NonStandardEntryPoints {
|
234
246
|
/**
|
@@ -252,7 +264,7 @@ declare namespace PackageJson {
|
|
252
264
|
*/
|
253
265
|
browser?:
|
254
266
|
| string
|
255
|
-
| Record<string, string | false
|
267
|
+
| Partial<Record<string, string | false>>;
|
256
268
|
|
257
269
|
/**
|
258
270
|
Denote which files in your project are "pure" and therefore safe for Webpack to prune if unused.
|
@@ -268,6 +280,11 @@ declare namespace PackageJson {
|
|
268
280
|
*/
|
269
281
|
types?: string;
|
270
282
|
|
283
|
+
/**
|
284
|
+
Version selection map of TypeScript.
|
285
|
+
*/
|
286
|
+
typesVersions?: Partial<Record<string, Partial<Record<string, string[]>>>>;
|
287
|
+
|
271
288
|
/**
|
272
289
|
Location of the bundled TypeScript declaration file. Alias of `types`.
|
273
290
|
*/
|
@@ -409,18 +426,25 @@ declare namespace PackageJson {
|
|
409
426
|
main?: string;
|
410
427
|
|
411
428
|
/**
|
412
|
-
|
429
|
+
Subpath exports to define entry points of the package.
|
413
430
|
|
414
|
-
[Read more.](https://nodejs.org/api/
|
431
|
+
[Read more.](https://nodejs.org/api/packages.html#subpath-exports)
|
415
432
|
*/
|
416
433
|
exports?: Exports;
|
417
434
|
|
435
|
+
/**
|
436
|
+
Subpath imports to define internal package import maps that only apply to import specifiers from within the package itself.
|
437
|
+
|
438
|
+
[Read more.](https://nodejs.org/api/packages.html#subpath-imports)
|
439
|
+
*/
|
440
|
+
imports?: Imports;
|
441
|
+
|
418
442
|
/**
|
419
443
|
The executable files that should be installed into the `PATH`.
|
420
444
|
*/
|
421
445
|
bin?:
|
422
446
|
| string
|
423
|
-
| Record<string, string
|
447
|
+
| Partial<Record<string, string>>;
|
424
448
|
|
425
449
|
/**
|
426
450
|
Filenames to put in place for the `man` program to find.
|
@@ -482,7 +506,7 @@ declare namespace PackageJson {
|
|
482
506
|
/**
|
483
507
|
Indicate peer dependencies that are optional.
|
484
508
|
*/
|
485
|
-
peerDependenciesMeta?: Record<string, {optional: true}
|
509
|
+
peerDependenciesMeta?: Partial<Record<string, {optional: true}>>;
|
486
510
|
|
487
511
|
/**
|
488
512
|
Package names that are bundled when the package is published.
|
@@ -498,7 +522,7 @@ declare namespace PackageJson {
|
|
498
522
|
Engines that this package runs on.
|
499
523
|
*/
|
500
524
|
engines?: {
|
501
|
-
[EngineName in 'npm' | 'node' | string]
|
525
|
+
[EngineName in 'npm' | 'node' | string]?: string;
|
502
526
|
};
|
503
527
|
|
504
528
|
/**
|
@@ -571,7 +595,7 @@ declare namespace PackageJson {
|
|
571
595
|
/**
|
572
596
|
A set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default.
|
573
597
|
*/
|
574
|
-
publishConfig?:
|
598
|
+
publishConfig?: PublishConfig;
|
575
599
|
|
576
600
|
/**
|
577
601
|
Describes and notifies consumers of a package's monetary support information.
|
@@ -598,10 +622,38 @@ declare namespace PackageJson {
|
|
598
622
|
url: string;
|
599
623
|
};
|
600
624
|
}
|
625
|
+
|
626
|
+
export interface PublishConfig {
|
627
|
+
/**
|
628
|
+
Additional, less common properties from the [npm docs on `publishConfig`](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#publishconfig).
|
629
|
+
*/
|
630
|
+
[additionalProperties: string]: unknown;
|
631
|
+
|
632
|
+
/**
|
633
|
+
When publishing scoped packages, the access level defaults to restricted. If you want your scoped package to be publicly viewable (and installable) set `--access=public`. The only valid values for access are public and restricted. Unscoped packages always have an access level of public.
|
634
|
+
*/
|
635
|
+
access?: 'public' | 'restricted';
|
636
|
+
|
637
|
+
/**
|
638
|
+
The base URL of the npm registry.
|
639
|
+
|
640
|
+
Default: `'https://registry.npmjs.org/'`
|
641
|
+
*/
|
642
|
+
registry?: string;
|
643
|
+
|
644
|
+
/**
|
645
|
+
The tag to publish the package under.
|
646
|
+
|
647
|
+
Default: `'latest'`
|
648
|
+
*/
|
649
|
+
tag?: string;
|
650
|
+
}
|
601
651
|
}
|
602
652
|
|
603
653
|
/**
|
604
654
|
Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Also includes types for fields used by other popular projects, like TypeScript and Yarn.
|
655
|
+
|
656
|
+
@category File
|
605
657
|
*/
|
606
658
|
export type PackageJson =
|
607
659
|
PackageJson.PackageJsonStandard &
|
@@ -1,4 +1,16 @@
|
|
1
|
-
import {
|
1
|
+
import type {BuiltIns} from './internal';
|
2
|
+
|
3
|
+
/**
|
4
|
+
@see PartialDeep
|
5
|
+
*/
|
6
|
+
export interface PartialDeepOptions {
|
7
|
+
/**
|
8
|
+
Whether to affect the individual elements of arrays and tuples.
|
9
|
+
|
10
|
+
@default true
|
11
|
+
*/
|
12
|
+
readonly recurseIntoArrays?: boolean;
|
13
|
+
}
|
2
14
|
|
3
15
|
/**
|
4
16
|
Create a type from another type with all keys and nested keys set to optional.
|
@@ -9,7 +21,7 @@ Use-cases:
|
|
9
21
|
|
10
22
|
@example
|
11
23
|
```
|
12
|
-
import {PartialDeep} from 'type-fest';
|
24
|
+
import type {PartialDeep} from 'type-fest';
|
13
25
|
|
14
26
|
const settings: Settings = {
|
15
27
|
textEditor: {
|
@@ -27,46 +39,75 @@ const applySavedSettings = (savedSettings: PartialDeep<Settings>) => {
|
|
27
39
|
|
28
40
|
settings = applySavedSettings({textEditor: {fontWeight: 500}});
|
29
41
|
```
|
42
|
+
|
43
|
+
By default, this also affects array and tuple types:
|
44
|
+
|
45
|
+
```
|
46
|
+
import type {PartialDeep} from 'type-fest';
|
47
|
+
|
48
|
+
interface Settings {
|
49
|
+
languages: string[];
|
50
|
+
}
|
51
|
+
|
52
|
+
const partialSettings: PartialDeep<Settings> = {
|
53
|
+
languages: [undefined]
|
54
|
+
};
|
55
|
+
```
|
56
|
+
|
57
|
+
If this is undesirable, you can pass `{recurseIntoArrays: false}` as the second type argument.
|
58
|
+
|
59
|
+
@category Object
|
60
|
+
@category Array
|
61
|
+
@category Set
|
62
|
+
@category Map
|
30
63
|
*/
|
31
|
-
export type PartialDeep<T> = T extends
|
32
|
-
?
|
64
|
+
export type PartialDeep<T, Options extends PartialDeepOptions = {}> = T extends BuiltIns
|
65
|
+
? T
|
33
66
|
: T extends Map<infer KeyType, infer ValueType>
|
34
|
-
? PartialMapDeep<KeyType, ValueType>
|
67
|
+
? PartialMapDeep<KeyType, ValueType, Options>
|
35
68
|
: T extends Set<infer ItemType>
|
36
|
-
? PartialSetDeep<ItemType>
|
69
|
+
? PartialSetDeep<ItemType, Options>
|
37
70
|
: T extends ReadonlyMap<infer KeyType, infer ValueType>
|
38
|
-
? PartialReadonlyMapDeep<KeyType, ValueType>
|
71
|
+
? PartialReadonlyMapDeep<KeyType, ValueType, Options>
|
39
72
|
: T extends ReadonlySet<infer ItemType>
|
40
|
-
? PartialReadonlySetDeep<ItemType>
|
73
|
+
? PartialReadonlySetDeep<ItemType, Options>
|
41
74
|
: T extends ((...arguments: any[]) => unknown)
|
42
75
|
? T | undefined
|
43
76
|
: T extends object
|
44
|
-
?
|
77
|
+
? T extends ReadonlyArray<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
|
78
|
+
? Options['recurseIntoArrays'] extends false // If they opt out of array testing, just use the original type
|
79
|
+
? T
|
80
|
+
: ItemType[] extends T // Test for arrays (non-tuples) specifically
|
81
|
+
? readonly ItemType[] extends T // Differentiate readonly and mutable arrays
|
82
|
+
? ReadonlyArray<PartialDeep<ItemType | undefined, Options>>
|
83
|
+
: Array<PartialDeep<ItemType | undefined, Options>>
|
84
|
+
: PartialObjectDeep<T, Options> // Tuples behave properly
|
85
|
+
: PartialObjectDeep<T, Options>
|
45
86
|
: unknown;
|
46
87
|
|
47
88
|
/**
|
48
|
-
Same as `PartialDeep`, but accepts only `Map`s and
|
89
|
+
Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
|
49
90
|
*/
|
50
|
-
interface PartialMapDeep<KeyType, ValueType> extends Map<PartialDeep<KeyType>, PartialDeep<ValueType>> {}
|
91
|
+
interface PartialMapDeep<KeyType, ValueType, Options extends PartialDeepOptions> extends Map<PartialDeep<KeyType, Options>, PartialDeep<ValueType, Options>> {}
|
51
92
|
|
52
93
|
/**
|
53
94
|
Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`.
|
54
95
|
*/
|
55
|
-
interface PartialSetDeep<T> extends Set<PartialDeep<T>> {}
|
96
|
+
interface PartialSetDeep<T, Options extends PartialDeepOptions> extends Set<PartialDeep<T, Options>> {}
|
56
97
|
|
57
98
|
/**
|
58
99
|
Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`.
|
59
100
|
*/
|
60
|
-
interface PartialReadonlyMapDeep<KeyType, ValueType> extends ReadonlyMap<PartialDeep<KeyType>, PartialDeep<ValueType>> {}
|
101
|
+
interface PartialReadonlyMapDeep<KeyType, ValueType, Options extends PartialDeepOptions> extends ReadonlyMap<PartialDeep<KeyType, Options>, PartialDeep<ValueType, Options>> {}
|
61
102
|
|
62
103
|
/**
|
63
104
|
Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`.
|
64
105
|
*/
|
65
|
-
interface PartialReadonlySetDeep<T> extends ReadonlySet<PartialDeep<T>> {}
|
106
|
+
interface PartialReadonlySetDeep<T, Options extends PartialDeepOptions> extends ReadonlySet<PartialDeep<T, Options>> {}
|
66
107
|
|
67
108
|
/**
|
68
109
|
Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.
|
69
110
|
*/
|
70
|
-
type PartialObjectDeep<ObjectType extends object> = {
|
71
|
-
[KeyType in keyof ObjectType]?: PartialDeep<ObjectType[KeyType]>
|
111
|
+
type PartialObjectDeep<ObjectType extends object, Options extends PartialDeepOptions> = {
|
112
|
+
[KeyType in keyof ObjectType]?: PartialDeep<ObjectType[KeyType], Options>
|
72
113
|
};
|
@@ -0,0 +1,70 @@
|
|
1
|
+
import type {BuiltIns} from './internal';
|
2
|
+
import type {Merge} from './merge';
|
3
|
+
|
4
|
+
/**
|
5
|
+
@see PartialOnUndefinedDeep
|
6
|
+
*/
|
7
|
+
export interface PartialOnUndefinedDeepOptions {
|
8
|
+
/**
|
9
|
+
Whether to affect the individual elements of arrays and tuples.
|
10
|
+
|
11
|
+
@default false
|
12
|
+
*/
|
13
|
+
readonly recurseIntoArrays?: boolean;
|
14
|
+
}
|
15
|
+
|
16
|
+
/**
|
17
|
+
Create a deep version of another type where all keys accepting `undefined` type are set to optional.
|
18
|
+
|
19
|
+
This utility type is recursive, transforming at any level deep. By default, it does not affect arrays and tuples items unless you explicitly pass `{recurseIntoArrays: true}` as the second type argument.
|
20
|
+
|
21
|
+
Use-cases:
|
22
|
+
- Make all properties of a type that can be undefined optional to not have to specify keys with undefined value.
|
23
|
+
|
24
|
+
@example
|
25
|
+
```
|
26
|
+
import type {PartialOnUndefinedDeep} from 'type-fest';
|
27
|
+
|
28
|
+
interface Settings {
|
29
|
+
optionA: string;
|
30
|
+
optionB: number | undefined;
|
31
|
+
subOption: {
|
32
|
+
subOptionA: boolean;
|
33
|
+
subOptionB: boolean | undefined;
|
34
|
+
}
|
35
|
+
};
|
36
|
+
|
37
|
+
const testSettings: PartialOnUndefinedDeep<Settings> = {
|
38
|
+
optionA: 'foo',
|
39
|
+
// 👉 optionB is now optional and can be omitted
|
40
|
+
subOption: {
|
41
|
+
subOptionA: true,
|
42
|
+
// 👉 subOptionB is now optional as well and can be omitted
|
43
|
+
},
|
44
|
+
};
|
45
|
+
```
|
46
|
+
|
47
|
+
@category Object
|
48
|
+
*/
|
49
|
+
export type PartialOnUndefinedDeep<T, Options extends PartialOnUndefinedDeepOptions = {}> = T extends Record<any, any> | undefined
|
50
|
+
? {[KeyType in keyof T as undefined extends T[KeyType] ? KeyType : never]?: PartialOnUndefinedDeepValue<T[KeyType], Options>} extends infer U // Make a partial type with all value types accepting undefined (and set them optional)
|
51
|
+
? Merge<{[KeyType in keyof T as KeyType extends keyof U ? never : KeyType]: PartialOnUndefinedDeepValue<T[KeyType], Options>}, U> // Join all remaining keys not treated in U
|
52
|
+
: never // Should not happen
|
53
|
+
: T;
|
54
|
+
|
55
|
+
/**
|
56
|
+
Utility type to get the value type by key and recursively call `PartialOnUndefinedDeep` to transform sub-objects.
|
57
|
+
*/
|
58
|
+
type PartialOnUndefinedDeepValue<T, Options extends PartialOnUndefinedDeepOptions> = T extends BuiltIns | ((...arguments: any[]) => unknown)
|
59
|
+
? T
|
60
|
+
: T extends ReadonlyArray<infer U> // Test if type is array or tuple
|
61
|
+
? Options['recurseIntoArrays'] extends true // Check if option is activated
|
62
|
+
? U[] extends T // Check if array not tuple
|
63
|
+
? readonly U[] extends T
|
64
|
+
? ReadonlyArray<PartialOnUndefinedDeep<U, Options>> // Readonly array treatment
|
65
|
+
: Array<PartialOnUndefinedDeep<U, Options>> // Mutable array treatment
|
66
|
+
: PartialOnUndefinedDeep<{[Key in keyof T]: PartialOnUndefinedDeep<T[Key], Options>}, Options> // Tuple treatment
|
67
|
+
: T
|
68
|
+
: T extends Record<any, any> | undefined
|
69
|
+
? PartialOnUndefinedDeep<T, Options>
|
70
|
+
: unknown;
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import {CamelCase} from './camel-case';
|
1
|
+
import type {CamelCase} from './camel-case';
|
2
2
|
|
3
3
|
/**
|
4
4
|
Converts a string literal to pascal-case.
|
5
5
|
|
6
6
|
@example
|
7
7
|
```
|
8
|
-
import {PascalCase} from 'type-fest';
|
8
|
+
import type {PascalCase} from 'type-fest';
|
9
9
|
|
10
10
|
// Simple
|
11
11
|
|
@@ -23,14 +23,16 @@ interface RawOptions {
|
|
23
23
|
foo: number;
|
24
24
|
}
|
25
25
|
|
26
|
-
const dbResult:
|
26
|
+
const dbResult: CamelCasedProperties<ModelProps> = {
|
27
27
|
DryRun: true,
|
28
28
|
FullFamilyName: 'bar.js',
|
29
29
|
Foo: 123
|
30
30
|
};
|
31
31
|
```
|
32
|
-
*/
|
33
32
|
|
33
|
+
@category Change case
|
34
|
+
@category Template literal
|
35
|
+
*/
|
34
36
|
export type PascalCase<Value> = CamelCase<Value> extends string
|
35
37
|
? Capitalize<CamelCase<Value>>
|
36
38
|
: CamelCase<Value>;
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import type {PascalCase} from './pascal-case';
|
2
|
+
|
3
|
+
/**
|
4
|
+
Convert object properties to pascal case recursively.
|
5
|
+
|
6
|
+
This can be useful when, for example, converting some API types from a different style.
|
7
|
+
|
8
|
+
@see PascalCase
|
9
|
+
@see PascalCasedProperties
|
10
|
+
|
11
|
+
@example
|
12
|
+
```
|
13
|
+
import type {PascalCasedPropertiesDeep} from 'type-fest';
|
14
|
+
|
15
|
+
interface User {
|
16
|
+
userId: number;
|
17
|
+
userName: string;
|
18
|
+
}
|
19
|
+
|
20
|
+
interface UserWithFriends {
|
21
|
+
userInfo: User;
|
22
|
+
userFriends: User[];
|
23
|
+
}
|
24
|
+
|
25
|
+
const result: PascalCasedPropertiesDeep<UserWithFriends> = {
|
26
|
+
UserInfo: {
|
27
|
+
UserId: 1,
|
28
|
+
UserName: 'Tom',
|
29
|
+
},
|
30
|
+
UserFriends: [
|
31
|
+
{
|
32
|
+
UserId: 2,
|
33
|
+
UserName: 'Jerry',
|
34
|
+
},
|
35
|
+
{
|
36
|
+
UserId: 3,
|
37
|
+
UserName: 'Spike',
|
38
|
+
},
|
39
|
+
],
|
40
|
+
};
|
41
|
+
```
|
42
|
+
|
43
|
+
@category Change case
|
44
|
+
@category Template literal
|
45
|
+
@category Object
|
46
|
+
*/
|
47
|
+
export type PascalCasedPropertiesDeep<Value> = Value extends Function | Date | RegExp
|
48
|
+
? Value
|
49
|
+
: Value extends Array<infer U>
|
50
|
+
? Array<PascalCasedPropertiesDeep<U>>
|
51
|
+
: Value extends Set<infer U>
|
52
|
+
? Set<PascalCasedPropertiesDeep<U>> : {
|
53
|
+
[K in keyof Value as PascalCase<K>]: PascalCasedPropertiesDeep<Value[K]>;
|
54
|
+
};
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import type {PascalCase} from './pascal-case';
|
2
|
+
|
3
|
+
/**
|
4
|
+
Convert object properties to pascal case but not recursively.
|
5
|
+
|
6
|
+
This can be useful when, for example, converting some API types from a different style.
|
7
|
+
|
8
|
+
@see PascalCase
|
9
|
+
@see PascalCasedPropertiesDeep
|
10
|
+
|
11
|
+
@example
|
12
|
+
```
|
13
|
+
import type {PascalCasedProperties} from 'type-fest';
|
14
|
+
|
15
|
+
interface User {
|
16
|
+
userId: number;
|
17
|
+
userName: string;
|
18
|
+
}
|
19
|
+
|
20
|
+
const result: PascalCasedProperties<User> = {
|
21
|
+
UserId: 1,
|
22
|
+
UserName: 'Tom',
|
23
|
+
};
|
24
|
+
```
|
25
|
+
|
26
|
+
@category Change case
|
27
|
+
@category Template literal
|
28
|
+
@category Object
|
29
|
+
*/
|
30
|
+
export type PascalCasedProperties<Value> = Value extends Function
|
31
|
+
? Value
|
32
|
+
: Value extends Array<infer U>
|
33
|
+
? Value
|
34
|
+
: {[K in keyof Value as PascalCase<K>]: Value[K]};
|
@@ -9,15 +9,17 @@ Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31394)
|
|
9
9
|
|
10
10
|
@example
|
11
11
|
```
|
12
|
-
import {Promisable} from 'type-fest';
|
12
|
+
import type {Promisable} from 'type-fest';
|
13
13
|
|
14
14
|
async function logger(getLogEntry: () => Promisable<string>): Promise<void> {
|
15
|
-
|
16
|
-
|
15
|
+
const entry = await getLogEntry();
|
16
|
+
console.log(entry);
|
17
17
|
}
|
18
18
|
|
19
19
|
logger(() => 'foo');
|
20
20
|
logger(() => Promise.resolve('bar'));
|
21
21
|
```
|
22
|
+
|
23
|
+
@category Async
|
22
24
|
*/
|
23
25
|
export type Promisable<T> = T | PromiseLike<T>;
|
@@ -1,14 +1,16 @@
|
|
1
1
|
/**
|
2
|
+
@deprecated Use the built-in [`Awaited` type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#the-awaited-type-and-promise-improvements) instead.
|
3
|
+
|
2
4
|
Returns the type that is wrapped inside a `Promise` type.
|
3
5
|
If the type is a nested Promise, it is unwrapped recursively until a non-Promise type is obtained.
|
4
6
|
If the type is not a `Promise`, the type itself is returned.
|
5
7
|
|
6
8
|
@example
|
7
9
|
```
|
8
|
-
import {PromiseValue} from 'type-fest';
|
10
|
+
import type {PromiseValue} from 'type-fest';
|
9
11
|
|
10
12
|
type AsyncData = Promise<string>;
|
11
|
-
let asyncData:
|
13
|
+
let asyncData: AsyncData = Promise.resolve('ABC');
|
12
14
|
|
13
15
|
type Data = PromiseValue<AsyncData>;
|
14
16
|
let data: Data = await asyncData;
|
@@ -18,10 +20,10 @@ type SyncData = PromiseValue<string>;
|
|
18
20
|
let syncData: SyncData = getSyncData();
|
19
21
|
|
20
22
|
// Here's an example that shows how this type reacts to recursive Promise types.
|
21
|
-
type RecursiveAsyncData = Promise<Promise<string
|
22
|
-
let recursiveAsyncData: PromiseValue<RecursiveAsyncData> = Promise.resolve(Promise.resolve('ABC'));
|
23
|
+
type RecursiveAsyncData = Promise<Promise<string>>;
|
24
|
+
let recursiveAsyncData: PromiseValue<RecursiveAsyncData> = await Promise.resolve(Promise.resolve('ABC'));
|
23
25
|
```
|
26
|
+
|
27
|
+
@category Async
|
24
28
|
*/
|
25
|
-
export type PromiseValue<PromiseType
|
26
|
-
? { 0: PromiseValue<Value>; 1: Value }[PromiseType extends Promise<unknown> ? 0 : 1]
|
27
|
-
: Otherwise;
|
29
|
+
export type PromiseValue<PromiseType> = PromiseType extends PromiseLike<infer Value> ? PromiseValue<Value> : PromiseType;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import type {BuiltIns} from './internal';
|
2
2
|
|
3
3
|
/**
|
4
4
|
Convert `object`s, `Map`s, `Set`s, and `Array`s and all of their keys/elements into immutable structures recursively.
|
@@ -15,7 +15,7 @@ Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/13923)
|
|
15
15
|
}
|
16
16
|
|
17
17
|
// main.ts
|
18
|
-
import {ReadonlyDeep} from 'type-fest';
|
18
|
+
import type {ReadonlyDeep} from 'type-fest';
|
19
19
|
import dataJson = require('./data.json');
|
20
20
|
|
21
21
|
const data: ReadonlyDeep<typeof dataJson> = dataJson;
|
@@ -28,12 +28,23 @@ import data from './main';
|
|
28
28
|
data.foo.push('bar');
|
29
29
|
//=> error TS2339: Property 'push' does not exist on type 'readonly string[]'
|
30
30
|
```
|
31
|
+
|
32
|
+
@category Object
|
33
|
+
@category Array
|
34
|
+
@category Set
|
35
|
+
@category Map
|
31
36
|
*/
|
32
|
-
export type ReadonlyDeep<T> = T extends
|
37
|
+
export type ReadonlyDeep<T> = T extends BuiltIns
|
33
38
|
? T
|
34
|
-
: T extends
|
39
|
+
: T extends (...arguments: any[]) => unknown
|
40
|
+
? {} extends ReadonlyObjectDeep<T>
|
41
|
+
? T
|
42
|
+
: HasMultipleCallSignatures<T> extends true
|
43
|
+
? T
|
44
|
+
: ((...arguments: Parameters<T>) => ReturnType<T>) & ReadonlyObjectDeep<T>
|
45
|
+
: T extends Readonly<ReadonlyMap<infer KeyType, infer ValueType>>
|
35
46
|
? ReadonlyMapDeep<KeyType, ValueType>
|
36
|
-
: T extends ReadonlySet<infer ItemType
|
47
|
+
: T extends Readonly<ReadonlySet<infer ItemType>>
|
37
48
|
? ReadonlySetDeep<ItemType>
|
38
49
|
: T extends object
|
39
50
|
? ReadonlyObjectDeep<T>
|
@@ -43,13 +54,13 @@ export type ReadonlyDeep<T> = T extends Primitive | ((...arguments: any[]) => un
|
|
43
54
|
Same as `ReadonlyDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `ReadonlyDeep`.
|
44
55
|
*/
|
45
56
|
interface ReadonlyMapDeep<KeyType, ValueType>
|
46
|
-
extends ReadonlyMap<ReadonlyDeep<KeyType>, ReadonlyDeep<ValueType
|
57
|
+
extends Readonly<ReadonlyMap<ReadonlyDeep<KeyType>, ReadonlyDeep<ValueType>>> {}
|
47
58
|
|
48
59
|
/**
|
49
60
|
Same as `ReadonlyDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `ReadonlyDeep`.
|
50
61
|
*/
|
51
62
|
interface ReadonlySetDeep<ItemType>
|
52
|
-
extends ReadonlySet<ReadonlyDeep<ItemType
|
63
|
+
extends Readonly<ReadonlySet<ReadonlyDeep<ItemType>>> {}
|
53
64
|
|
54
65
|
/**
|
55
66
|
Same as `ReadonlyDeep`, but accepts only `object`s as inputs. Internal helper for `ReadonlyDeep`.
|
@@ -57,3 +68,18 @@ Same as `ReadonlyDeep`, but accepts only `object`s as inputs. Internal helper fo
|
|
57
68
|
type ReadonlyObjectDeep<ObjectType extends object> = {
|
58
69
|
readonly [KeyType in keyof ObjectType]: ReadonlyDeep<ObjectType[KeyType]>
|
59
70
|
};
|
71
|
+
|
72
|
+
/**
|
73
|
+
Test if the given function has multiple call signatures.
|
74
|
+
|
75
|
+
Needed to handle the case of a single call signature with properties.
|
76
|
+
|
77
|
+
Multiple call signatures cannot currently be supported due to a TypeScript limitation.
|
78
|
+
@see https://github.com/microsoft/TypeScript/issues/29732
|
79
|
+
*/
|
80
|
+
type HasMultipleCallSignatures<T extends (...arguments: any[]) => unknown> =
|
81
|
+
T extends {(...arguments: infer A): unknown; (...arguments: any[]): unknown}
|
82
|
+
? unknown[] extends A
|
83
|
+
? false
|
84
|
+
: true
|
85
|
+
: false;
|