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.
Files changed (376) hide show
  1. checksums.yaml +4 -4
  2. data/lib/immosquare-cleaner/version.rb +1 -1
  3. data/node_modules/@eslint/eslintrc/README.md +15 -4
  4. data/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs +57 -18
  5. data/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map +1 -1
  6. data/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +60 -34
  7. data/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map +1 -1
  8. data/node_modules/@eslint/eslintrc/lib/config-array/config-array.js +3 -16
  9. data/node_modules/@eslint/eslintrc/lib/shared/config-validator.js +63 -18
  10. data/node_modules/@eslint/eslintrc/package.json +4 -4
  11. data/node_modules/@eslint/js/package.json +2 -2
  12. data/node_modules/@eslint/js/src/configs/eslint-all.js +9 -1
  13. data/node_modules/@eslint/js/src/configs/eslint-recommended.js +12 -5
  14. data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/LICENSE +201 -0
  15. data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/README.md +105 -0
  16. data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs +384 -0
  17. data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts +27 -0
  18. data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/index.d.ts +16 -0
  19. data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts +12 -0
  20. data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js +65 -0
  21. data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.js +315 -0
  22. data/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/package.json +74 -0
  23. data/node_modules/@humanwhocodes/config-array/api.js +114 -16
  24. data/node_modules/@humanwhocodes/config-array/package.json +5 -3
  25. data/node_modules/@humanwhocodes/object-schema/CHANGELOG.md +7 -0
  26. data/node_modules/@humanwhocodes/object-schema/package.json +6 -1
  27. data/node_modules/@humanwhocodes/retry/LICENSE +201 -0
  28. data/node_modules/@humanwhocodes/retry/README.md +122 -0
  29. data/node_modules/@humanwhocodes/retry/dist/retrier.cjs +267 -0
  30. data/node_modules/@humanwhocodes/retry/dist/retrier.d.ts +24 -0
  31. data/node_modules/@humanwhocodes/retry/dist/retrier.js +265 -0
  32. data/node_modules/@humanwhocodes/retry/dist/retrier.min.js +1 -0
  33. data/node_modules/@humanwhocodes/retry/dist/retrier.mjs +265 -0
  34. data/node_modules/@humanwhocodes/retry/package.json +74 -0
  35. data/node_modules/@types/semver-utils/LICENSE +21 -0
  36. data/node_modules/@types/semver-utils/README.md +34 -0
  37. data/node_modules/@types/semver-utils/index.d.ts +15 -0
  38. data/node_modules/@types/semver-utils/package.json +25 -0
  39. data/node_modules/acorn/CHANGELOG.md +36 -0
  40. data/node_modules/acorn/README.md +8 -3
  41. data/node_modules/acorn/dist/acorn.d.mts +857 -26
  42. data/node_modules/acorn/dist/acorn.d.ts +833 -268
  43. data/node_modules/acorn/dist/acorn.js +33 -21
  44. data/node_modules/acorn/dist/acorn.mjs +33 -21
  45. data/node_modules/acorn/package.json +1 -1
  46. data/node_modules/cacheable-request/node_modules/keyv/README.md +429 -0
  47. data/node_modules/cacheable-request/node_modules/keyv/package.json +57 -0
  48. data/node_modules/cacheable-request/node_modules/keyv/src/index.d.ts +112 -0
  49. data/node_modules/cacheable-request/node_modules/keyv/src/index.js +264 -0
  50. data/node_modules/doctrine/CHANGELOG.md +0 -7
  51. data/node_modules/doctrine/lib/doctrine.js +1 -0
  52. data/node_modules/doctrine/package.json +8 -9
  53. data/node_modules/eslint/README.md +31 -28
  54. data/node_modules/eslint/bin/eslint.js +4 -3
  55. data/node_modules/eslint/conf/ecma-version.js +16 -0
  56. data/node_modules/eslint/conf/globals.js +1 -0
  57. data/node_modules/eslint/conf/rule-type-list.json +3 -1
  58. data/node_modules/eslint/lib/api.js +7 -11
  59. data/node_modules/eslint/lib/cli-engine/cli-engine.js +14 -3
  60. data/node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json +1 -29
  61. data/node_modules/eslint/lib/cli-engine/lint-result-cache.js +2 -2
  62. data/node_modules/eslint/lib/cli.js +115 -36
  63. data/node_modules/eslint/lib/config/default-config.js +3 -0
  64. data/node_modules/eslint/lib/config/flat-config-array.js +110 -24
  65. data/node_modules/eslint/lib/config/flat-config-helpers.js +41 -20
  66. data/node_modules/eslint/lib/config/flat-config-schema.js +1 -7
  67. data/node_modules/eslint/lib/config/rule-validator.js +42 -6
  68. data/node_modules/eslint/lib/eslint/eslint-helpers.js +116 -58
  69. data/node_modules/eslint/lib/eslint/eslint.js +892 -377
  70. data/node_modules/eslint/lib/eslint/index.js +2 -2
  71. data/node_modules/eslint/lib/eslint/legacy-eslint.js +728 -0
  72. data/node_modules/eslint/lib/linter/apply-disable-directives.js +59 -31
  73. data/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js +0 -1
  74. data/node_modules/eslint/lib/linter/code-path-analysis/code-path.js +32 -30
  75. data/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js +1 -1
  76. data/node_modules/eslint/lib/linter/config-comment-parser.js +8 -11
  77. data/node_modules/eslint/lib/linter/index.js +1 -3
  78. data/node_modules/eslint/lib/linter/interpolate.js +24 -2
  79. data/node_modules/eslint/lib/linter/linter.js +428 -207
  80. data/node_modules/eslint/lib/linter/report-translator.js +3 -3
  81. data/node_modules/eslint/lib/linter/rules.js +6 -15
  82. data/node_modules/eslint/lib/linter/source-code-fixer.js +1 -1
  83. data/node_modules/eslint/lib/linter/timing.js +16 -8
  84. data/node_modules/eslint/lib/options.js +35 -3
  85. data/node_modules/eslint/lib/rule-tester/index.js +3 -1
  86. data/node_modules/eslint/lib/rule-tester/rule-tester.js +424 -347
  87. data/node_modules/eslint/lib/rules/array-bracket-newline.js +1 -1
  88. data/node_modules/eslint/lib/rules/array-bracket-spacing.js +1 -1
  89. data/node_modules/eslint/lib/rules/block-scoped-var.js +1 -1
  90. data/node_modules/eslint/lib/rules/callback-return.js +2 -2
  91. data/node_modules/eslint/lib/rules/camelcase.js +3 -5
  92. data/node_modules/eslint/lib/rules/capitalized-comments.js +10 -7
  93. data/node_modules/eslint/lib/rules/comma-dangle.js +1 -1
  94. data/node_modules/eslint/lib/rules/comma-style.js +2 -2
  95. data/node_modules/eslint/lib/rules/complexity.js +14 -1
  96. data/node_modules/eslint/lib/rules/constructor-super.js +99 -100
  97. data/node_modules/eslint/lib/rules/default-case.js +1 -1
  98. data/node_modules/eslint/lib/rules/eol-last.js +2 -2
  99. data/node_modules/eslint/lib/rules/function-paren-newline.js +2 -2
  100. data/node_modules/eslint/lib/rules/indent-legacy.js +5 -5
  101. data/node_modules/eslint/lib/rules/indent.js +5 -5
  102. data/node_modules/eslint/lib/rules/index.js +1 -2
  103. data/node_modules/eslint/lib/rules/key-spacing.js +2 -2
  104. data/node_modules/eslint/lib/rules/line-comment-position.js +1 -1
  105. data/node_modules/eslint/lib/rules/lines-around-directive.js +2 -2
  106. data/node_modules/eslint/lib/rules/max-depth.js +1 -1
  107. data/node_modules/eslint/lib/rules/max-len.js +3 -3
  108. data/node_modules/eslint/lib/rules/max-lines.js +3 -3
  109. data/node_modules/eslint/lib/rules/max-nested-callbacks.js +1 -1
  110. data/node_modules/eslint/lib/rules/max-params.js +1 -1
  111. data/node_modules/eslint/lib/rules/max-statements.js +1 -1
  112. data/node_modules/eslint/lib/rules/multiline-comment-style.js +7 -7
  113. data/node_modules/eslint/lib/rules/new-cap.js +1 -1
  114. data/node_modules/eslint/lib/rules/newline-after-var.js +1 -1
  115. data/node_modules/eslint/lib/rules/newline-before-return.js +1 -1
  116. data/node_modules/eslint/lib/rules/no-case-declarations.js +13 -1
  117. data/node_modules/eslint/lib/rules/no-constant-binary-expression.js +7 -8
  118. data/node_modules/eslint/lib/rules/no-constant-condition.js +18 -7
  119. data/node_modules/eslint/lib/rules/no-constructor-return.js +2 -2
  120. data/node_modules/eslint/lib/rules/no-dupe-class-members.js +2 -2
  121. data/node_modules/eslint/lib/rules/no-else-return.js +1 -1
  122. data/node_modules/eslint/lib/rules/no-empty-function.js +2 -2
  123. data/node_modules/eslint/lib/rules/no-empty-static-block.js +1 -1
  124. data/node_modules/eslint/lib/rules/no-extend-native.js +1 -2
  125. data/node_modules/eslint/lib/rules/no-extra-semi.js +1 -1
  126. data/node_modules/eslint/lib/rules/no-fallthrough.js +41 -16
  127. data/node_modules/eslint/lib/rules/no-implicit-coercion.js +66 -24
  128. data/node_modules/eslint/lib/rules/no-inner-declarations.js +23 -2
  129. data/node_modules/eslint/lib/rules/no-invalid-regexp.js +1 -1
  130. data/node_modules/eslint/lib/rules/no-invalid-this.js +1 -1
  131. data/node_modules/eslint/lib/rules/no-lone-blocks.js +3 -3
  132. data/node_modules/eslint/lib/rules/no-loss-of-precision.js +1 -1
  133. data/node_modules/eslint/lib/rules/no-misleading-character-class.js +225 -69
  134. data/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js +1 -1
  135. data/node_modules/eslint/lib/rules/no-multiple-empty-lines.js +1 -1
  136. data/node_modules/eslint/lib/rules/no-new-native-nonconstructor.js +1 -1
  137. data/node_modules/eslint/lib/rules/no-new-symbol.js +8 -1
  138. data/node_modules/eslint/lib/rules/no-restricted-globals.js +1 -1
  139. data/node_modules/eslint/lib/rules/no-restricted-imports.js +186 -40
  140. data/node_modules/eslint/lib/rules/no-restricted-modules.js +2 -2
  141. data/node_modules/eslint/lib/rules/no-return-await.js +1 -1
  142. data/node_modules/eslint/lib/rules/no-sequences.js +1 -0
  143. data/node_modules/eslint/lib/rules/no-this-before-super.js +45 -13
  144. data/node_modules/eslint/lib/rules/no-trailing-spaces.js +2 -3
  145. data/node_modules/eslint/lib/rules/no-unneeded-ternary.js +1 -1
  146. data/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js +1 -1
  147. data/node_modules/eslint/lib/rules/no-unused-private-class-members.js +1 -1
  148. data/node_modules/eslint/lib/rules/no-unused-vars.js +197 -36
  149. data/node_modules/eslint/lib/rules/no-useless-assignment.js +566 -0
  150. data/node_modules/eslint/lib/rules/no-useless-backreference.js +1 -1
  151. data/node_modules/eslint/lib/rules/no-useless-computed-key.js +2 -2
  152. data/node_modules/eslint/lib/rules/no-useless-return.js +7 -2
  153. data/node_modules/eslint/lib/rules/object-curly-spacing.js +3 -3
  154. data/node_modules/eslint/lib/rules/object-property-newline.js +1 -1
  155. data/node_modules/eslint/lib/rules/one-var.js +5 -5
  156. data/node_modules/eslint/lib/rules/padded-blocks.js +7 -7
  157. data/node_modules/eslint/lib/rules/prefer-arrow-callback.js +3 -3
  158. data/node_modules/eslint/lib/rules/prefer-reflect.js +1 -1
  159. data/node_modules/eslint/lib/rules/prefer-regex-literals.js +1 -1
  160. data/node_modules/eslint/lib/rules/prefer-template.js +1 -1
  161. data/node_modules/eslint/lib/rules/radix.js +2 -2
  162. data/node_modules/eslint/lib/rules/semi-style.js +1 -1
  163. data/node_modules/eslint/lib/rules/sort-imports.js +1 -1
  164. data/node_modules/eslint/lib/rules/sort-keys.js +1 -1
  165. data/node_modules/eslint/lib/rules/sort-vars.js +1 -1
  166. data/node_modules/eslint/lib/rules/space-unary-ops.js +1 -1
  167. data/node_modules/eslint/lib/rules/strict.js +1 -1
  168. data/node_modules/eslint/lib/rules/use-isnan.js +101 -7
  169. data/node_modules/eslint/lib/rules/utils/ast-utils.js +16 -7
  170. data/node_modules/eslint/lib/rules/utils/char-source.js +240 -0
  171. data/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js +1 -1
  172. data/node_modules/eslint/lib/rules/utils/unicode/index.js +9 -4
  173. data/node_modules/eslint/lib/rules/yield-star-spacing.js +1 -1
  174. data/node_modules/eslint/lib/shared/runtime-info.js +1 -0
  175. data/node_modules/eslint/lib/shared/serialization.js +55 -0
  176. data/node_modules/eslint/lib/shared/stats.js +30 -0
  177. data/node_modules/eslint/lib/shared/string-utils.js +9 -11
  178. data/node_modules/eslint/lib/shared/types.js +35 -1
  179. data/node_modules/eslint/lib/source-code/index.js +3 -1
  180. data/node_modules/eslint/lib/source-code/source-code.js +299 -85
  181. data/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js +3 -3
  182. data/node_modules/eslint/lib/source-code/token-store/cursors.js +4 -2
  183. data/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js +3 -3
  184. data/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js +3 -3
  185. data/node_modules/eslint/lib/source-code/token-store/index.js +2 -2
  186. data/node_modules/eslint/lib/unsupported-api.js +3 -5
  187. data/node_modules/eslint/messages/no-config-found.js +1 -1
  188. data/node_modules/eslint/messages/plugin-conflict.js +1 -1
  189. data/node_modules/eslint/messages/plugin-invalid.js +1 -1
  190. data/node_modules/eslint/messages/plugin-missing.js +1 -1
  191. data/node_modules/eslint/package.json +32 -29
  192. data/node_modules/eslint-scope/README.md +23 -2
  193. data/node_modules/eslint-scope/dist/eslint-scope.cjs +84 -58
  194. data/node_modules/eslint-scope/lib/index.js +0 -3
  195. data/node_modules/eslint-scope/lib/pattern-visitor.js +4 -3
  196. data/node_modules/eslint-scope/lib/referencer.js +13 -11
  197. data/node_modules/eslint-scope/lib/scope-manager.js +2 -8
  198. data/node_modules/eslint-scope/lib/scope.js +64 -43
  199. data/node_modules/eslint-scope/lib/version.js +1 -1
  200. data/node_modules/eslint-scope/package.json +21 -19
  201. data/node_modules/eslint-visitor-keys/README.md +1 -1
  202. data/node_modules/eslint-visitor-keys/package.json +2 -2
  203. data/node_modules/espree/README.md +1 -1
  204. data/node_modules/espree/dist/espree.cjs +1 -1
  205. data/node_modules/espree/lib/version.js +1 -1
  206. data/node_modules/espree/package.json +18 -20
  207. data/node_modules/file-entry-cache/LICENSE +1 -1
  208. data/node_modules/file-entry-cache/README.md +6 -3
  209. data/node_modules/file-entry-cache/package.json +19 -43
  210. data/node_modules/flat-cache/README.md +8 -6
  211. data/node_modules/flat-cache/changelog.md +155 -205
  212. data/node_modules/flat-cache/package.json +16 -39
  213. data/node_modules/flat-cache/src/cache.js +22 -26
  214. data/node_modules/flat-cache/src/del.js +28 -11
  215. data/node_modules/flat-cache/src/utils.js +39 -41
  216. data/node_modules/globals/globals.json +25 -0
  217. data/node_modules/globals/index.d.ts +2074 -3
  218. data/node_modules/globals/package.json +10 -7
  219. data/node_modules/globals/readme.md +2 -14
  220. data/node_modules/keyv/package.json +4 -4
  221. data/node_modules/keyv/src/index.js +6 -11
  222. data/node_modules/npm-check-updates/build/cli.js +22 -21
  223. data/node_modules/npm-check-updates/build/cli.js.map +1 -1
  224. data/node_modules/npm-check-updates/build/index-5sFb3Tvv.js +66 -0
  225. data/node_modules/npm-check-updates/build/index-5sFb3Tvv.js.map +1 -0
  226. data/node_modules/npm-check-updates/build/index-BmUFwMVL.js +6 -0
  227. data/node_modules/npm-check-updates/build/index-BmUFwMVL.js.map +1 -0
  228. data/node_modules/npm-check-updates/build/index.d.ts +5 -2
  229. data/node_modules/npm-check-updates/build/index.js +560 -1
  230. data/node_modules/npm-check-updates/build/index.js.map +1 -1
  231. data/node_modules/npm-check-updates/build/package.json +4 -3
  232. data/node_modules/npm-check-updates/build/src/index.js +1 -1
  233. data/node_modules/npm-check-updates/build/src/index.js.map +1 -1
  234. data/node_modules/npm-check-updates/build/src/lib/libnpmconfig/index.js +2 -2
  235. data/node_modules/npm-check-updates/build/src/lib/libnpmconfig/index.js.map +1 -1
  236. data/node_modules/npm-check-updates/build/src/package-managers/bun.js +0 -6
  237. data/node_modules/npm-check-updates/build/src/package-managers/bun.js.map +1 -1
  238. data/node_modules/npm-check-updates/package.json +4 -3
  239. data/node_modules/type-fest/index.d.ts +95 -2
  240. data/node_modules/type-fest/package.json +12 -18
  241. data/node_modules/type-fest/readme.md +299 -52
  242. data/node_modules/type-fest/source/async-return-type.d.ts +4 -2
  243. data/node_modules/type-fest/source/asyncify.d.ts +5 -3
  244. data/node_modules/type-fest/source/basic.d.ts +21 -43
  245. data/node_modules/type-fest/{ts41 → source}/camel-case.d.ts +18 -17
  246. data/node_modules/type-fest/source/camel-cased-properties-deep.d.ts +54 -0
  247. data/node_modules/type-fest/source/camel-cased-properties.d.ts +36 -0
  248. data/node_modules/type-fest/source/conditional-except.d.ts +6 -4
  249. data/node_modules/type-fest/source/conditional-keys.d.ts +5 -1
  250. data/node_modules/type-fest/source/conditional-pick.d.ts +5 -3
  251. data/node_modules/type-fest/{ts41 → source}/delimiter-case.d.ts +16 -8
  252. data/node_modules/type-fest/source/delimiter-cased-properties-deep.d.ts +60 -0
  253. data/node_modules/type-fest/source/delimiter-cased-properties.d.ts +37 -0
  254. data/node_modules/type-fest/source/entries.d.ts +8 -3
  255. data/node_modules/type-fest/source/entry.d.ts +8 -3
  256. data/node_modules/type-fest/source/exact.d.ts +73 -0
  257. data/node_modules/type-fest/source/except.d.ts +38 -3
  258. data/node_modules/type-fest/source/fixed-length-array.d.ts +6 -1
  259. data/node_modules/type-fest/source/get.d.ts +184 -0
  260. data/node_modules/type-fest/source/has-optional-keys.d.ts +21 -0
  261. data/node_modules/type-fest/source/has-required-keys.d.ts +59 -0
  262. data/node_modules/type-fest/source/includes.d.ts +22 -0
  263. data/node_modules/type-fest/source/internal.d.ts +59 -0
  264. data/node_modules/type-fest/source/invariant-of.d.ts +76 -0
  265. data/node_modules/type-fest/source/iterable-element.d.ts +8 -0
  266. data/node_modules/type-fest/source/join.d.ts +30 -0
  267. data/node_modules/type-fest/source/jsonify.d.ts +90 -0
  268. data/node_modules/type-fest/{ts41 → source}/kebab-case.d.ts +7 -5
  269. data/node_modules/type-fest/source/kebab-cased-properties-deep.d.ts +47 -0
  270. data/node_modules/type-fest/source/kebab-cased-properties.d.ts +30 -0
  271. data/node_modules/type-fest/source/last-array-element.d.ts +28 -0
  272. data/node_modules/type-fest/source/literal-to-primitive.d.ts +36 -0
  273. data/node_modules/type-fest/source/literal-union.d.ts +7 -5
  274. data/node_modules/type-fest/source/merge-exclusive.d.ts +3 -1
  275. data/node_modules/type-fest/source/merge.d.ts +8 -3
  276. data/node_modules/type-fest/source/multidimensional-array.d.ts +43 -0
  277. data/node_modules/type-fest/source/multidimensional-readonly-array.d.ts +47 -0
  278. data/node_modules/type-fest/source/mutable.d.ts +4 -21
  279. data/node_modules/type-fest/source/numeric.d.ts +170 -0
  280. data/node_modules/type-fest/source/observable-like.d.ts +62 -0
  281. data/node_modules/type-fest/source/opaque.d.ts +45 -3
  282. data/node_modules/type-fest/source/optional-keys-of.d.ts +38 -0
  283. data/node_modules/type-fest/source/package-json.d.ts +64 -12
  284. data/node_modules/type-fest/source/partial-deep.d.ts +57 -16
  285. data/node_modules/type-fest/source/partial-on-undefined-deep.d.ts +70 -0
  286. data/node_modules/type-fest/{ts41 → source}/pascal-case.d.ts +6 -4
  287. data/node_modules/type-fest/source/pascal-cased-properties-deep.d.ts +54 -0
  288. data/node_modules/type-fest/source/pascal-cased-properties.d.ts +34 -0
  289. data/node_modules/type-fest/source/primitive.d.ts +13 -0
  290. data/node_modules/type-fest/source/promisable.d.ts +5 -3
  291. data/node_modules/type-fest/source/promise-value.d.ts +9 -7
  292. data/node_modules/type-fest/source/readonly-deep.d.ts +33 -7
  293. data/node_modules/type-fest/source/readonly-tuple.d.ts +41 -0
  294. data/node_modules/type-fest/source/remove-index-signature.d.ts +104 -0
  295. data/node_modules/type-fest/source/replace.d.ts +67 -0
  296. data/node_modules/type-fest/source/require-all-or-none.d.ts +36 -0
  297. data/node_modules/type-fest/source/require-at-least-one.d.ts +5 -3
  298. data/node_modules/type-fest/source/require-exactly-one.d.ts +4 -5
  299. data/node_modules/type-fest/source/required-keys-of.d.ts +29 -0
  300. data/node_modules/type-fest/source/schema.d.ts +72 -0
  301. data/node_modules/type-fest/source/screaming-snake-case.d.ts +33 -0
  302. data/node_modules/type-fest/source/set-non-nullable.d.ts +35 -0
  303. data/node_modules/type-fest/source/set-optional.d.ts +12 -11
  304. data/node_modules/type-fest/source/set-required.d.ts +12 -11
  305. data/node_modules/type-fest/source/set-return-type.d.ts +3 -1
  306. data/node_modules/type-fest/source/simplify.d.ts +83 -0
  307. data/node_modules/type-fest/{ts41 → source}/snake-case.d.ts +7 -4
  308. data/node_modules/type-fest/source/snake-cased-properties-deep.d.ts +47 -0
  309. data/node_modules/type-fest/source/snake-cased-properties.d.ts +30 -0
  310. data/node_modules/type-fest/source/split.d.ts +29 -0
  311. data/node_modules/type-fest/source/spread.d.ts +85 -0
  312. data/node_modules/type-fest/source/string-key-of.d.ts +25 -0
  313. data/node_modules/type-fest/source/stringified.d.ts +3 -1
  314. data/node_modules/type-fest/source/trim.d.ts +25 -0
  315. data/node_modules/type-fest/source/tsconfig-json.d.ts +316 -14
  316. data/node_modules/type-fest/source/typed-array.d.ts +17 -0
  317. data/node_modules/type-fest/source/union-to-intersection.d.ts +4 -2
  318. data/node_modules/type-fest/source/value-of.d.ts +3 -1
  319. data/node_modules/type-fest/source/writable.d.ts +40 -0
  320. data/package.json +2 -2
  321. metadata +86 -63
  322. data/linters/rubocop-2.7.6.yml +0 -86
  323. data/node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js +0 -66
  324. data/node_modules/@humanwhocodes/object-schema/tests/object-schema.js +0 -659
  325. data/node_modules/@humanwhocodes/object-schema/tests/validation-strategy.js +0 -186
  326. data/node_modules/eslint/conf/config-schema.js +0 -93
  327. data/node_modules/eslint/lib/cli-engine/formatters/checkstyle.js +0 -60
  328. data/node_modules/eslint/lib/cli-engine/formatters/compact.js +0 -60
  329. data/node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js +0 -41
  330. data/node_modules/eslint/lib/cli-engine/formatters/junit.js +0 -82
  331. data/node_modules/eslint/lib/cli-engine/formatters/tap.js +0 -95
  332. data/node_modules/eslint/lib/cli-engine/formatters/unix.js +0 -58
  333. data/node_modules/eslint/lib/cli-engine/formatters/visualstudio.js +0 -63
  334. data/node_modules/eslint/lib/cli-engine/xml-escape.js +0 -34
  335. data/node_modules/eslint/lib/eslint/flat-eslint.js +0 -1155
  336. data/node_modules/eslint/lib/rule-tester/flat-rule-tester.js +0 -1131
  337. data/node_modules/eslint/lib/rules/require-jsdoc.js +0 -122
  338. data/node_modules/eslint/lib/rules/utils/patterns/letters.js +0 -36
  339. data/node_modules/eslint/lib/rules/valid-jsdoc.js +0 -516
  340. data/node_modules/eslint/lib/shared/config-validator.js +0 -347
  341. data/node_modules/eslint/lib/shared/deprecation-warnings.js +0 -58
  342. data/node_modules/eslint/lib/shared/relative-module-resolver.js +0 -50
  343. data/node_modules/file-entry-cache/changelog.md +0 -163
  344. data/node_modules/flat-cache/node_modules/rimraf/CHANGELOG.md +0 -65
  345. data/node_modules/flat-cache/node_modules/rimraf/LICENSE +0 -15
  346. data/node_modules/flat-cache/node_modules/rimraf/README.md +0 -101
  347. data/node_modules/flat-cache/node_modules/rimraf/bin.js +0 -68
  348. data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/LICENSE +0 -21
  349. data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/README.md +0 -378
  350. data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/common.js +0 -238
  351. data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/glob.js +0 -790
  352. data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/LICENSE +0 -15
  353. data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/README.md +0 -230
  354. data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/minimatch.js +0 -947
  355. data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/LICENSE +0 -21
  356. data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -129
  357. data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -201
  358. data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -47
  359. data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +0 -33
  360. data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/package.json +0 -55
  361. data/node_modules/flat-cache/node_modules/rimraf/node_modules/glob/sync.js +0 -486
  362. data/node_modules/flat-cache/node_modules/rimraf/package.json +0 -32
  363. data/node_modules/flat-cache/node_modules/rimraf/rimraf.js +0 -360
  364. data/node_modules/npm-check-updates/build/index-CI_x-D21.js +0 -593
  365. data/node_modules/npm-check-updates/build/index-CI_x-D21.js.map +0 -1
  366. data/node_modules/npm-check-updates/build/index-Ci8A2QXv.js +0 -6
  367. data/node_modules/npm-check-updates/build/index-Ci8A2QXv.js.map +0 -1
  368. data/node_modules/npm-check-updates/build/index-DgVn3Gax.js +0 -36
  369. data/node_modules/npm-check-updates/build/index-DgVn3Gax.js.map +0 -1
  370. data/node_modules/npm-check-updates/build/src/types/SpawnPleaseOptions.d.ts +0 -6
  371. data/node_modules/npm-check-updates/build/src/types/SpawnPleaseOptions.js +0 -3
  372. data/node_modules/npm-check-updates/build/src/types/SpawnPleaseOptions.js.map +0 -1
  373. data/node_modules/type-fest/base.d.ts +0 -38
  374. data/node_modules/type-fest/license +0 -9
  375. data/node_modules/type-fest/source/utilities.d.ts +0 -3
  376. 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
