@nr1e/commons 0.1.1 → 0.1.3-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (440) hide show
  1. package/package.json +1 -1
  2. package/.editorconfig +0 -19
  3. package/.eslintignore +0 -3
  4. package/.eslintrc.json +0 -4
  5. package/.git/COMMIT_EDITMSG +0 -5
  6. package/.git/FETCH_HEAD +0 -1
  7. package/.git/HEAD +0 -1
  8. package/.git/config +0 -18
  9. package/.git/config.worktree +0 -5
  10. package/.git/description +0 -1
  11. package/.git/hooks/applypatch-msg.sample +0 -15
  12. package/.git/hooks/commit-msg.sample +0 -24
  13. package/.git/hooks/fsmonitor-watchman.sample +0 -174
  14. package/.git/hooks/post-update.sample +0 -8
  15. package/.git/hooks/pre-applypatch.sample +0 -14
  16. package/.git/hooks/pre-commit.sample +0 -49
  17. package/.git/hooks/pre-merge-commit.sample +0 -13
  18. package/.git/hooks/pre-push.sample +0 -53
  19. package/.git/hooks/pre-rebase.sample +0 -169
  20. package/.git/hooks/pre-receive.sample +0 -24
  21. package/.git/hooks/prepare-commit-msg.sample +0 -42
  22. package/.git/hooks/push-to-checkout.sample +0 -78
  23. package/.git/hooks/sendemail-validate.sample +0 -77
  24. package/.git/hooks/update.sample +0 -128
  25. package/.git/index +0 -0
  26. package/.git/info/exclude +0 -6
  27. package/.git/logs/HEAD +0 -2
  28. package/.git/logs/refs/heads/main +0 -2
  29. package/.git/logs/refs/remotes/origin/main +0 -2
  30. package/.git/objects/07/c0af7cd711cab6a55ad3dc349ac8c70775623c +0 -0
  31. package/.git/objects/0d/698432e2c44311c17b845cc63093a898972b95 +0 -0
  32. package/.git/objects/10/ba4a7d64968326293182d571a9c73f5e041fb6 +0 -3
  33. package/.git/objects/12/069a5aa45479564e00749f730582627a276a55 +0 -3
  34. package/.git/objects/14/5ab9cf82c40696a07ab42f117ba199acb2a50b +0 -4
  35. package/.git/objects/17/7b0dc4bf884f8ae0403b4aad053e76baafd632 +0 -2
  36. package/.git/objects/1d/a517ce3527df45a4f28e52ff2c0d9d1c8179f6 +0 -0
  37. package/.git/objects/27/50076ed23b5211a52ef834f40f183ddecb917a +0 -0
  38. package/.git/objects/2a/96e4bb57fa4bd69c719dca224b17b569e94e82 +0 -2
  39. package/.git/objects/2b/38c26b4ec43b8f5574acb164d2ba64bca8e230 +0 -0
  40. package/.git/objects/2c/61d463bee185f04e7c2bd1d2a15ad1117c589e +0 -0
  41. package/.git/objects/2d/22dbc836cfd75c8d7640ebe5a4fe90bd2c23c6 +0 -0
  42. package/.git/objects/2e/58414df7b4d5c972167a83270f78fc4ed508f5 +0 -0
  43. package/.git/objects/38/0be191ee415827a1217f46626fea4fefba48e5 +0 -0
  44. package/.git/objects/3a/93aa29cd19bdc95a87d15910baec8455f8b7b7 +0 -0
  45. package/.git/objects/50/150b739272269be2ede552448013eba65323da +0 -0
  46. package/.git/objects/53/2b7b796ffd3223f913a5a5e1e17743ee3591fe +0 -0
  47. package/.git/objects/54/a8535f50287f6a7a8c00aed143ca6e5ee5f5d1 +0 -0
  48. package/.git/objects/5d/4aa0709f62f1bc1fa80251208b570cb3b89d9c +0 -0
  49. package/.git/objects/63/1c43e00d4c34ba914c510f4fe2e6df15b8b06e +0 -0
  50. package/.git/objects/63/9900d13c6182e452e33a3bd638e70a0146c785 +0 -2
  51. package/.git/objects/64/3fa02661c3a1b54205729a75d2fb5f013833af +0 -0
  52. package/.git/objects/6c/59086d862516d2fffa5da2035e5003100fb5c7 +0 -0
  53. package/.git/objects/6c/b74f90a0c799eea1c54a04d8d6a8a9e9691cca +0 -2
  54. package/.git/objects/70/0e093acb1c1e55d523507411b7940a01a3bb65 +0 -0
  55. package/.git/objects/71/1ba2014bc137dece4c4156ff5e77e6abaeb95c +0 -0
  56. package/.git/objects/74/c82ffe8eb71efecbccfdf67b590949c944dd1a +0 -0
  57. package/.git/objects/76/1413a07839108abb46ef0e4490bd1c1444b4fc +0 -0
  58. package/.git/objects/77/96f8282f2c553ecdde72bc976478eb3a8a948e +0 -0
  59. package/.git/objects/79/ee123c2b23e069e35ed634d687e17f731cc702 +0 -0
  60. package/.git/objects/7d/80af9735f0527db35ecc79ae3c887e445cb3e0 +0 -0
  61. package/.git/objects/85/1d8d26c2a946ccfd5461a2573665c1fb7d71f7 +0 -0
  62. package/.git/objects/85/c5f24b8c55496f82a2680f94a7d3fa32887ea0 +0 -0
  63. package/.git/objects/87/00b3833597b600e6f0ffcfbaf622fd8cfaa9c3 +0 -1
  64. package/.git/objects/87/f31d3df8e7edbf96e45d80126f878b8e0c243f +0 -0
  65. package/.git/objects/8b/cc95b71b20c79513e9157b921238ca2c79f906 +0 -0
  66. package/.git/objects/8d/d819967bdc8457f04c1b5498bce89380d6552b +0 -7
  67. package/.git/objects/91/b0fba96bf994b6232bb923f2a9929fc258a05f +0 -0
  68. package/.git/objects/92/608c4e069a4301d466d8d18daecbe7abc9500e +0 -0
  69. package/.git/objects/94/a25f7f4cb416c083d265558da75d457237d671 +0 -0
  70. package/.git/objects/9c/69411050eac81b5dce09314516a30b38c41a20 +0 -3
  71. package/.git/objects/9f/54b5b21769da383f12fb9c7bd364bdb05e13a9 +0 -0
  72. package/.git/objects/a5/886c22eb68b152bb95ec5151504676d8e78ae1 +0 -0
  73. package/.git/objects/a6/582c9510e264f3b46fc3b20597a16923a03523 +0 -0
  74. package/.git/objects/a9/d7db9c0a81b2db47ca92e4e180b30090b27632 +0 -0
  75. package/.git/objects/ad/c418f9105db9ec488de6831584b82e3929eaef +0 -0
  76. package/.git/objects/b0/c1c68fbbad6b190434cd2bb0e807796bd56fca +0 -0
  77. package/.git/objects/b1/0f0d0ef3bc5aaf3a91be0b991cb6fe0fcadc40 +0 -0
  78. package/.git/objects/b6/3b642cfb4254fc0f7058903abc5b481895c4ef +0 -0
  79. package/.git/objects/b8/a2c461d7ffed9d4ba242c58a52341832b99e0a +0 -0
  80. package/.git/objects/ba/5b53857ced8d97f6d6e3fb3538b3273743dafc +0 -2
  81. package/.git/objects/ba/5ef7104c0d019a9692cd2d78261d96f29e916f +0 -0
  82. package/.git/objects/bc/91e0079eb00d56dcde16714748f36a10dbd525 +0 -0
  83. package/.git/objects/c1/beeb895b71b709e48560460199db11b3fc18af +0 -0
  84. package/.git/objects/c5/166c2aeebaeb0a0f7654223c843c50cd4c8953 +0 -0
  85. package/.git/objects/d4/0a2096fc36c1fd9c7a9263c458d5e8a4a5bee7 +0 -0
  86. package/.git/objects/e1/b744bc6076ebeb02fa86af98583ac22e070ec0 +0 -0
  87. package/.git/objects/e8/019be9e978a8e2f094e748cbb6ce0c7163adee +0 -0
  88. package/.git/objects/eb/1d744c4e9b47bc902647298424320078e32980 +0 -0
  89. package/.git/objects/ee/15af38be7f3c3862229e59c6b5688f8e0f6099 +0 -0
  90. package/.git/objects/f1/9e0f429f231c34432784f9e33b92ac1d598c17 +0 -0
  91. package/.git/objects/f9/86f2fe82493e85651396b6d5886316d1c890dd +0 -0
  92. package/.git/refs/heads/main +0 -1
  93. package/.git/refs/remotes/origin/main +0 -1
  94. package/.git/refs/tags/v0.1.1 +0 -1
  95. package/.git/shallow +0 -1
  96. package/.github/dependabot.yml +0 -10
  97. package/.github/workflows/ci.yml +0 -12
  98. package/.github/workflows/issues.yml +0 -13
  99. package/.github/workflows/publish.yml +0 -21
  100. package/.gitignore +0 -13
  101. package/.idea/.gitignore +0 -10
  102. package/.idea/aws.xml +0 -11
  103. package/.idea/codeStyles/Project.xml +0 -58
  104. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  105. package/.idea/commons-js.iml +0 -14
  106. package/.idea/inspectionProfiles/Project_Default.xml +0 -7
  107. package/.idea/misc.xml +0 -6
  108. package/.idea/modules.xml +0 -8
  109. package/.idea/prettier.xml +0 -6
  110. package/.idea/vcs.xml +0 -6
  111. package/.npmrc +0 -1
  112. package/.prettierignore +0 -7
  113. package/.prettierrc.cjs +0 -3
  114. package/LICENSE +0 -26
  115. package/README.md +0 -14
  116. package/coverage/base.css +0 -224
  117. package/coverage/bitsnbytes/b64.mts.html +0 -559
  118. package/coverage/bitsnbytes/index.html +0 -131
  119. package/coverage/bitsnbytes/index.mts.html +0 -88
  120. package/coverage/clover.xml +0 -1003
  121. package/coverage/coverage-final.json +0 -15
  122. package/coverage/errors/errors.mts.html +0 -898
  123. package/coverage/errors/index.html +0 -131
  124. package/coverage/errors/index.mts.html +0 -88
  125. package/coverage/favicon.png +0 -0
  126. package/coverage/http/http-method.mts.html +0 -112
  127. package/coverage/http/http-status-code.mts.html +0 -211
  128. package/coverage/http/index.html +0 -146
  129. package/coverage/http/index.mts.html +0 -91
  130. package/coverage/index.html +0 -191
  131. package/coverage/lang/index.html +0 -146
  132. package/coverage/lang/index.mts.html +0 -91
  133. package/coverage/lang/sleep.mts.html +0 -109
  134. package/coverage/lang/type-functions.mts.html +0 -124
  135. package/coverage/oauth/crypto-functions.mts.html +0 -217
  136. package/coverage/oauth/index.html +0 -131
  137. package/coverage/oauth/index.mts.html +0 -88
  138. package/coverage/prettify.css +0 -1
  139. package/coverage/sort-arrow-sprite.png +0 -0
  140. package/coverage/validator/index.html +0 -131
  141. package/coverage/validator/index.mts.html +0 -88
  142. package/coverage/validator/validators.mts.html +0 -1237
  143. package/dist/bitsnbytes/b64.test.d.mts +0 -2
  144. package/dist/bitsnbytes/b64.test.d.mts.map +0 -1
  145. package/dist/bitsnbytes/b64.test.mjs +0 -71
  146. package/dist/bitsnbytes/b64.test.mjs.map +0 -1
  147. package/dist/errors/errors.test.d.mts +0 -2
  148. package/dist/errors/errors.test.d.mts.map +0 -1
  149. package/dist/errors/errors.test.mjs +0 -45
  150. package/dist/errors/errors.test.mjs.map +0 -1
  151. package/dist/oauth/crypto-functions.test.d.mts +0 -2
  152. package/dist/oauth/crypto-functions.test.d.mts.map +0 -1
  153. package/dist/oauth/crypto-functions.test.mjs +0 -36
  154. package/dist/oauth/crypto-functions.test.mjs.map +0 -1
  155. package/dist/package.json +0 -72
  156. package/dist/validator/validators.test.d.mts +0 -2
  157. package/dist/validator/validators.test.d.mts.map +0 -1
  158. package/dist/validator/validators.test.mjs +0 -177
  159. package/dist/validator/validators.test.mjs.map +0 -1
  160. package/node_modules/@eslint/eslintrc/LICENSE +0 -19
  161. package/node_modules/@eslint/eslintrc/README.md +0 -115
  162. package/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs +0 -1104
  163. package/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map +0 -1
  164. package/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +0 -4344
  165. package/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map +0 -1
  166. package/node_modules/@eslint/eslintrc/package.json +0 -82
  167. package/node_modules/@eslint/eslintrc/universal.js +0 -9
  168. package/node_modules/@eslint/js/LICENSE +0 -19
  169. package/node_modules/@eslint/js/README.md +0 -57
  170. package/node_modules/@eslint/js/package.json +0 -31
  171. package/node_modules/@eslint/js/src/index.js +0 -17
  172. package/node_modules/@eslint-community/eslint-utils/LICENSE +0 -21
  173. package/node_modules/@eslint-community/eslint-utils/README.md +0 -37
  174. package/node_modules/@eslint-community/eslint-utils/index.js +0 -2068
  175. package/node_modules/@eslint-community/eslint-utils/index.js.map +0 -1
  176. package/node_modules/@eslint-community/eslint-utils/index.mjs +0 -2027
  177. package/node_modules/@eslint-community/eslint-utils/index.mjs.map +0 -1
  178. package/node_modules/@eslint-community/eslint-utils/package.json +0 -73
  179. package/node_modules/@eslint-community/regexpp/LICENSE +0 -21
  180. package/node_modules/@eslint-community/regexpp/README.md +0 -177
  181. package/node_modules/@eslint-community/regexpp/index.d.ts +0 -1065
  182. package/node_modules/@eslint-community/regexpp/index.js +0 -2747
  183. package/node_modules/@eslint-community/regexpp/index.js.map +0 -1
  184. package/node_modules/@eslint-community/regexpp/index.mjs +0 -2737
  185. package/node_modules/@eslint-community/regexpp/index.mjs.map +0 -1
  186. package/node_modules/@eslint-community/regexpp/package.json +0 -93
  187. package/node_modules/@types/node/LICENSE +0 -21
  188. package/node_modules/@types/node/README.md +0 -15
  189. package/node_modules/@types/node/package.json +0 -217
  190. package/node_modules/@typescript-eslint/eslint-plugin/LICENSE +0 -21
  191. package/node_modules/@typescript-eslint/eslint-plugin/README.md +0 -10
  192. package/node_modules/@typescript-eslint/eslint-plugin/dist/index.js +0 -23
  193. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/README.md +0 -23
  194. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/TEMPLATE.md +0 -26
  195. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md +0 -93
  196. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.md +0 -103
  197. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.md +0 -40
  198. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.md +0 -148
  199. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.md +0 -39
  200. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md +0 -183
  201. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/block-spacing.md +0 -12
  202. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md +0 -12
  203. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md +0 -10
  204. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.md +0 -114
  205. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md +0 -22
  206. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md +0 -12
  207. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-generic-constructors.md +0 -73
  208. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-indexed-object-style.md +0 -80
  209. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.md +0 -108
  210. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.md +0 -82
  211. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-exports.md +0 -100
  212. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.md +0 -105
  213. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md +0 -48
  214. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md +0 -77
  215. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md +0 -319
  216. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md +0 -331
  217. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md +0 -250
  218. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md +0 -12
  219. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md +0 -20
  220. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md +0 -12
  221. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/key-spacing.md +0 -12
  222. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md +0 -12
  223. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-around-comment.md +0 -37
  224. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md +0 -63
  225. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md +0 -161
  226. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md +0 -1360
  227. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.md +0 -110
  228. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.md +0 -706
  229. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md +0 -35
  230. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.md +0 -88
  231. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md +0 -56
  232. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-void-expression.md +0 -116
  233. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md +0 -12
  234. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-enum-values.md +0 -50
  235. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-imports.md +0 -12
  236. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-type-constituents.md +0 -61
  237. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.md +0 -53
  238. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md +0 -88
  239. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.md +0 -70
  240. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.md +0 -174
  241. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.md +0 -52
  242. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md +0 -12
  243. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md +0 -12
  244. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.md +0 -294
  245. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md +0 -106
  246. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.md +0 -56
  247. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implicit-any-catch.md +0 -73
  248. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.md +0 -101
  249. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-import-type-side-effects.md +0 -75
  250. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.md +0 -103
  251. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.md +0 -12
  252. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.md +0 -113
  253. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.md +0 -12
  254. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.md +0 -12
  255. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.md +0 -131
  256. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-meaningless-void-operator.md +0 -47
  257. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.md +0 -46
  258. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.md +0 -245
  259. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-mixed-enums.md +0 -88
  260. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.md +0 -129
  261. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md +0 -49
  262. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md +0 -35
  263. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.md +0 -42
  264. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.md +0 -406
  265. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.md +0 -73
  266. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redundant-type-constituents.md +0 -78
  267. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.md +0 -37
  268. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-imports.md +0 -63
  269. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.md +0 -101
  270. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.md +0 -38
  271. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-throw-literal.md +0 -111
  272. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.md +0 -602
  273. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md +0 -133
  274. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.md +0 -103
  275. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +0 -51
  276. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md +0 -73
  277. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md +0 -77
  278. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md +0 -55
  279. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-argument.md +0 -83
  280. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.md +0 -86
  281. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.md +0 -58
  282. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-declaration-merging.md +0 -54
  283. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-enum-comparison.md +0 -75
  284. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.md +0 -64
  285. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.md +0 -103
  286. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.md +0 -12
  287. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.md +0 -12
  288. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.md +0 -97
  289. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.md +0 -21
  290. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-empty-export.md +0 -43
  291. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.md +0 -37
  292. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md +0 -41
  293. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/object-curly-spacing.md +0 -12
  294. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/padding-line-between-statements.md +0 -35
  295. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/parameter-properties.md +0 -485
  296. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.md +0 -44
  297. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.md +0 -62
  298. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.md +0 -46
  299. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.md +0 -92
  300. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.md +0 -77
  301. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.md +0 -101
  302. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md +0 -47
  303. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.md +0 -164
  304. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.md +0 -71
  305. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md +0 -268
  306. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.md +0 -87
  307. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md +0 -58
  308. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.md +0 -46
  309. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-return-this-type.md +0 -87
  310. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md +0 -57
  311. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.md +0 -69
  312. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.md +0 -59
  313. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md +0 -12
  314. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md +0 -78
  315. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.md +0 -24
  316. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.md +0 -208
  317. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.md +0 -117
  318. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.md +0 -216
  319. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md +0 -16
  320. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-constituents.md +0 -101
  321. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-union-intersection-members.md +0 -106
  322. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-blocks.md +0 -42
  323. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md +0 -12
  324. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-infix-ops.md +0 -16
  325. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.md +0 -183
  326. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.md +0 -106
  327. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.md +0 -61
  328. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md +0 -303
  329. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.md +0 -320
  330. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.md +0 -103
  331. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.md +0 -70
  332. package/node_modules/@typescript-eslint/eslint-plugin/index.d.ts +0 -4
  333. package/node_modules/@typescript-eslint/eslint-plugin/package.json +0 -87
  334. package/node_modules/@typescript-eslint/parser/LICENSE +0 -22
  335. package/node_modules/@typescript-eslint/parser/README.md +0 -10
  336. package/node_modules/@typescript-eslint/parser/dist/index.js +0 -17
  337. package/node_modules/@typescript-eslint/parser/package.json +0 -75
  338. package/node_modules/@typescript-eslint/scope-manager/LICENSE +0 -21
  339. package/node_modules/@typescript-eslint/scope-manager/README.md +0 -8
  340. package/node_modules/@typescript-eslint/scope-manager/dist/index.js +0 -31
  341. package/node_modules/@typescript-eslint/scope-manager/package.json +0 -67
  342. package/node_modules/@typescript-eslint/type-utils/LICENSE +0 -21
  343. package/node_modules/@typescript-eslint/type-utils/README.md +0 -12
  344. package/node_modules/@typescript-eslint/type-utils/dist/index.js +0 -36
  345. package/node_modules/@typescript-eslint/type-utils/package.json +0 -71
  346. package/node_modules/@typescript-eslint/types/LICENSE +0 -21
  347. package/node_modules/@typescript-eslint/types/README.md +0 -12
  348. package/node_modules/@typescript-eslint/types/dist/index.js +0 -24
  349. package/node_modules/@typescript-eslint/types/package.json +0 -84
  350. package/node_modules/@typescript-eslint/typescript-estree/LICENSE +0 -26
  351. package/node_modules/@typescript-eslint/typescript-estree/README.md +0 -10
  352. package/node_modules/@typescript-eslint/typescript-estree/dist/index.js +0 -38
  353. package/node_modules/@typescript-eslint/typescript-estree/package.json +0 -85
  354. package/node_modules/@typescript-eslint/utils/LICENSE +0 -21
  355. package/node_modules/@typescript-eslint/utils/README.md +0 -10
  356. package/node_modules/@typescript-eslint/utils/dist/index.js +0 -41
  357. package/node_modules/@typescript-eslint/utils/package.json +0 -70
  358. package/node_modules/@typescript-eslint/visitor-keys/LICENSE +0 -21
  359. package/node_modules/@typescript-eslint/visitor-keys/README.md +0 -10
  360. package/node_modules/@typescript-eslint/visitor-keys/dist/index.js +0 -8
  361. package/node_modules/@typescript-eslint/visitor-keys/package.json +0 -60
  362. package/node_modules/@vitest/coverage-v8/LICENSE +0 -21
  363. package/node_modules/@vitest/coverage-v8/dist/index.js +0 -54
  364. package/node_modules/@vitest/coverage-v8/package.json +0 -72
  365. package/pnpm-lock.yaml +0 -3277
  366. package/src/bitsnbytes/b64.mts +0 -158
  367. package/src/bitsnbytes/b64.test.mts +0 -78
  368. package/src/bitsnbytes/index.mts +0 -1
  369. package/src/errors/errors.mts +0 -271
  370. package/src/errors/errors.test.mts +0 -74
  371. package/src/errors/index.mts +0 -1
  372. package/src/http/http-method.mts +0 -9
  373. package/src/http/http-status-code.mts +0 -42
  374. package/src/http/index.mts +0 -2
  375. package/src/lang/index.mts +0 -2
  376. package/src/lang/sleep.mts +0 -8
  377. package/src/lang/type-functions.mts +0 -13
  378. package/src/oauth/crypto-functions.mts +0 -44
  379. package/src/oauth/crypto-functions.test.mts +0 -48
  380. package/src/oauth/index.mts +0 -1
  381. package/src/validator/index.mts +0 -1
  382. package/src/validator/validators.mts +0 -384
  383. package/src/validator/validators.test.mts +0 -245
  384. package/tsconfig.json +0 -18
  385. /package/{dist/bitsnbytes → bitsnbytes}/b64.d.mts +0 -0
  386. /package/{dist/bitsnbytes → bitsnbytes}/b64.d.mts.map +0 -0
  387. /package/{dist/bitsnbytes → bitsnbytes}/b64.mjs +0 -0
  388. /package/{dist/bitsnbytes → bitsnbytes}/b64.mjs.map +0 -0
  389. /package/{dist/bitsnbytes → bitsnbytes}/index.d.mts +0 -0
  390. /package/{dist/bitsnbytes → bitsnbytes}/index.d.mts.map +0 -0
  391. /package/{dist/bitsnbytes → bitsnbytes}/index.mjs +0 -0
  392. /package/{dist/bitsnbytes → bitsnbytes}/index.mjs.map +0 -0
  393. /package/{dist/errors → errors}/errors.d.mts +0 -0
  394. /package/{dist/errors → errors}/errors.d.mts.map +0 -0
  395. /package/{dist/errors → errors}/errors.mjs +0 -0
  396. /package/{dist/errors → errors}/errors.mjs.map +0 -0
  397. /package/{dist/errors → errors}/index.d.mts +0 -0
  398. /package/{dist/errors → errors}/index.d.mts.map +0 -0
  399. /package/{dist/errors → errors}/index.mjs +0 -0
  400. /package/{dist/errors → errors}/index.mjs.map +0 -0
  401. /package/{dist/http → http}/http-method.d.mts +0 -0
  402. /package/{dist/http → http}/http-method.d.mts.map +0 -0
  403. /package/{dist/http → http}/http-method.mjs +0 -0
  404. /package/{dist/http → http}/http-method.mjs.map +0 -0
  405. /package/{dist/http → http}/http-status-code.d.mts +0 -0
  406. /package/{dist/http → http}/http-status-code.d.mts.map +0 -0
  407. /package/{dist/http → http}/http-status-code.mjs +0 -0
  408. /package/{dist/http → http}/http-status-code.mjs.map +0 -0
  409. /package/{dist/http → http}/index.d.mts +0 -0
  410. /package/{dist/http → http}/index.d.mts.map +0 -0
  411. /package/{dist/http → http}/index.mjs +0 -0
  412. /package/{dist/http → http}/index.mjs.map +0 -0
  413. /package/{dist/lang → lang}/index.d.mts +0 -0
  414. /package/{dist/lang → lang}/index.d.mts.map +0 -0
  415. /package/{dist/lang → lang}/index.mjs +0 -0
  416. /package/{dist/lang → lang}/index.mjs.map +0 -0
  417. /package/{dist/lang → lang}/sleep.d.mts +0 -0
  418. /package/{dist/lang → lang}/sleep.d.mts.map +0 -0
  419. /package/{dist/lang → lang}/sleep.mjs +0 -0
  420. /package/{dist/lang → lang}/sleep.mjs.map +0 -0
  421. /package/{dist/lang → lang}/type-functions.d.mts +0 -0
  422. /package/{dist/lang → lang}/type-functions.d.mts.map +0 -0
  423. /package/{dist/lang → lang}/type-functions.mjs +0 -0
  424. /package/{dist/lang → lang}/type-functions.mjs.map +0 -0
  425. /package/{dist/oauth → oauth}/crypto-functions.d.mts +0 -0
  426. /package/{dist/oauth → oauth}/crypto-functions.d.mts.map +0 -0
  427. /package/{dist/oauth → oauth}/crypto-functions.mjs +0 -0
  428. /package/{dist/oauth → oauth}/crypto-functions.mjs.map +0 -0
  429. /package/{dist/oauth → oauth}/index.d.mts +0 -0
  430. /package/{dist/oauth → oauth}/index.d.mts.map +0 -0
  431. /package/{dist/oauth → oauth}/index.mjs +0 -0
  432. /package/{dist/oauth → oauth}/index.mjs.map +0 -0
  433. /package/{dist/validator → validator}/index.d.mts +0 -0
  434. /package/{dist/validator → validator}/index.d.mts.map +0 -0
  435. /package/{dist/validator → validator}/index.mjs +0 -0
  436. /package/{dist/validator → validator}/index.mjs.map +0 -0
  437. /package/{dist/validator → validator}/validators.d.mts +0 -0
  438. /package/{dist/validator → validator}/validators.d.mts.map +0 -0
  439. /package/{dist/validator → validator}/validators.mjs +0 -0
  440. /package/{dist/validator → validator}/validators.mjs.map +0 -0