- | {[key in ExportCondition]: Exports}
231
- | {[key: string]: Exports}; // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
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
- Standard entry points of the package, with enhanced support for ECMAScript Modules.
429
+ Subpath exports to define entry points of the package.
413
430
 
414
- [Read more.](https://nodejs.org/api/esm.html#esm_package_entry_points)
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]: 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?: Record<string, unknown>;
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 {Primitive} from './basic';
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 Primitive
32
- ? Partial<T>
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
- ? PartialObjectDeep<T>
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 as inputs. Internal helper for `PartialDeep`.
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: CamelCasedProps<ModelProps> = {
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]};
@@ -0,0 +1,13 @@
1
+ /**
2
+ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
3
+
4
+ @category Type
5
+ */
6
+ export type Primitive =
7
+ | null
8
+ | undefined
9
+ | string
10
+ | number
11
+ | boolean
12
+ | symbol
13
+ | bigint;
@@ -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
- const entry = await getLogEntry();
16
- console.log(entry);
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: PromiseValue<AsyncData> = Promise.resolve('ABC');
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, Otherwise = PromiseType> = PromiseType extends Promise<infer Value>
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 {Primitive} from './basic';
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 Primitive | ((...arguments: any[]) => unknown)
37
+ export type ReadonlyDeep<T> = T extends BuiltIns
33
38
  ? T
34
- : T extends ReadonlyMap<infer KeyType, infer ValueType>
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;