@@ -1,16 +0,0 @@
1
- ---
2
- description: 'Require or disallow semicolons instead of ASI.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/semi** for documentation.
8
-
9
- This rule enforces consistent use of semicolons after statements.
10
-
11
- ## Examples
12
-
13
- This rule extends the base [`eslint/semi`](https://eslint.org/docs/rules/semi) rule.
14
- It adds support for TypeScript features that require semicolons.
15
-
16
- See also the [`@typescript-eslint/member-delimiter-style`](member-delimiter-style.md) rule, which allows you to specify the delimiter for `type` and `interface` members.
@@ -1,101 +0,0 @@
1
- ---
2
- description: 'Enforce constituents of a type union/intersection to be sorted alphabetically.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/sort-type-constituents** for documentation.
8
-
9
- Sorting union (`|`) and intersection (`&`) types can help:
10
-
11
- - keep your codebase standardized
12
- - find repeated types
13
- - reduce diff churn
14
-
15
- This rule reports on any types that aren't sorted alphabetically.
16
-
17
- > Types are sorted case-insensitively and treating numbers like a human would, falling back to character code sorting in case of ties.
18
-
19
- ## Examples
20
-
21
- <!--tabs-->
22
-
23
- ### ❌ Incorrect
24
-
25
- ```ts
26
- type T1 = B | A;
27
-
28
- type T2 = { b: string } & { a: string };
29
-
30
- type T3 = [1, 2, 4] & [1, 2, 3];
31
-
32
- type T4 =
33
- | [1, 2, 4]
34
- | [1, 2, 3]
35
- | { b: string }
36
- | { a: string }
37
- | (() => void)
38
- | (() => string)
39
- | 'b'
40
- | 'a'
41
- | 'b'
42
- | 'a'
43
- | readonly string[]
44
- | readonly number[]
45
- | string[]
46
- | number[]
47
- | B
48
- | A
49
- | string
50
- | any;
51
- ```
52
-
53
- ### ✅ Correct
54
-
55
- ```ts
56
- type T1 = A | B;
57
-
58
- type T2 = { a: string } & { b: string };
59
-
60
- type T3 = [1, 2, 3] & [1, 2, 4];
61
-
62
- type T4 =
63
- | A
64
- | B
65
- | number[]
66
- | string[]
67
- | any
68
- | string
69
- | readonly number[]
70
- | readonly string[]
71
- | 'a'
72
- | 'a'
73
- | 'b'
74
- | 'b'
75
- | (() => string)
76
- | (() => void)
77
- | { a: string }
78
- | { b: string }
79
- | [1, 2, 3]
80
- | [1, 2, 4];
81
- ```
82
-
83
- ## Options
84
-
85
- ### `groupOrder`
86
-
87
- Each constituent of the type is placed into a group, and then the rule sorts alphabetically within each group.
88
- The ordering of groups is determined by this option.
89
-
90
- - `conditional` - Conditional types (`A extends B ? C : D`)
91
- - `function` - Function and constructor types (`() => void`, `new () => type`)
92
- - `import` - Import types (`import('path')`)
93
- - `intersection` - Intersection types (`A & B`)
94
- - `keyword` - Keyword types (`any`, `string`, etc)
95
- - `literal` - Literal types (`1`, `'b'`, `true`, etc)
96
- - `named` - Named types (`A`, `A['prop']`, `B[]`, `Array<C>`)
97
- - `object` - Object types (`{ a: string }`, `{ [key: string]: number }`)
98
- - `operator` - Operator types (`keyof A`, `typeof B`, `readonly C[]`)
99
- - `tuple` - Tuple types (`[A, B, C]`)
100
- - `union` - Union types (`A | B`)
101
- - `nullish` - `null` and `undefined`
@@ -1,106 +0,0 @@
1
- ---
2
- description: 'Enforce members of a type union/intersection to be sorted alphabetically.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/sort-type-union-intersection-members** for documentation.
8
-
9
- :::danger Deprecated
10
-
11
- This rule has been renamed to [`sort-type-constituents`](./sort-type-constituents.md).
12
- :::
13
-
14
- Sorting union (`|`) and intersection (`&`) types can help:
15
-
16
- - keep your codebase standardized
17
- - find repeated types
18
- - reduce diff churn
19
-
20
- This rule reports on any types that aren't sorted alphabetically.
21
-
22
- > Types are sorted case-insensitively and treating numbers like a human would, falling back to character code sorting in case of ties.
23
-
24
- ## Examples
25
-
26
- <!--tabs-->
27
-
28
- ### ❌ Incorrect
29
-
30
- ```ts
31
- type T1 = B | A;
32
-
33
- type T2 = { b: string } & { a: string };
34
-
35
- type T3 = [1, 2, 4] & [1, 2, 3];
36
-
37
- type T4 =
38
- | [1, 2, 4]
39
- | [1, 2, 3]
40
- | { b: string }
41
- | { a: string }
42
- | (() => void)
43
- | (() => string)
44
- | 'b'
45
- | 'a'
46
- | 'b'
47
- | 'a'
48
- | readonly string[]
49
- | readonly number[]
50
- | string[]
51
- | number[]
52
- | B
53
- | A
54
- | string
55
- | any;
56
- ```
57
-
58
- ### ✅ Correct
59
-
60
- ```ts
61
- type T1 = A | B;
62
-
63
- type T2 = { a: string } & { b: string };
64
-
65
- type T3 = [1, 2, 3] & [1, 2, 4];
66
-
67
- type T4 =
68
- | any
69
- | string
70
- | A
71
- | B
72
- | number[]
73
- | string[]
74
- | readonly number[]
75
- | readonly string[]
76
- | 'a'
77
- | 'b'
78
- | 'a'
79
- | 'b'
80
- | (() => string)
81
- | (() => void)
82
- | { a: string }
83
- | { b: string }
84
- | [1, 2, 3]
85
- | [1, 2, 4];
86
- ```
87
-
88
- ## Options
89
-
90
- ### `groupOrder`
91
-
92
- Each member of the type is placed into a group, and then the rule sorts alphabetically within each group.
93
- The ordering of groups is determined by this option.
94
-
95
- - `conditional` - Conditional types (`A extends B ? C : D`)
96
- - `function` - Function and constructor types (`() => void`, `new () => type`)
97
- - `import` - Import types (`import('path')`)
98
- - `intersection` - Intersection types (`A & B`)
99
- - `keyword` - Keyword types (`any`, `string`, etc)
100
- - `literal` - Literal types (`1`, `'b'`, `true`, etc)
101
- - `named` - Named types (`A`, `A['prop']`, `B[]`, `Array<C>`)
102
- - `object` - Object types (`{ a: string }`, `{ [key: string]: number }`)
103
- - `operator` - Operator types (`keyof A`, `typeof B`, `readonly C[]`)
104
- - `tuple` - Tuple types (`[A, B, C]`)
105
- - `union` - Union types (`A | B`)
106
- - `nullish` - `null` and `undefined`
@@ -1,42 +0,0 @@
1
- ---
2
- description: 'Enforce consistent spacing before blocks.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/space-before-blocks** for documentation.
8
-
9
- ## Examples
10
-
11
- This rule extends the base [`eslint/space-before-blocks`](https://eslint.org/docs/rules/space-before-blocks) rule.
12
- It adds support for interfaces and enums.
13
-
14
- <!-- tabs -->
15
-
16
- ### ❌ Incorrect
17
-
18
- ```ts
19
- enum Breakpoint{
20
- Large, Medium;
21
- }
22
-
23
- interface State{
24
- currentBreakpoint: Breakpoint;
25
- }
26
- ```
27
-
28
- ### ✅ Correct
29
-
30
- ```ts
31
- enum Breakpoint {
32
- Large, Medium;
33
- }
34
-
35
- interface State {
36
- currentBreakpoint: Breakpoint;
37
- }
38
- ```
39
-
40
- ## Options
41
-
42
- In case a more specific options object is passed these blocks will follow `classes` configuration option.
@@ -1,12 +0,0 @@
1
- ---
2
- description: 'Enforce consistent spacing before function parenthesis.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/space-before-function-paren** for documentation.
8
-
9
- ## Examples
10
-
11
- This rule extends the base [`eslint/space-before-function-paren`](https://eslint.org/docs/rules/space-before-function-paren) rule.
12
- It adds support for generic type parameters on function calls.
@@ -1,16 +0,0 @@
1
- ---
2
- description: 'Require spacing around infix operators.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/space-infix-ops** for documentation.
8
-
9
- This rule extends the base [`eslint/space-infix-ops`](https://eslint.org/docs/rules/space-infix-ops) rule.
10
- It adds support for enum members.
11
-
12
- ```ts
13
- enum MyEnum {
14
- KEY = 'value',
15
- }
16
- ```
@@ -1,183 +0,0 @@
1
- ---
2
- description: 'Disallow certain types in boolean expressions.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/strict-boolean-expressions** for documentation.
8
-
9
- Forbids usage of non-boolean types in expressions where a boolean is expected.
10
- `boolean` and `never` types are always allowed.
11
- Additional types which are considered safe in a boolean context can be configured via options.
12
-
13
- The following nodes are considered boolean expressions and their type is checked:
14
-
15
- - Argument to the logical negation operator (`!arg`).
16
- - The condition in a conditional expression (`cond ? x : y`).
17
- - Conditions for `if`, `for`, `while`, and `do-while` statements.
18
- - Operands of logical binary operators (`lhs || rhs` and `lhs && rhs`).
19
- - Right-hand side operand is ignored when it's not a descendant of another boolean expression.
20
- This is to allow usage of boolean operators for their short-circuiting behavior.
21
-
22
- ## Examples
23
-
24
- <!--tabs-->
25
-
26
- ### ❌ Incorrect
27
-
28
- ```ts
29
- // nullable numbers are considered unsafe by default
30
- let num: number | undefined = 0;
31
- if (num) {
32
- console.log('num is defined');
33
- }
34
-
35
- // nullable strings are considered unsafe by default
36
- let str: string | null = null;
37
- if (!str) {
38
- console.log('str is empty');
39
- }
40
-
41
- // nullable booleans are considered unsafe by default
42
- function foo(bool?: boolean) {
43
- if (bool) {
44
- bar();
45
- }
46
- }
47
-
48
- // `any`, unconstrained generics and unions of more than one primitive type are disallowed
49
- const foo = <T>(arg: T) => (arg ? 1 : 0);
50
-
51
- // always-truthy and always-falsy types are disallowed
52
- let obj = {};
53
- while (obj) {
54
- obj = getObj();
55
- }
56
- ```
57
-
58
- ### ✅ Correct
59
-
60
- ```tsx
61
- // Using logical operator short-circuiting is allowed
62
- const Component = () => {
63
- const entry = map.get('foo') || {};
64
- return entry && <p>Name: {entry.name}</p>;
65
- };
66
-
67
- // nullable values should be checked explicitly against null or undefined
68
- let num: number | undefined = 0;
69
- if (num != null) {
70
- console.log('num is defined');
71
- }
72
-
73
- let str: string | null = null;
74
- if (str != null && !str) {
75
- console.log('str is empty');
76
- }
77
-
78
- function foo(bool?: boolean) {
79
- if (bool ?? false) {
80
- bar();
81
- }
82
- }
83
-
84
- // `any` types should be cast to boolean explicitly
85
- const foo = (arg: any) => (Boolean(arg) ? 1 : 0);
86
- ```
87
-
88
- ## Options
89
-
90
- ### `allowString`
91
-
92
- Allows `string` in a boolean context.
93
- This is safe because strings have only one falsy value (`""`).
94
- Set this to `false` if you prefer the explicit `str != ""` or `str.length > 0` style.
95
-
96
- ### `allowNumber`
97
-
98
- Allows `number` in a boolean context.
99
- This is safe because numbers have only two falsy values (`0` and `NaN`).
100
- Set this to `false` if you prefer the explicit `num != 0` and `!Number.isNaN(num)` style.
101
-
102
- ### `allowNullableObject`
103
-
104
- Allows `object | function | symbol | null | undefined` in a boolean context.
105
- This is safe because objects, functions and symbols don't have falsy values.
106
- Set this to `false` if you prefer the explicit `obj != null` style.
107
-
108
- ### `allowNullableBoolean`
109
-
110
- Allows `boolean | null | undefined` in a boolean context.
111
- This is unsafe because nullable booleans can be either `false` or nullish.
112
- Set this to `false` if you want to enforce explicit `bool ?? false` or `bool ?? true` style.
113
- Set this to `true` if you don't mind implicitly treating false the same as a nullish value.
114
-
115
- ### `allowNullableString`
116
-
117
- Allows `string | null | undefined` in a boolean context.
118
- This is unsafe because nullable strings can be either an empty string or nullish.
119
- Set this to `true` if you don't mind implicitly treating an empty string the same as a nullish value.
120
-
121
- ### `allowNullableNumber`
122
-
123
- Allows `number | null | undefined` in a boolean context.
124
- This is unsafe because nullable numbers can be either a falsy number or nullish.
125
- Set this to `true` if you don't mind implicitly treating zero or NaN the same as a nullish value.
126
-
127
- ### `allowNullableEnum`
128
-
129
- Allows `enum | null | undefined` in a boolean context.
130
- This is unsafe because nullable enums can be either a falsy number or nullish.
131
- Set this to `true` if you don't mind implicitly treating an enum whose value is zero the same as a nullish value.
132
-
133
- ### `allowAny`
134
-
135
- Allows `any` in a boolean context.
136
- This is unsafe for obvious reasons.
137
- Set this to `true` at your own risk.
138
-
139
- ### `allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing`
140
-
141
- If this is set to `false`, then the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`.
142
-
143
- Without `strictNullChecks`, TypeScript essentially erases `undefined` and `null` from the types. This means when this rule inspects the types from a variable, **it will not be able to tell that the variable might be `null` or `undefined`**, which essentially makes this rule a lot less useful.
144
-
145
- You should be using `strictNullChecks` to ensure complete type-safety in your codebase.
146
-
147
- If for some reason you cannot turn on `strictNullChecks`, but still want to use this rule - you can use this option to allow it - but know that the behavior of this rule is _undefined_ with the compiler option turned off. We will not accept bug reports if you are using this option.
148
-
149
- ## Fixes and Suggestions
150
-
151
- This rule provides following fixes and suggestions for particular types in boolean context:
152
-
153
- - `boolean` - Always allowed - no fix needed.
154
- - `string` - (when `allowString` is `false`) - Provides following suggestions:
155
- - Change condition to check string's length (`str` → `str.length > 0`)
156
- - Change condition to check for empty string (`str` → `str !== ""`)
157
- - Explicitly cast value to a boolean (`str` → `Boolean(str)`)
158
- - `number` - (when `allowNumber` is `false`):
159
- - For `array.length` - Provides **autofix**:
160
- - Change condition to check for 0 (`array.length` → `array.length > 0`)
161
- - For other number values - Provides following suggestions:
162
- - Change condition to check for 0 (`num` → `num !== 0`)
163
- - Change condition to check for NaN (`num` → `!Number.isNaN(num)`)
164
- - Explicitly cast value to a boolean (`num` → `Boolean(num)`)
165
- - `object | null | undefined` - (when `allowNullableObject` is `false`) - Provides **autofix**:
166
- - Change condition to check for null/undefined (`maybeObj` → `maybeObj != null`)
167
- - `boolean | null | undefined` - Provides following suggestions:
168
- - Explicitly treat nullish value the same as false (`maybeBool` → `maybeBool ?? false`)
169
- - Change condition to check for true/false (`maybeBool` → `maybeBool === true`)
170
- - `string | null | undefined` - Provides following suggestions:
171
- - Change condition to check for null/undefined (`maybeStr` → `maybeStr != null`)
172
- - Explicitly treat nullish value the same as an empty string (`maybeStr` → `maybeStr ?? ""`)
173
- - Explicitly cast value to a boolean (`maybeStr` → `Boolean(maybeStr)`)
174
- - `number | null | undefined` - Provides following suggestions:
175
- - Change condition to check for null/undefined (`maybeNum` → `maybeNum != null`)
176
- - Explicitly treat nullish value the same as 0 (`maybeNum` → `maybeNum ?? 0`)
177
- - Explicitly cast value to a boolean (`maybeNum` → `Boolean(maybeNum)`)
178
- - `any` and `unknown` - Provides following suggestions:
179
- - Explicitly cast value to a boolean (`value` → `Boolean(value)`)
180
-
181
- ## Related To
182
-
183
- - [no-unnecessary-condition](./no-unnecessary-condition.md) - Similar rule which reports always-truthy and always-falsy values in conditions
@@ -1,106 +0,0 @@
1
- ---
2
- description: 'Require switch-case statements to be exhaustive with union type.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/switch-exhaustiveness-check** for documentation.
8
-
9
- When working with union types in TypeScript, it's common to want to write a `switch` statement intended to contain a `case` for each constituent (possible type in the union).
10
- However, if the union type changes, it's easy to forget to modify the cases to account for any new types.
11
-
12
- This rule reports when a `switch` statement over a value typed as a union of literals is missing a case for any of those literal types and does not have a `default` clause.
13
-
14
- ## Examples
15
-
16
- <!--tabs-->
17
-
18
- ### ❌ Incorrect
19
-
20
- ```ts
21
- type Day =
22
- | 'Monday'
23
- | 'Tuesday'
24
- | 'Wednesday'
25
- | 'Thursday'
26
- | 'Friday'
27
- | 'Saturday'
28
- | 'Sunday';
29
-
30
- const day = 'Monday' as Day;
31
- let result = 0;
32
-
33
- switch (day) {
34
- case 'Monday':
35
- result = 1;
36
- break;
37
- }
38
- ```
39
-
40
- ### ✅ Correct
41
-
42
- ```ts
43
- type Day =
44
- | 'Monday'
45
- | 'Tuesday'
46
- | 'Wednesday'
47
- | 'Thursday'
48
- | 'Friday'
49
- | 'Saturday'
50
- | 'Sunday';
51
-
52
- const day = 'Monday' as Day;
53
- let result = 0;
54
-
55
- switch (day) {
56
- case 'Monday':
57
- result = 1;
58
- break;
59
- case 'Tuesday':
60
- result = 2;
61
- break;
62
- case 'Wednesday':
63
- result = 3;
64
- break;
65
- case 'Thursday':
66
- result = 4;
67
- break;
68
- case 'Friday':
69
- result = 5;
70
- break;
71
- case 'Saturday':
72
- result = 6;
73
- break;
74
- case 'Sunday':
75
- result = 7;
76
- break;
77
- }
78
- ```
79
-
80
- ### ✅ Correct
81
-
82
- ```ts
83
- type Day =
84
- | 'Monday'
85
- | 'Tuesday'
86
- | 'Wednesday'
87
- | 'Thursday'
88
- | 'Friday'
89
- | 'Saturday'
90
- | 'Sunday';
91
-
92
- const day = 'Monday' as Day;
93
- let result = 0;
94
-
95
- switch (day) {
96
- case 'Monday':
97
- result = 1;
98
- break;
99
- default:
100
- result = 42;
101
- }
102
- ```
103
-
104
- ## When Not To Use It
105
-
106
- If you don't frequently `switch` over union types with many parts, or intentionally wish to leave out some parts.
@@ -1,61 +0,0 @@
1
- ---
2
- description: 'Disallow certain triple slash directives in favor of ES6-style import declarations.'
3
- ---
4
-
5
- > 🛑 This file is source code, not the primary documentation location! 🛑
6
- >
7
- > See **https://typescript-eslint.io/rules/triple-slash-reference** for documentation.
8
-
9
- TypeScript's `///` triple-slash references are a way to indicate that types from another module are available in a file.
10
- Use of triple-slash reference type directives is generally discouraged in favor of ECMAScript Module `import`s.
11
- This rule reports on the use of `/// <reference path="..." />`, `/// <reference types="..." />`, or `/// <reference lib="..." />` directives.
12
-
13
- ## Examples
14
-
15
- ## Options
16
-
17
- With `{ "path": "never", "types": "never", "lib": "never" }` options set, the following will all be **incorrect** usage:
18
-
19
- ```ts
20
- /// <reference path="foo" />
21
- /// <reference types="bar" />
22
- /// <reference lib="baz" />
23
- ```
24
-
25
- Examples of **incorrect** code for the `{ "types": "prefer-import" }` option. Note that these are only errors when **both** styles are used for the **same** module:
26
-
27
- ```ts
28
- /// <reference types="foo" />
29
- import * as foo from 'foo';
30
- ```
31
-
32
- ```ts
33
- /// <reference types="foo" />
34
- import foo = require('foo');
35
- ```
36
-
37
- With `{ "path": "always", "types": "always", "lib": "always" }` options set, the following will all be **correct** usage:
38
-
39
- ```ts
40
- /// <reference path="foo" />
41
- /// <reference types="bar" />
42
- /// <reference lib="baz" />
43
- ```
44
-
45
- Examples of **correct** code for the `{ "types": "prefer-import" }` option:
46
-
47
- ```ts
48
- import * as foo from 'foo';
49
- ```
50
-
51
- ```ts
52
- import foo = require('foo');
53
- ```
54
-
55
- ## When To Use It
56
-
57
- If you want to ban use of one or all of the triple slash reference directives, or any time you might use triple-slash type reference directives and ES6 import declarations in the same file.
58
-
59
- ## When Not To Use It
60
-
61
- If you want to use all flavors of triple slash reference directives.