From 192fe9c9970ce8ff02dec2ccc5b14a705a0847dd Mon Sep 17 00:00:00 2001 From: Eva1ent Date: Sun, 17 Dec 2023 22:14:43 +0800 Subject: [PATCH 1/2] build: sync deps --- .npmrc | 3 +- pnpm-lock.yaml | 139 +++---------------------------------------------- 2 files changed, 9 insertions(+), 133 deletions(-) diff --git a/.npmrc b/.npmrc index a83504a0f..69458a94f 100644 --- a/.npmrc +++ b/.npmrc @@ -1,3 +1,4 @@ -save-exact=true +registry=https://registry.npmjs.org auto-install-peers=true +save-exact=true shell-emulator=true diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c08cae328..8a489ba45 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1285,7 +1285,7 @@ packages: '@cspell/dict-lua': 4.0.3 '@cspell/dict-makefile': 1.0.0 '@cspell/dict-node': 4.0.3 - '@cspell/dict-npm': 5.0.13 + '@cspell/dict-npm': 5.0.14 '@cspell/dict-php': 4.0.4 '@cspell/dict-powershell': 5.0.3 '@cspell/dict-public-licenses': 2.0.5 @@ -1294,7 +1294,7 @@ packages: '@cspell/dict-ruby': 5.0.1 '@cspell/dict-rust': 4.0.1 '@cspell/dict-scala': 5.0.0 - '@cspell/dict-software-terms': 3.3.12 + '@cspell/dict-software-terms': 3.3.13 '@cspell/dict-sql': 2.1.2 '@cspell/dict-svelte': 1.0.2 '@cspell/dict-swift': 2.0.1 @@ -1467,8 +1467,8 @@ packages: resolution: {integrity: sha512-sFlUNI5kOogy49KtPg8SMQYirDGIAoKBO3+cDLIwD4MLdsWy1q0upc7pzGht3mrjuyMiPRUV14Bb0rkVLrxOhg==} dev: true - /@cspell/dict-npm@5.0.13: - resolution: {integrity: sha512-uPb3DlQA/FvlmzT5RjZoy7fy91mxMRZW1B+K3atVM5A/cmP1QlDaSW/iCtde5kHET1MOV7uxz+vy0Yha2OI5pQ==} + /@cspell/dict-npm@5.0.14: + resolution: {integrity: sha512-k0kC7/W2qG5YII+SW6s+JtvKrkZg651vizi5dv/5G2HmJaeLNgDqBVeeDk/uV+ntBorM66XG4BPMjSxoaIlC5w==} dev: true /@cspell/dict-php@4.0.4: @@ -1505,8 +1505,8 @@ packages: resolution: {integrity: sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ==} dev: true - /@cspell/dict-software-terms@3.3.12: - resolution: {integrity: sha512-6aa4T9VqOMc0SFNBt6gxp0CWjvRqMg/uxvgpRbil+ToHWcU+Q+As0WKhPLaOniuTdCM85WWzRouD0O1XUGqg5Q==} + /@cspell/dict-software-terms@3.3.13: + resolution: {integrity: sha512-+TeFLJnzsxJqovY4ZNbNivQ5KgIZex1f/w62WmfpKNl4yWaexVEdVp6vi38TR+uyYagkJASaBnjlbVW3aVTpFg==} dev: true /@cspell/dict-sql@2.1.2: @@ -2738,14 +2738,6 @@ packages: rollup: 4.9.1 dev: true - /@rollup/rollup-android-arm-eabi@4.9.0: - resolution: {integrity: sha512-+1ge/xmaJpm1KVBuIH38Z94zj9fBD+hp+/5WLaHgyY8XLq1ibxk/zj6dTXaqM2cAbYKq8jYlhHd6k05If1W5xA==} - cpu: [arm] - os: [android] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-android-arm-eabi@4.9.1: resolution: {integrity: sha512-6vMdBZqtq1dVQ4CWdhFwhKZL6E4L1dV6jUjuBvsavvNJSppzi6dLBbuV+3+IyUREaj9ZFvQefnQm28v4OCXlig==} cpu: [arm] @@ -2754,14 +2746,6 @@ packages: dev: true optional: true - /@rollup/rollup-android-arm64@4.9.0: - resolution: {integrity: sha512-im6hUEyQ7ZfoZdNvtwgEJvBWZYauC9KVKq1w58LG2Zfz6zMd8gRrbN+xCVoqA2hv/v6fm9lp5LFGJ3za8EQH3A==} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-android-arm64@4.9.1: resolution: {integrity: sha512-Jto9Fl3YQ9OLsTDWtLFPtaIMSL2kwGyGoVCmPC8Gxvym9TCZm4Sie+cVeblPO66YZsYH8MhBKDMGZ2NDxuk/XQ==} cpu: [arm64] @@ -2770,14 +2754,6 @@ packages: dev: true optional: true - /@rollup/rollup-darwin-arm64@4.9.0: - resolution: {integrity: sha512-u7aTMskN6Dmg1lCT0QJ+tINRt+ntUrvVkhbPfFz4bCwRZvjItx2nJtwJnJRlKMMaQCHRjrNqHRDYvE4mBm3DlQ==} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-darwin-arm64@4.9.1: resolution: {integrity: sha512-LtYcLNM+bhsaKAIGwVkh5IOWhaZhjTfNOkGzGqdHvhiCUVuJDalvDxEdSnhFzAn+g23wgsycmZk1vbnaibZwwA==} cpu: [arm64] @@ -2786,14 +2762,6 @@ packages: dev: true optional: true - /@rollup/rollup-darwin-x64@4.9.0: - resolution: {integrity: sha512-8FvEl3w2ExmpcOmX5RJD0yqXcVSOqAJJUJ29Lca29Ik+3zPS1yFimr2fr5JSZ4Z5gt8/d7WqycpgkX9nocijSw==} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-darwin-x64@4.9.1: resolution: {integrity: sha512-KyP/byeXu9V+etKO6Lw3E4tW4QdcnzDG/ake031mg42lob5tN+5qfr+lkcT/SGZaH2PdW4Z1NX9GHEkZ8xV7og==} cpu: [x64] @@ -2802,14 +2770,6 @@ packages: dev: true optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.9.0: - resolution: {integrity: sha512-lHoKYaRwd4gge+IpqJHCY+8Vc3hhdJfU6ukFnnrJasEBUvVlydP8PuwndbWfGkdgSvZhHfSEw6urrlBj0TSSfg==} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.9.1: resolution: {integrity: sha512-Yqz/Doumf3QTKplwGNrCHe/B2p9xqDghBZSlAY0/hU6ikuDVQuOUIpDP/YcmoT+447tsZTmirmjgG3znvSCR0Q==} cpu: [arm] @@ -2818,14 +2778,6 @@ packages: dev: true optional: true - /@rollup/rollup-linux-arm64-gnu@4.9.0: - resolution: {integrity: sha512-JbEPfhndYeWHfOSeh4DOFvNXrj7ls9S/2omijVsao+LBPTPayT1uKcK3dHW3MwDJ7KO11t9m2cVTqXnTKpeaiw==} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-linux-arm64-gnu@4.9.1: resolution: {integrity: sha512-u3XkZVvxcvlAOlQJ3UsD1rFvLWqu4Ef/Ggl40WAVCuogf4S1nJPHh5RTgqYFpCOvuGJ7H5yGHabjFKEZGExk5Q==} cpu: [arm64] @@ -2834,14 +2786,6 @@ packages: dev: true optional: true - /@rollup/rollup-linux-arm64-musl@4.9.0: - resolution: {integrity: sha512-ahqcSXLlcV2XUBM3/f/C6cRoh7NxYA/W7Yzuv4bDU1YscTFw7ay4LmD7l6OS8EMhTNvcrWGkEettL1Bhjf+B+w==} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-linux-arm64-musl@4.9.1: resolution: {integrity: sha512-0XSYN/rfWShW+i+qjZ0phc6vZ7UWI8XWNz4E/l+6edFt+FxoEghrJHjX1EY/kcUGCnZzYYRCl31SNdfOi450Aw==} cpu: [arm64] @@ -2850,14 +2794,6 @@ packages: dev: true optional: true - /@rollup/rollup-linux-riscv64-gnu@4.9.0: - resolution: {integrity: sha512-uwvOYNtLw8gVtrExKhdFsYHA/kotURUmZYlinH2VcQxNCQJeJXnkmWgw2hI9Xgzhgu7J9QvWiq9TtTVwWMDa+w==} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-linux-riscv64-gnu@4.9.1: resolution: {integrity: sha512-LmYIO65oZVfFt9t6cpYkbC4d5lKHLYv5B4CSHRpnANq0VZUQXGcCPXHzbCXCz4RQnx7jvlYB1ISVNCE/omz5cw==} cpu: [riscv64] @@ -2866,14 +2802,6 @@ packages: dev: true optional: true - /@rollup/rollup-linux-x64-gnu@4.9.0: - resolution: {integrity: sha512-m6pkSwcZZD2LCFHZX/zW2aLIISyzWLU3hrLLzQKMI12+OLEzgruTovAxY5sCZJkipklaZqPy/2bEEBNjp+Y7xg==} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-linux-x64-gnu@4.9.1: resolution: {integrity: sha512-kr8rEPQ6ns/Lmr/hiw8sEVj9aa07gh1/tQF2Y5HrNCCEPiCBGnBUt9tVusrcBBiJfIt1yNaXN6r1CCmpbFEDpg==} cpu: [x64] @@ -2882,14 +2810,6 @@ packages: dev: true optional: true - /@rollup/rollup-linux-x64-musl@4.9.0: - resolution: {integrity: sha512-VFAC1RDRSbU3iOF98X42KaVicAfKf0m0OvIu8dbnqhTe26Kh6Ym9JrDulz7Hbk7/9zGc41JkV02g+p3BivOdAg==} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-linux-x64-musl@4.9.1: resolution: {integrity: sha512-t4QSR7gN+OEZLG0MiCgPqMWZGwmeHhsM4AkegJ0Kiy6TnJ9vZ8dEIwHw1LcZKhbHxTY32hp9eVCMdR3/I8MGRw==} cpu: [x64] @@ -2898,14 +2818,6 @@ packages: dev: true optional: true - /@rollup/rollup-win32-arm64-msvc@4.9.0: - resolution: {integrity: sha512-9jPgMvTKXARz4inw6jezMLA2ihDBvgIU9Ml01hjdVpOcMKyxFBJrn83KVQINnbeqDv0+HdO1c09hgZ8N0s820Q==} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-win32-arm64-msvc@4.9.1: resolution: {integrity: sha512-7XI4ZCBN34cb+BH557FJPmh0kmNz2c25SCQeT9OiFWEgf8+dL6ZwJ8f9RnUIit+j01u07Yvrsuu1rZGxJCc51g==} cpu: [arm64] @@ -2914,14 +2826,6 @@ packages: dev: true optional: true - /@rollup/rollup-win32-ia32-msvc@4.9.0: - resolution: {integrity: sha512-WE4pT2kTXQN2bAv40Uog0AsV7/s9nT9HBWXAou8+++MBCnY51QS02KYtm6dQxxosKi1VIz/wZIrTQO5UP2EW+Q==} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-win32-ia32-msvc@4.9.1: resolution: {integrity: sha512-yE5c2j1lSWOH5jp+Q0qNL3Mdhr8WuqCNVjc6BxbVfS5cAS6zRmdiw7ktb8GNpDCEUJphILY6KACoFoRtKoqNQg==} cpu: [ia32] @@ -2930,14 +2834,6 @@ packages: dev: true optional: true - /@rollup/rollup-win32-x64-msvc@4.9.0: - resolution: {integrity: sha512-aPP5Q5AqNGuT0tnuEkK/g4mnt3ZhheiXrDIiSVIHN9mcN21OyXDVbEMqmXPE7e2OplNLDkcvV+ZoGJa2ZImFgw==} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@rollup/rollup-win32-x64-msvc@4.9.1: resolution: {integrity: sha512-PyJsSsafjmIhVgaI1Zdj7m8BB8mMckFah/xbpplObyHfiXzKcI5UOUXRyOdHW7nz4DpMCuzLnF7v5IWHenCwYA==} cpu: [x64] @@ -10745,27 +10641,6 @@ packages: fsevents: 2.3.3 dev: true - /rollup@4.9.0: - resolution: {integrity: sha512-bUHW/9N21z64gw8s6tP4c88P382Bq/L5uZDowHlHx6s/QWpjJXivIAbEw6LZthgSvlEizZBfLC4OAvWe7aoF7A==} - engines: {node: '>=18.0.0', npm: '>=8.0.0'} - hasBin: true - optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.9.0 - '@rollup/rollup-android-arm64': 4.9.0 - '@rollup/rollup-darwin-arm64': 4.9.0 - '@rollup/rollup-darwin-x64': 4.9.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.9.0 - '@rollup/rollup-linux-arm64-gnu': 4.9.0 - '@rollup/rollup-linux-arm64-musl': 4.9.0 - '@rollup/rollup-linux-riscv64-gnu': 4.9.0 - '@rollup/rollup-linux-x64-gnu': 4.9.0 - '@rollup/rollup-linux-x64-musl': 4.9.0 - '@rollup/rollup-win32-arm64-msvc': 4.9.0 - '@rollup/rollup-win32-ia32-msvc': 4.9.0 - '@rollup/rollup-win32-x64-msvc': 4.9.0 - fsevents: 2.3.3 - dev: true - /rollup@4.9.1: resolution: {integrity: sha512-pgPO9DWzLoW/vIhlSoDByCzcpX92bKEorbgXuZrqxByte3JFk2xSW2JEeAcyLc9Ru9pqcNNW+Ob7ntsk2oT/Xw==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -12389,7 +12264,7 @@ packages: '@types/node': 20.10.4 esbuild: 0.19.8 postcss: 8.4.32 - rollup: 4.9.0 + rollup: 4.9.1 optionalDependencies: fsevents: 2.3.3 dev: true From 3a6b1ede3fc49c33b9f321d4d0c9c357264ca301 Mon Sep 17 00:00:00 2001 From: Eva1ent Date: Mon, 18 Dec 2023 04:49:28 +0800 Subject: [PATCH 2/2] refactor: overall code optimization --- .eslintrc.cjs | 6 +- .github/CONTRIBUTING.md | 2 +- CHANGELOG.md | 8 +- examples/with-flat-config/package.json | 4 +- examples/with-legacy-config/package.json | 4 +- knip.ts | 6 - package.json | 32 +- packages/ast/docs/README.md | 251 +- packages/ast/package.json | 7 +- packages/ast/src/assignment/index.ts | 1 - .../is-unstable-assignment-pattern.ts | 34 - packages/ast/src/call/is.ts | 10 +- .../ast/src/eslint-community-eslint-utils.ts | 119 - packages/ast/src/function/hierarchy.ts | 14 +- packages/ast/src/index.ts | 2 - packages/ast/src/literal/is.ts | 4 +- packages/ast/tsconfig.json | 3 +- packages/core/docs/README.md | 381 +- .../core/docs/interfaces/ERAnalyzerNode.md | 65 + .../core/docs/interfaces/ERClassComponent.md | 41 + .../docs/interfaces/ERFunctionComponent.md | 34 + packages/core/package.json | 11 +- packages/core/src/api/api.ts | 34 + packages/core/src/api/children.ts | 21 - packages/core/src/api/index.ts | 2 +- .../src/component/component-Identifier.ts | 11 +- .../component/component-collector-legacy.ts | 12 +- .../core/src/component/component-collector.ts | 7 +- .../src/component/component-render-method.ts | 7 +- packages/core/src/component/component.ts | 10 +- .../src/construction/construction-detector.ts | 42 +- packages/core/src/context/index.ts | 1 - .../core/src/context/is-create-context.ts | 37 - packages/core/src/hook/hook-call.ts | 14 +- packages/core/src/hook/hook-collector.ts | 2 +- packages/core/src/index.ts | 2 +- packages/core/src/internal/analyzer-node.ts | 12 + packages/core/src/internal/index.ts | 4 +- ...> is-member-expression-of-react-member.ts} | 6 + packages/core/src/internal/is-react-api.ts | 17 + packages/core/src/render-prop/hierarchy.ts | 11 +- .../core/src/render-prop/is-render-prop.ts | 13 +- packages/core/src/utils/index.ts | 1 + packages/{utils/src => core/src/utils}/uid.ts | 0 packages/eslint-plugin-debug/package.json | 18 +- .../src/utils/create-rule.ts | 2 +- packages/eslint-plugin-jsx/package.json | 19 +- .../src/rules/no-array-index-key.ts | 7 +- .../no-complicated-conditional-rendering.ts | 5 +- .../src/rules/no-duplicate-key.ts | 9 +- .../rules/no-leaked-conditional-rendering.ts | 13 +- .../src/rules/no-missing-key.ts | 5 +- .../src/utils/create-rule.ts | 2 +- .../package.json | 19 +- .../src/rules/component-name.ts | 10 +- .../src/rules/filename-extension.ts | 6 +- .../src/rules/filename.ts | 14 +- .../src/rules/use-state.ts | 7 +- .../src/utils/create-rule.ts | 2 +- .../eslint-plugin-react-hooks/package.json | 18 +- .../ensure-use-callback-has-non-empty-deps.ts | 5 +- .../ensure-use-memo-has-non-empty-deps.ts | 5 +- .../src/utils/create-rule.ts | 2 +- packages/eslint-plugin-react/package.json | 18 +- .../src/rules/ensure-forward-ref-using-ref.ts | 4 +- .../src/rules/no-create-ref.ts | 5 +- ...dangerously-set-innerhtml-with-children.ts | 7 +- .../src/rules/no-dangerously-set-innerhtml.ts | 5 +- .../src/rules/no-find-dom-node.ts | 5 +- .../src/rules/no-missing-button-type.ts | 11 +- .../src/rules/no-missing-iframe-sandbox.ts | 11 +- .../src/rules/no-script-url.ts | 4 +- .../src/rules/no-string-refs.ts | 6 +- .../src/rules/no-unsafe-iframe-sandbox.ts | 11 +- .../src/rules/no-unsafe-target-blank.ts | 6 +- .../src/rules/no-unstable-default-props.ts | 4 +- .../rules/prefer-destructuring-assignment.ts | 5 +- .../src/utils/create-rule.ts | 2 +- packages/eslint-plugin/package.json | 11 +- packages/eslint-plugin/src/index.ts | 4 +- .../eslint-plugin/src/utils/transform-keys.ts | 4 +- packages/{utils => eslint-utils}/README.md | 2 +- .../{utils => eslint-utils}/docs/.nojekyll | 0 .../{utils => eslint-utils}/docs/README.md | 95 +- packages/{utils => eslint-utils}/package.json | 14 +- .../{utils => eslint-utils}/rollup.config.ts | 0 .../src/create-rule.ts | 0 packages/eslint-utils/src/index.ts | 2 + .../src/merge-configs.ts | 0 packages/eslint-utils/tsconfig.json | 7 + packages/eslint-utils/typedoc.json | 10 + packages/jsx/docs/README.md | 181 +- packages/jsx/package.json | 7 +- packages/jsx/src/element/api.ts | 34 + packages/jsx/src/element/hierarchy.ts | 23 +- packages/jsx/src/element/index.ts | 2 +- packages/jsx/src/element/is-element-call.ts | 17 - packages/jsx/src/pragma/get-pragma.ts | 4 +- packages/jsx/src/pragma/is-from-pragma.ts | 95 +- packages/jsx/src/prop/get-prop.ts | 17 +- packages/jsx/src/textnode.ts | 4 +- packages/jsx/src/value/is-jsx-value.ts | 13 +- packages/shared/package.json | 10 +- packages/shared/tsconfig.json | 3 +- packages/third-party/README.md | 10 + packages/third-party/docs/.nojekyll | 1 + packages/third-party/docs/README.md | 10 + .../modules/ESLintCommunityESLintUtils.md | 228 + .../modules/ESLintPluginFilenamesSimple.md | 26 + packages/third-party/package.json | 50 + packages/third-party/rollup.config.ts | 43 + .../eslint-community-eslint-utils/index.ts | 121 + .../case-validator/case-validator.ts | 0 .../case-validator/index.ts | 0 .../case-validator/preset-rules.ts | 0 .../case-validator/split-name.ts | 0 .../eslint-plugin-filenames-simple/index.ts | 5 + packages/third-party/src/index.ts | 2 + packages/{utils => third-party}/tsconfig.json | 3 +- packages/{utils => third-party}/typedoc.json | 2 +- .../eslint-community-eslint-utils.d.ts | 0 packages/tools/docs/README.md | 964 +--- .../{P.Predicate.md => .Predicate.md} | 4 +- ...eTypeLambda.md => .PredicateTypeLambda.md} | 16 +- .../{P.Refinement.md => .Refinement.md} | 4 +- .../tools/docs/interfaces/Chunk.Chunk-1.md | 1080 ---- .../docs/interfaces/Chunk.ChunkTypeLambda.md | 71 - .../docs/interfaces/Chunk.NonEmptyChunk.md | 1093 ---- packages/tools/docs/interfaces/Equal.Equal.md | 2 - .../docs/interfaces/M.Pattern.unstable_Fn.md | 24 - packages/tools/docs/modules/.md | 1948 +++++++ packages/tools/docs/modules/Array.md | 222 +- packages/tools/docs/modules/Chunk.Chunk.md | 104 - packages/tools/docs/modules/Chunk.md | 4860 ----------------- packages/tools/docs/modules/E.md | 36 +- packages/tools/docs/modules/Helper.Debug.md | 44 + packages/tools/docs/modules/Helper.Record.md | 226 + packages/tools/docs/modules/Helper.Union.md | 62 + packages/tools/docs/modules/Helper.md | 190 + packages/tools/docs/modules/List.md | 130 +- packages/tools/docs/modules/M.Pattern.md | 806 --- packages/tools/docs/modules/M.md | 150 - packages/tools/docs/modules/O.md | 68 +- packages/tools/docs/modules/P.md | 1948 ------- packages/tools/package.json | 3 +- packages/tools/src/array.ts | 20 - packages/tools/src/function.ts | 11 - packages/tools/src/guard.ts | 24 - packages/tools/src/helper.ts | 205 +- packages/tools/src/index.ts | 10 +- packages/tools/src/match.ts | 1 - packages/tools/src/narrow.ts | 32 - packages/tools/src/predicate.ts | 84 - packages/tools/src/record.ts | 82 - packages/tools/src/{effect.ts => std.ts} | 3 +- packages/tools/src/union.ts | 22 - packages/types/package.json | 5 +- packages/utils/docs/classes/CaseValidator.md | 88 - packages/utils/src/case-convert.ts | 12 - packages/utils/src/index.ts | 5 - pnpm-lock.yaml | 837 ++- scripts/build.ts | 3 +- taze.config.ts | 12 +- website/components/eslint-config.tsx | 4 +- website/components/image.tsx | 2 +- website/package.json | 8 +- website/theme.config.tsx | 6 +- 167 files changed, 5013 insertions(+), 13155 deletions(-) delete mode 100644 packages/ast/src/assignment/index.ts delete mode 100644 packages/ast/src/assignment/is-unstable-assignment-pattern.ts delete mode 100644 packages/ast/src/eslint-community-eslint-utils.ts create mode 100644 packages/core/docs/interfaces/ERAnalyzerNode.md create mode 100644 packages/core/src/api/api.ts delete mode 100644 packages/core/src/api/children.ts delete mode 100644 packages/core/src/context/index.ts delete mode 100644 packages/core/src/context/is-create-context.ts create mode 100644 packages/core/src/internal/analyzer-node.ts rename packages/core/src/internal/{api-detection.ts => is-member-expression-of-react-member.ts} (88%) create mode 100644 packages/core/src/internal/is-react-api.ts create mode 100644 packages/core/src/utils/index.ts rename packages/{utils/src => core/src/utils}/uid.ts (100%) rename packages/{utils => eslint-utils}/README.md (89%) rename packages/{utils => eslint-utils}/docs/.nojekyll (100%) rename packages/{utils => eslint-utils}/docs/README.md (53%) rename packages/{utils => eslint-utils}/package.json (78%) rename packages/{utils => eslint-utils}/rollup.config.ts (100%) rename packages/{utils => eslint-utils}/src/create-rule.ts (100%) create mode 100644 packages/eslint-utils/src/index.ts rename packages/{utils => eslint-utils}/src/merge-configs.ts (100%) create mode 100644 packages/eslint-utils/tsconfig.json create mode 100644 packages/eslint-utils/typedoc.json create mode 100644 packages/jsx/src/element/api.ts delete mode 100644 packages/jsx/src/element/is-element-call.ts create mode 100644 packages/third-party/README.md create mode 100644 packages/third-party/docs/.nojekyll create mode 100644 packages/third-party/docs/README.md create mode 100644 packages/third-party/docs/modules/ESLintCommunityESLintUtils.md create mode 100644 packages/third-party/docs/modules/ESLintPluginFilenamesSimple.md create mode 100644 packages/third-party/package.json create mode 100644 packages/third-party/rollup.config.ts create mode 100644 packages/third-party/src/eslint-community-eslint-utils/index.ts rename packages/{utils/src => third-party/src/eslint-plugin-filenames-simple}/case-validator/case-validator.ts (100%) rename packages/{utils/src => third-party/src/eslint-plugin-filenames-simple}/case-validator/index.ts (100%) rename packages/{utils/src => third-party/src/eslint-plugin-filenames-simple}/case-validator/preset-rules.ts (100%) rename packages/{utils/src => third-party/src/eslint-plugin-filenames-simple}/case-validator/split-name.ts (100%) create mode 100644 packages/third-party/src/eslint-plugin-filenames-simple/index.ts create mode 100644 packages/third-party/src/index.ts rename packages/{utils => third-party}/tsconfig.json (71%) rename packages/{utils => third-party}/typedoc.json (74%) rename packages/{ast => third-party}/typings/eslint-community-eslint-utils.d.ts (100%) rename packages/tools/docs/interfaces/{P.Predicate.md => .Predicate.md} (73%) rename packages/tools/docs/interfaces/{P.PredicateTypeLambda.md => .PredicateTypeLambda.md} (59%) rename packages/tools/docs/interfaces/{P.Refinement.md => .Refinement.md} (77%) delete mode 100644 packages/tools/docs/interfaces/Chunk.Chunk-1.md delete mode 100644 packages/tools/docs/interfaces/Chunk.ChunkTypeLambda.md delete mode 100644 packages/tools/docs/interfaces/Chunk.NonEmptyChunk.md delete mode 100644 packages/tools/docs/interfaces/M.Pattern.unstable_Fn.md create mode 100644 packages/tools/docs/modules/.md delete mode 100644 packages/tools/docs/modules/Chunk.Chunk.md delete mode 100644 packages/tools/docs/modules/Chunk.md create mode 100644 packages/tools/docs/modules/Helper.Debug.md create mode 100644 packages/tools/docs/modules/Helper.Record.md create mode 100644 packages/tools/docs/modules/Helper.Union.md create mode 100644 packages/tools/docs/modules/Helper.md delete mode 100644 packages/tools/docs/modules/M.Pattern.md delete mode 100644 packages/tools/docs/modules/M.md delete mode 100644 packages/tools/docs/modules/P.md delete mode 100644 packages/tools/src/array.ts delete mode 100644 packages/tools/src/function.ts delete mode 100644 packages/tools/src/guard.ts delete mode 100644 packages/tools/src/match.ts delete mode 100644 packages/tools/src/narrow.ts delete mode 100644 packages/tools/src/predicate.ts delete mode 100644 packages/tools/src/record.ts rename packages/tools/src/{effect.ts => std.ts} (86%) delete mode 100644 packages/tools/src/union.ts delete mode 100644 packages/utils/docs/classes/CaseValidator.md delete mode 100644 packages/utils/src/case-convert.ts delete mode 100644 packages/utils/src/index.ts diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 2c627d429..3fbfb3c58 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -58,11 +58,6 @@ module.exports = defineConfig({ varsIgnorePattern: "(^_)|(^ESLintUtils$)", }, ], - "@typescript-eslint/prefer-readonly": "warn", - "@typescript-eslint/prefer-nullish-coalescing": "warn", - "@typescript-eslint/strict-boolean-expressions": "error", - "@typescript-eslint/no-empty-interface": "off", - "@typescript-eslint/consistent-type-definitions": ["error", "interface"], "@susisu/safe-typescript/no-unsafe-object-property-check": "off", "import-access/jsdoc": ["error"], "jsdoc/require-jsdoc": "off", @@ -82,6 +77,7 @@ module.exports = defineConfig({ "perfectionist/sort-exports": "off", "perfectionist/sort-imports": "off", "perfectionist/sort-named-imports": "off", + "perfectionist/sort-named-exports": "off", "perfectionist/sort-object-types": "off", "perfectionist/sort-objects": [ "warn", diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e44ba7fe6..a19e42e06 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -59,7 +59,7 @@ ESLint React does not accept contributions of a purely utilitarian nature. - `@eslint-react/tools`: Std library and primitives. - `@eslint-react/types`: Type definitions. - `@eslint-react/shared`: Shared data and constants. -- `@eslint-react/utils`: Utilities for ESLint React. +- `@eslint-react/eslint-utils`: Utilities for ESLint React. - `@eslint-react/ast`: TSESTree AST primitive utility module. - `@eslint-react/jsx`: TSESTree AST utility module for static analysis of JSX. - `@eslint-react/core`: ESLint utility module for static analysis of React core API and Patterns. diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d6888a7b..dc39c9d2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,11 +87,11 @@ - `@eslint-react/shared` - ⚠️ Change `ESLintReactSettingsSchema`. - - Move utils from `@eslint-react/shared` to `@eslint-react/utils`. + - Move utils from `@eslint-react/shared` to `@eslint-react/eslint-utils`. - Remove `JSX_EXTENSIONS` from `@eslint-react/shared`. - `@eslint-react/monorepo` - - Add `@eslint-react/utils` package. + - Add `@eslint-react/eslint-utils` package. - Add `format:package-json` script. - Update `bun` to `1.0.17`. - Update `vitest` to `1.0.4`. @@ -145,10 +145,10 @@ #### 🏠 Internal - `@eslint-react/shared` - - Move utils from `@eslint-react/shared` to `@eslint-react/utils`. + - Move utils from `@eslint-react/shared` to `@eslint-react/eslint-utils`. - `@eslint-react/monorepo` - - Add `@eslint-react/utils` package. + - Add `@eslint-react/eslint-utils` package. #### Authors: 1 diff --git a/examples/with-flat-config/package.json b/examples/with-flat-config/package.json index d4256a87e..70b7d6ea4 100644 --- a/examples/with-flat-config/package.json +++ b/examples/with-flat-config/package.json @@ -19,8 +19,8 @@ "@tsconfig/strictest": "2.0.2", "@types/react": "18.2.45", "@types/react-dom": "18.2.17", - "@typescript-eslint/eslint-plugin": "6.14.0", - "@typescript-eslint/parser": ">=6.14.0", + "@typescript-eslint/eslint-plugin": "6.15.0", + "@typescript-eslint/parser": ">=6.15.0", "@vitejs/plugin-react": "4.2.1", "eslint": ">=8.56.0", "eslint-plugin-react-hooks": "4.6.0", diff --git a/examples/with-legacy-config/package.json b/examples/with-legacy-config/package.json index 207d2b0fb..a3eaf454b 100644 --- a/examples/with-legacy-config/package.json +++ b/examples/with-legacy-config/package.json @@ -18,8 +18,8 @@ "@tsconfig/strictest": "2.0.2", "@types/react": "18.2.45", "@types/react-dom": "18.2.17", - "@typescript-eslint/eslint-plugin": "6.14.0", - "@typescript-eslint/parser": ">=6.14.0", + "@typescript-eslint/eslint-plugin": "6.15.0", + "@typescript-eslint/parser": ">=6.15.0", "@vitejs/plugin-react": "4.2.1", "eslint": ">=8.56.0", "eslint-plugin-react-hooks": "4.6.0", diff --git a/knip.ts b/knip.ts index 7391e9572..f0560dfbb 100644 --- a/knip.ts +++ b/knip.ts @@ -8,12 +8,6 @@ export default { "eslint-plugin-jsdoc", "swc3", "@eslint-react/types", - "dedent", - "effect", - "rambda", - "string-ts", - "ts-pattern", - "tslib", ], ignoreWorkspaces: [ "examples/*", diff --git a/package.json b/package.json index ab66f4341..c3e0f8dfb 100644 --- a/package.json +++ b/package.json @@ -61,31 +61,31 @@ "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "15.2.3", "@rollup/plugin-typescript": "11.1.5", - "@swc/core": "1.3.100", + "@swc/core": "1.3.101", "@tsconfig/node20": "20.1.2", "@tsconfig/strictest": "2.0.2", - "@types/node": "20.10.4", - "@typescript-eslint/eslint-plugin": "6.14.0", - "@typescript-eslint/parser": ">=6.14.0", - "@typescript-eslint/rule-tester": "6.14.0", + "@types/node": "20.10.5", + "@typescript-eslint/eslint-plugin": "6.15.0", + "@typescript-eslint/parser": ">=6.15.0", + "@typescript-eslint/rule-tester": "6.15.0", "@vitest/ui": "1.0.4", "bun": "1.0.18", "bun-types": "1.0.18", "cspell": "8.1.3", "dedent": "1.5.1", - "dprint": "0.43.2", + "dprint": "0.44.0", "effect": "2.0.0-next.60", "eslint": ">=8.56.0", - "eslint-config-with-tsconfig": "2.9.170", + "eslint-config-with-tsconfig": "2.9.200", "eslint-plugin-eslint-plugin": "5.2.1", "eslint-plugin-filenames-simple": "0.9.0", "eslint-plugin-functional": "6.0.0", "eslint-plugin-jsdoc": "46.9.1", "eslint-plugin-total-functions": "7.1.0", - "eslint-plugin-vitest": "0.3.17", + "eslint-plugin-vitest": "0.3.18", "fast-equals": "5.0.1", "husky": "8.0.3", - "knip": "3.8.1", + "knip": "3.8.2", "markdownlint": "0.32.1", "pathe": "1.1.1", "publint": "0.2.6", @@ -108,7 +108,7 @@ "vitest": "1.0.4" }, "peerDependencies": { - "@typescript-eslint/parser": ">=6.14.0", + "@typescript-eslint/parser": ">=6.15.0", "eslint": ">=8.56.0", "typescript": ">=5.3.3" }, @@ -122,12 +122,12 @@ }, "pnpm": { "overrides": { - "@typescript-eslint/parser": ">=6.14.0", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/type-utils": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/utils": "6.14.0", - "@typescript-eslint/eslint-plugin": "6.14.0", + "@typescript-eslint/parser": ">=6.15.0", + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/type-utils": "6.15.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/utils": "6.15.0", + "@typescript-eslint/eslint-plugin": "6.15.0", "eslint": ">=8.56.0", "effect": "2.0.0-next.60", "next": "14.0.4", diff --git a/packages/ast/docs/README.md b/packages/ast/docs/README.md index 0f03c4bc6..7a479e9f5 100644 --- a/packages/ast/docs/README.md +++ b/packages/ast/docs/README.md @@ -26,19 +26,13 @@ - [findVariableByName](README.md#findvariablebyname) - [findVariableByNameUpToGlobal](README.md#findvariablebynameuptoglobal) - [getClassIdentifier](README.md#getclassidentifier) -- [getFunctionHeadLocation](README.md#getfunctionheadlocation) - [getFunctionIdentifier](README.md#getfunctionidentifier) -- [getFunctionNameWithKind](README.md#getfunctionnamewithkind) - [getNestedCallExpressions](README.md#getnestedcallexpressions) - [getNestedIdentifiers](README.md#getnestedidentifiers) - [getNestedReturnStatements](README.md#getnestedreturnstatements) -- [getPropertyName](README.md#getpropertyname) -- [getStaticValue](README.md#getstaticvalue) -- [getStringIfConstant](README.md#getstringifconstant) - [getVariableInit](README.md#getvariableinit) - [getVariableInitExpression](README.md#getvariableinitexpression) - [getVariablesUpToGlobal](README.md#getvariablesuptoglobal) -- [hasSideEffect](README.md#hassideeffect) - [is](README.md#is) - [isArrayTupleType](README.md#isarraytupletype) - [isClass](README.md#isclass) @@ -58,12 +52,10 @@ - [isMultiLine](README.md#ismultiline) - [isNodeEqual](README.md#isnodeequal) - [isOneOf](README.md#isoneof) -- [isParenthesized](README.md#isparenthesized) - [isProperty](README.md#isproperty) - [isRegExpLiteral](README.md#isregexpliteral) - [isStringLiteral](README.md#isstringliteral) - [isTypeDeclaration](README.md#istypedeclaration) -- [isUnstableAssignmentPattern](README.md#isunstableassignmentpattern) - [readableNodeType](README.md#readablenodetype-1) - [traverseUp](README.md#traverseup) - [traverseUpGuard](README.md#traverseupguard) @@ -209,29 +201,6 @@ class identifier or null --- -### getFunctionHeadLocation - -▸ **getFunctionHeadLocation**(`node`, `sourceCode`): `SourceLocation` - -Get the proper location of a given function node to report. - -#### Parameters - -| Name | Type | -| :----------- | :------------------------------------------------------------------------- | -| `node` | `ArrowFunctionExpression` \| `FunctionDeclaration` \| `FunctionExpression` | -| `sourceCode` | `SourceCode` | - -#### Returns - -`SourceLocation` - -**`See`** - -[https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionheadlocation](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionheadlocation) - ---- - ### getFunctionIdentifier ▸ **getFunctionIdentifier**(`node`): `O.Option`\<`TSESTree.Identifier`\> @@ -248,29 +217,6 @@ Get the proper location of a given function node to report. --- -### getFunctionNameWithKind - -▸ **getFunctionNameWithKind**(`node`, `sourceCode?`): `string` - -Get the name and kind of a given function node. - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------------------------- | -| `node` | `ArrowFunctionExpression` \| `FunctionDeclaration` \| `FunctionExpression` | -| `sourceCode?` | `SourceCode` | - -#### Returns - -`string` - -**`See`** - -[https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionnamewithkind](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionnamewithkind) - ---- - ### getNestedCallExpressions ▸ **getNestedCallExpressions**(`node`): `TSESTree.CallExpression`[] @@ -327,86 +273,6 @@ The nested return statements --- -### getPropertyName - -▸ **getPropertyName**(`node`, `initialScope?`): `null` \| `string` - -Get the property name of a given property node. -If the node is a computed property, this tries to compute the property name by the getStringIfConstant function. - -#### Parameters - -| Name | Type | -| :-------------- | :----------------------------------------------------------------------------- | -| `node` | `MemberExpression` \| `MethodDefinition` \| `Property` \| `PropertyDefinition` | -| `initialScope?` | `Scope` | - -#### Returns - -`null` \| `string` - -The property name of the node. If the property name is not constant then it returns `null`. - -**`See`** - -[https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getpropertyname](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getpropertyname) - ---- - -### getStaticValue - -▸ **getStaticValue**(`node`, `initialScope?`): `null` \| \{ `value`: `unknown` } - -Get the value of a given node if it can decide the value statically. -If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the -given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have -not been modified. -For example, it considers `Symbol.iterator`, `String.raw`hello``, and `Object.freeze({a: 1}).a` as static. - -#### Parameters - -| Name | Type | -| :-------------- | :------ | -| `node` | `Node` | -| `initialScope?` | `Scope` | - -#### Returns - -`null` \| \{ `value`: `unknown` } - -The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the -static value of the node, it returns `null`. - -**`See`** - -[https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue) - ---- - -### getStringIfConstant - -▸ **getStringIfConstant**(`node`, `initialScope?`): `null` \| `string` - -Get the string value of a given node. -This function is a tiny wrapper of the getStaticValue function. - -#### Parameters - -| Name | Type | -| :-------------- | :------ | -| `node` | `Node` | -| `initialScope?` | `Scope` | - -#### Returns - -`null` \| `string` - -**`See`** - -[https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstringifconstant](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstringifconstant) - ---- - ### getVariableInit ▸ **getVariableInit**(`at`): (`variable`: `Variable`) => `Option`\<`LetOrConstOrVarDeclaration` \| `Expression`\> @@ -485,51 +351,6 @@ Get all variables from the given scope up to the global scope --- -### hasSideEffect - -▸ **hasSideEffect**(`node`, `sourceCode`, `options?`): `boolean` - -Check whether a given node has any side effect or not. -The side effect means that it may modify a certain variable or object member. This function considers the node which -contains the following types as the node which has side effects: - -- `AssignmentExpression` -- `AwaitExpression` -- `CallExpression` -- `ImportExpression` -- `NewExpression` -- `UnaryExpression([operator = "delete"])` -- `UpdateExpression` -- `YieldExpression` -- When `options.considerGetters` is `true`: -- `MemberExpression` -- When `options.considerImplicitTypeConversion` is `true`: -- `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])` -- `MemberExpression([computed = true])` -- `MethodDefinition([computed = true])` -- `Property([computed = true])` -- `UnaryExpression([operator = "-" | "+" | "!" | "~"])` - -#### Parameters - -| Name | Type | -| :---------------------------------------- | :----------- | -| `node` | `Node` | -| `sourceCode` | `SourceCode` | -| `options?` | `Object` | -| `options.considerGetters?` | `boolean` | -| `options.considerImplicitTypeConversion?` | `boolean` | - -#### Returns - -`boolean` - -**`See`** - -[https://eslint-community.github.io/eslint-utils/api/ast-utils.html#hassideeffect](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#hassideeffect) - ---- - ### is ▸ **is**\<`NodeType`\>(`nodeType`): (`node`: `undefined` \| `null` \| `Node`) => node is Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ \| Extract\ @@ -706,7 +527,7 @@ node is ArrowFunctionExpression \| FunctionDeclarationWithName \| FunctionDeclar ### isJSX -▸ **isJSX**(`node`): node is JSXAttribute \| JSXClosingElement \| JSXClosingFragment \| JSXElement \| JSXEmptyExpression \| JSXExpressionContainer \| JSXFragment \| JSXIdentifier \| JSXMemberExpression \| JSXNamespacedName \| JSXOpeningElement \| JSXOpeningFragment \| JSXSpreadAttribute \| JSXSpreadChild \| JSXText +▸ **isJSX**(`node`): node is JSXAttribute \| JSXElement \| JSXExpressionContainer \| JSXSpreadChild \| JSXFragment \| JSXText \| JSXClosingElement \| JSXClosingFragment \| JSXEmptyExpression \| JSXIdentifier \| JSXMemberExpression \| JSXNamespacedName \| JSXOpeningElement \| JSXOpeningFragment \| JSXSpreadAttribute #### Parameters @@ -716,7 +537,7 @@ node is ArrowFunctionExpression \| FunctionDeclarationWithName \| FunctionDeclar #### Returns -node is JSXAttribute \| JSXClosingElement \| JSXClosingFragment \| JSXElement \| JSXEmptyExpression \| JSXExpressionContainer \| JSXFragment \| JSXIdentifier \| JSXMemberExpression \| JSXNamespacedName \| JSXOpeningElement \| JSXOpeningFragment \| JSXSpreadAttribute \| JSXSpreadChild \| JSXText +node is JSXAttribute \| JSXElement \| JSXExpressionContainer \| JSXSpreadChild \| JSXFragment \| JSXText \| JSXClosingElement \| JSXClosingFragment \| JSXEmptyExpression \| JSXIdentifier \| JSXMemberExpression \| JSXNamespacedName \| JSXOpeningElement \| JSXOpeningFragment \| JSXSpreadAttribute --- @@ -770,7 +591,7 @@ node is JSXIdentifier \| JSXMemberExpression \| JSXNamespacedName ### isLeftHandSideExpression -▸ **isLeftHandSideExpression**(`node`): node is ArrowFunctionExpression \| FunctionExpression \| MemberExpressionComputedName \| MemberExpressionNonComputedName \| ArrayExpression \| ArrayPattern \| CallExpression \| ClassExpression \| Identifier \| JSXElement \| JSXFragment \| BigIntLiteral \| BooleanLiteral \| NullLiteral \| NumberLiteral \| RegExpLiteral \| StringLiteral \| MetaProperty \| ObjectExpression \| ObjectPattern \| SequenceExpression \| Super \| TaggedTemplateExpression \| TemplateLiteral \| ThisExpression +▸ **isLeftHandSideExpression**(`node`): node is ArrowFunctionExpression \| FunctionExpression \| ClassExpression \| JSXElement \| JSXFragment \| ArrayPattern \| ObjectPattern \| ArrayExpression \| CallExpression \| Identifier \| BigIntLiteral \| BooleanLiteral \| NullLiteral \| NumberLiteral \| RegExpLiteral \| StringLiteral \| MemberExpressionComputedName \| MemberExpressionNonComputedName \| MetaProperty \| ObjectExpression \| SequenceExpression \| Super \| TaggedTemplateExpression \| TemplateLiteral \| ThisExpression #### Parameters @@ -780,13 +601,13 @@ node is JSXIdentifier \| JSXMemberExpression \| JSXNamespacedName #### Returns -node is ArrowFunctionExpression \| FunctionExpression \| MemberExpressionComputedName \| MemberExpressionNonComputedName \| ArrayExpression \| ArrayPattern \| CallExpression \| ClassExpression \| Identifier \| JSXElement \| JSXFragment \| BigIntLiteral \| BooleanLiteral \| NullLiteral \| NumberLiteral \| RegExpLiteral \| StringLiteral \| MetaProperty \| ObjectExpression \| ObjectPattern \| SequenceExpression \| Super \| TaggedTemplateExpression \| TemplateLiteral \| ThisExpression +node is ArrowFunctionExpression \| FunctionExpression \| ClassExpression \| JSXElement \| JSXFragment \| ArrayPattern \| ObjectPattern \| ArrayExpression \| CallExpression \| Identifier \| BigIntLiteral \| BooleanLiteral \| NullLiteral \| NumberLiteral \| RegExpLiteral \| StringLiteral \| MemberExpressionComputedName \| MemberExpressionNonComputedName \| MetaProperty \| ObjectExpression \| SequenceExpression \| Super \| TaggedTemplateExpression \| TemplateLiteral \| ThisExpression --- ### isLeftHandSideExpressionType -▸ **isLeftHandSideExpressionType**(`node`): node is ArrowFunctionExpression \| FunctionExpression \| MemberExpressionComputedName \| MemberExpressionNonComputedName \| ArrayExpression \| ArrayPattern \| CallExpression \| ClassExpression \| Identifier \| JSXElement \| JSXFragment \| BigIntLiteral \| BooleanLiteral \| NullLiteral \| NumberLiteral \| RegExpLiteral \| StringLiteral \| MetaProperty \| ObjectExpression \| ObjectPattern \| SequenceExpression \| Super \| TaggedTemplateExpression \| TemplateLiteral \| ThisExpression \| TSAsExpression \| TSNonNullExpression \| TSTypeAssertion +▸ **isLeftHandSideExpressionType**(`node`): node is ArrowFunctionExpression \| FunctionExpression \| ClassExpression \| JSXElement \| JSXFragment \| ArrayPattern \| ObjectPattern \| ArrayExpression \| CallExpression \| Identifier \| BigIntLiteral \| BooleanLiteral \| NullLiteral \| NumberLiteral \| RegExpLiteral \| StringLiteral \| MemberExpressionComputedName \| MemberExpressionNonComputedName \| MetaProperty \| ObjectExpression \| SequenceExpression \| Super \| TaggedTemplateExpression \| TemplateLiteral \| ThisExpression \| TSAsExpression \| TSNonNullExpression \| TSTypeAssertion #### Parameters @@ -796,7 +617,7 @@ node is ArrowFunctionExpression \| FunctionExpression \| MemberExpressionCompute #### Returns -node is ArrowFunctionExpression \| FunctionExpression \| MemberExpressionComputedName \| MemberExpressionNonComputedName \| ArrayExpression \| ArrayPattern \| CallExpression \| ClassExpression \| Identifier \| JSXElement \| JSXFragment \| BigIntLiteral \| BooleanLiteral \| NullLiteral \| NumberLiteral \| RegExpLiteral \| StringLiteral \| MetaProperty \| ObjectExpression \| ObjectPattern \| SequenceExpression \| Super \| TaggedTemplateExpression \| TemplateLiteral \| ThisExpression \| TSAsExpression \| TSNonNullExpression \| TSTypeAssertion +node is ArrowFunctionExpression \| FunctionExpression \| ClassExpression \| JSXElement \| JSXFragment \| ArrayPattern \| ObjectPattern \| ArrayExpression \| CallExpression \| Identifier \| BigIntLiteral \| BooleanLiteral \| NullLiteral \| NumberLiteral \| RegExpLiteral \| StringLiteral \| MemberExpressionComputedName \| MemberExpressionNonComputedName \| MetaProperty \| ObjectExpression \| SequenceExpression \| Super \| TaggedTemplateExpression \| TemplateLiteral \| ThisExpression \| TSAsExpression \| TSNonNullExpression \| TSTypeAssertion --- @@ -895,48 +716,6 @@ node is Extract\ \| Extract\ -{ - const { right } = node; - if (right.type === NodeType.Literal) { - return "regex" in right; - } - - return isOneOf(unstableAssignmentPatternTypes)(right); -} diff --git a/packages/ast/src/call/is.ts b/packages/ast/src/call/is.ts index 131aa1948..1ff92aeb9 100644 --- a/packages/ast/src/call/is.ts +++ b/packages/ast/src/call/is.ts @@ -1,5 +1,5 @@ -import { M } from "@eslint-react/tools"; import type { TSESTree } from "@typescript-eslint/types"; +import { isMatching } from "ts-pattern"; import { NodeType } from "../node"; @@ -11,7 +11,7 @@ export function unsafeIsToStringCall(node: TSESTree.Node): node is & { property: TSESTree.Identifier & { name: "toString" } }; } { - return M.isMatching({ + return isMatching({ type: NodeType.CallExpression, callee: { type: NodeType.MemberExpression, @@ -29,7 +29,7 @@ export function unsafeIsStringCall(node: TSESTree.Node): node is callee: TSESTree.Identifier & { name: "String" }; } { - return M.isMatching({ + return isMatching({ type: NodeType.CallExpression, callee: { type: NodeType.Identifier, @@ -44,7 +44,7 @@ export function unsafeIsStringCall(node: TSESTree.Node): node is * @returns `true` if node is directly inside `Array.from` call, `false` if not */ export function unsafeIsArrayFromCall(node: TSESTree.Node | null): node is TSESTree.CallExpression { - return M.isMatching({ + return isMatching({ type: NodeType.CallExpression, callee: { type: NodeType.MemberExpression, @@ -64,7 +64,7 @@ export function unsafeIsArrayFromCall(node: TSESTree.Node | null): node is TSEST * @returns `true` if node is directly inside `map` call, `false` if not */ export function unsafeIsMapCall(node: TSESTree.Node | null): node is TSESTree.CallExpression { - return M.isMatching({ + return isMatching({ callee: { type: NodeType.MemberExpression, property: { diff --git a/packages/ast/src/eslint-community-eslint-utils.ts b/packages/ast/src/eslint-community-eslint-utils.ts deleted file mode 100644 index 6ca8d48fb..000000000 --- a/packages/ast/src/eslint-community-eslint-utils.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* eslint-disable no-restricted-syntax */ -/* eslint-disable @susisu/safe-typescript/no-type-assertion */ -// Ported from https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/utils/src/ast-utils/eslint-utils/astUtilities.ts - -import * as eslintUtils from "@eslint-community/eslint-utils"; -import type { TSESTree } from "@typescript-eslint/types"; -import type { TSESLint } from "@typescript-eslint/utils"; - -/** - * Get the proper location of a given function node to report. - * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionheadlocation} - */ -export const getFunctionHeadLocation = eslintUtils.getFunctionHeadLocation as ( - node: - | TSESTree.ArrowFunctionExpression - | TSESTree.FunctionDeclaration - | TSESTree.FunctionExpression, - sourceCode: TSESLint.SourceCode, -) => TSESTree.SourceLocation; - -/** - * Get the name and kind of a given function node. - * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionnamewithkind} - */ -export const getFunctionNameWithKind = eslintUtils.getFunctionNameWithKind as ( - node: - | TSESTree.ArrowFunctionExpression - | TSESTree.FunctionDeclaration - | TSESTree.FunctionExpression, - sourceCode?: TSESLint.SourceCode, -) => string; - -/** - * Get the property name of a given property node. - * If the node is a computed property, this tries to compute the property name by the getStringIfConstant function. - * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getpropertyname} - * @returns The property name of the node. If the property name is not constant then it returns `null`. - */ -export const getPropertyName = eslintUtils.getPropertyName as ( - node: - | TSESTree.MemberExpression - | TSESTree.MethodDefinition - | TSESTree.Property - | TSESTree.PropertyDefinition, - initialScope?: TSESLint.Scope.Scope, -) => null | string; - -/** - * Get the value of a given node if it can decide the value statically. - * If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the - * given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have - * not been modified. - * For example, it considers `Symbol.iterator`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static. - * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue} - * @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the - * static value of the node, it returns `null`. - */ -export const getStaticValue = eslintUtils.getStaticValue as ( - node: TSESTree.Node, - initialScope?: TSESLint.Scope.Scope, -) => { value: unknown } | null; - -/** - * Get the string value of a given node. - * This function is a tiny wrapper of the getStaticValue function. - * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstringifconstant} - */ -export const getStringIfConstant = eslintUtils.getStringIfConstant as ( - node: TSESTree.Node, - initialScope?: TSESLint.Scope.Scope, -) => null | string; - -/** - * Check whether a given node has any side effect or not. - * The side effect means that it may modify a certain variable or object member. This function considers the node which - * contains the following types as the node which has side effects: - * - `AssignmentExpression` - * - `AwaitExpression` - * - `CallExpression` - * - `ImportExpression` - * - `NewExpression` - * - `UnaryExpression([operator = "delete"])` - * - `UpdateExpression` - * - `YieldExpression` - * - When `options.considerGetters` is `true`: - * - `MemberExpression` - * - When `options.considerImplicitTypeConversion` is `true`: - * - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])` - * - `MemberExpression([computed = true])` - * - `MethodDefinition([computed = true])` - * - `Property([computed = true])` - * - `UnaryExpression([operator = "-" | "+" | "!" | "~"])` - * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#hassideeffect} - */ -export const hasSideEffect = eslintUtils.hasSideEffect as ( - node: TSESTree.Node, - sourceCode: TSESLint.SourceCode, - options?: { - considerGetters?: boolean; - considerImplicitTypeConversion?: boolean; - }, -) => boolean; - -export const isParenthesized = eslintUtils.isParenthesized as { - /** - * Check whether a given node is parenthesized or not. - * This function detects it correctly even if it's parenthesized by specific syntax. - * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#isparenthesized} - * @returns `true` if the node is parenthesized. - * If `times` was given, it returns `true` only if the node is parenthesized the `times` times. - * For example, `isParenthesized(2, node, sourceCode)` returns true for `((foo))`, but not for `(foo)`. - */ - (node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean; - ( - times: number, - node: TSESTree.Node, - sourceCode: TSESLint.SourceCode, - ): boolean; -}; diff --git a/packages/ast/src/function/hierarchy.ts b/packages/ast/src/function/hierarchy.ts index 5d03d9a98..38df8b777 100644 --- a/packages/ast/src/function/hierarchy.ts +++ b/packages/ast/src/function/hierarchy.ts @@ -1,5 +1,5 @@ -import { M } from "@eslint-react/tools"; import type { TSESTree } from "@typescript-eslint/types"; +import { isMatching, P } from "ts-pattern"; import { NodeType } from "../node"; @@ -8,8 +8,8 @@ import { NodeType } from "../node"; * @param node The node to check. * @returns `true` if the node is a function expression or arrow function expression of a object method, `false` otherwise. */ -export const isFunctionOfObjectMethod: (node: TSESTree.Node) => boolean = M.isMatching({ - type: M.P.union([NodeType.FunctionExpression, NodeType.ArrowFunctionExpression]), +export const isFunctionOfObjectMethod: (node: TSESTree.Node) => boolean = isMatching({ + type: P.union([NodeType.FunctionExpression, NodeType.ArrowFunctionExpression]), parent: { type: NodeType.Property, parent: { @@ -23,8 +23,8 @@ export const isFunctionOfObjectMethod: (node: TSESTree.Node) => boolean = M.isMa * @param node The node to check. * @returns `true` if the node is a function expression or arrow function expression of a class method, `false` otherwise. */ -export const isFunctionOfClassMethod: (node: TSESTree.Node) => boolean = M.isMatching({ - type: M.P.union([NodeType.FunctionExpression, NodeType.ArrowFunctionExpression]), +export const isFunctionOfClassMethod: (node: TSESTree.Node) => boolean = isMatching({ + type: P.union([NodeType.FunctionExpression, NodeType.ArrowFunctionExpression]), parent: { type: NodeType.MethodDefinition, parent: { @@ -38,8 +38,8 @@ export const isFunctionOfClassMethod: (node: TSESTree.Node) => boolean = M.isMat * @param node The node to check. * @returns `true` if the node is a function expression or arrow function expression of a class property, `false` otherwise. */ -export const isFunctionOfClassProperty: (node: TSESTree.Node) => boolean = M.isMatching({ - type: M.P.union([NodeType.FunctionExpression, NodeType.ArrowFunctionExpression]), +export const isFunctionOfClassProperty: (node: TSESTree.Node) => boolean = isMatching({ + type: P.union([NodeType.FunctionExpression, NodeType.ArrowFunctionExpression]), parent: { type: NodeType.Property, parent: { diff --git a/packages/ast/src/index.ts b/packages/ast/src/index.ts index b65bbb391..90fb9a057 100644 --- a/packages/ast/src/index.ts +++ b/packages/ast/src/index.ts @@ -1,7 +1,5 @@ -export * from "./assignment"; export * from "./call"; export * from "./class"; -export * from "./eslint-community-eslint-utils"; export * from "./function"; export * from "./identifier"; export * from "./literal"; diff --git a/packages/ast/src/literal/is.ts b/packages/ast/src/literal/is.ts index f00409cb2..49e376107 100644 --- a/packages/ast/src/literal/is.ts +++ b/packages/ast/src/literal/is.ts @@ -1,4 +1,4 @@ -import { P } from "@eslint-react/tools"; +import { _ } from "@eslint-react/tools"; import type { TSESTree } from "@typescript-eslint/types"; import { NodeType } from "../node"; @@ -8,5 +8,5 @@ export function isRegExpLiteral(node: TSESTree.Node): node is TSESTree.RegExpLit } export function isStringLiteral(node: TSESTree.Node): node is TSESTree.StringLiteral { - return node.type === NodeType.Literal && P.isString(node.value); + return node.type === NodeType.Literal && _.isString(node.value); } diff --git a/packages/ast/tsconfig.json b/packages/ast/tsconfig.json index 5858a6fa3..a0b43515f 100644 --- a/packages/ast/tsconfig.json +++ b/packages/ast/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../tsconfig.base.json", "include": [ - "src", - "typings" + "src" ] } diff --git a/packages/core/docs/README.md b/packages/core/docs/README.md index 11a0dbf85..222bfbf42 100644 --- a/packages/core/docs/README.md +++ b/packages/core/docs/README.md @@ -6,6 +6,7 @@ ### Interfaces +- [ERAnalyzerNode](interfaces/ERAnalyzerNode.md) - [ERClassComponent](interfaces/ERClassComponent.md) - [ERFunctionComponent](interfaces/ERFunctionComponent.md) - [ERHook](interfaces/ERHook.md) @@ -29,6 +30,7 @@ - [ERFunctionComponentFlag](README.md#erfunctioncomponentflag-1) - [RE\_COMPONENT\_NAME](README.md#re_component_name) - [RE\_HOOK\_NAME](README.md#re_hook_name) +- [uid](README.md#uid) ### Functions @@ -43,21 +45,39 @@ - [hasNoneOrValidComponentName](README.md#hasnoneorvalidcomponentname) - [hookCollector](README.md#hookcollector) - [isChildrenCount](README.md#ischildrencount) +- [isChildrenCountCall](README.md#ischildrencountcall) - [isChildrenForEach](README.md#ischildrenforeach) +- [isChildrenForEachCall](README.md#ischildrenforeachcall) - [isChildrenMap](README.md#ischildrenmap) +- [isChildrenMapCall](README.md#ischildrenmapcall) - [isChildrenOnly](README.md#ischildrenonly) +- [isChildrenOnlyCall](README.md#ischildrenonlycall) - [isChildrenToArray](README.md#ischildrentoarray) +- [isChildrenToArrayCall](README.md#ischildrentoarraycall) - [isClassComponent](README.md#isclasscomponent) +- [isCloneElement](README.md#iscloneelement) +- [isCloneElementCall](README.md#iscloneelementcall) - [isCreateContext](README.md#iscreatecontext) +- [isCreateContextCall](README.md#iscreatecontextcall) +- [isCreateElement](README.md#iscreateelement) +- [isCreateElementCall](README.md#iscreateelementcall) +- [isCreateRef](README.md#iscreateref) +- [isCreateRefCall](README.md#iscreaterefcall) +- [isForwardRef](README.md#isforwardref) +- [isForwardRefCall](README.md#isforwardrefcall) - [isFunctionOfRenderMethod](README.md#isfunctionofrendermethod) - [isInsideReactHook](README.md#isinsidereacthook) - [isInsideRenderMethod](README.md#isinsiderendermethod) - [isMemberExpressionOfReactMember](README.md#ismemberexpressionofreactmember) -- [isMemoOrForwardRefCall](README.md#ismemoorforwardrefcall) +- [isMemo](README.md#ismemo) +- [isMemoCall](README.md#ismemocall) - [isPureComponent](README.md#ispurecomponent) +- [isReactAPI](README.md#isreactapi) +- [isReactAPICall](README.md#isreactapicall) - [isReactHook](README.md#isreacthook) - [isReactHookCall](README.md#isreacthookcall) - [isReactHookCallWithName](README.md#isreacthookcallwithname) +- [isUnstableAssignmentPattern](README.md#isunstableassignmentpattern) - [isUseCallbackCall](README.md#isusecallbackcall) - [isUseContextCall](README.md#isusecontextcall) - [isUseDebugValueCall](README.md#isusedebugvaluecall) @@ -220,6 +240,12 @@ hints for component collector • `Const` **RE\_HOOK\_NAME**: `RegExp` +--- + +### uid + +• `Const` **uid**: `default` + ## Functions ### componentCollector @@ -469,6 +495,24 @@ It will be removed in the future --- +### isChildrenCountCall + +▸ **isChildrenCountCall**(`node`, `context`, `pragma?`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `CallExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | +| `pragma?` | `string` | + +#### Returns + +`boolean` + +--- + ### isChildrenForEach ▸ **isChildrenForEach**(`node`, `context`, `pragma?`): `boolean` @@ -487,6 +531,24 @@ It will be removed in the future --- +### isChildrenForEachCall + +▸ **isChildrenForEachCall**(`node`, `context`, `pragma?`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `CallExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | +| `pragma?` | `string` | + +#### Returns + +`boolean` + +--- + ### isChildrenMap ▸ **isChildrenMap**(`node`, `context`, `pragma?`): `boolean` @@ -505,6 +567,24 @@ It will be removed in the future --- +### isChildrenMapCall + +▸ **isChildrenMapCall**(`node`, `context`, `pragma?`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `CallExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | +| `pragma?` | `string` | + +#### Returns + +`boolean` + +--- + ### isChildrenOnly ▸ **isChildrenOnly**(`node`, `context`, `pragma?`): `boolean` @@ -523,6 +603,24 @@ It will be removed in the future --- +### isChildrenOnlyCall + +▸ **isChildrenOnlyCall**(`node`, `context`, `pragma?`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `CallExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | +| `pragma?` | `string` | + +#### Returns + +`boolean` + +--- + ### isChildrenToArray ▸ **isChildrenToArray**(`node`, `context`, `pragma?`): `boolean` @@ -541,6 +639,24 @@ It will be removed in the future --- +### isChildrenToArrayCall + +▸ **isChildrenToArrayCall**(`node`, `context`, `pragma?`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `CallExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | +| `pragma?` | `string` | + +#### Returns + +`boolean` + +--- + ### isClassComponent ▸ **isClassComponent**(`node`, `context`): node is TSESTreeClass @@ -560,23 +676,173 @@ node is TSESTreeClass --- +### isCloneElement + +▸ **isCloneElement**(`node`, `context`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `Identifier` \| `MemberExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | + +#### Returns + +`boolean` + +--- + +### isCloneElementCall + +▸ **isCloneElementCall**(`node`, `context`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `CallExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | + +#### Returns + +`boolean` + +--- + ### isCreateContext -▸ **isCreateContext**(`node`): `boolean` +▸ **isCreateContext**(`node`, `context`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `Identifier` \| `MemberExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | + +#### Returns + +`boolean` + +--- + +### isCreateContextCall -Determines whether `createContext` is used +▸ **isCreateContextCall**(`node`, `context`): `boolean` #### Parameters -| Name | Type | Description | -| :----- | :----- | :-------------------- | -| `node` | `Node` | The AST node to check | +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `CallExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | + +#### Returns + +`boolean` + +--- + +### isCreateElement + +▸ **isCreateElement**(`node`, `context`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `Identifier` \| `MemberExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | + +#### Returns + +`boolean` + +--- + +### isCreateElementCall + +▸ **isCreateElementCall**(`node`, `context`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `CallExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | + +#### Returns + +`boolean` + +--- + +### isCreateRef + +▸ **isCreateRef**(`node`, `context`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `Identifier` \| `MemberExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | + +#### Returns + +`boolean` + +--- + +### isCreateRefCall + +▸ **isCreateRefCall**(`node`, `context`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `CallExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | #### Returns `boolean` -`true` if the node is a call expression to `createContext` +--- + +### isForwardRef + +▸ **isForwardRef**(`node`, `context`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `Identifier` \| `MemberExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | + +#### Returns + +`boolean` + +--- + +### isForwardRefCall + +▸ **isForwardRefCall**(`node`, `context`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `CallExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | + +#### Returns + +`boolean` --- @@ -666,6 +932,8 @@ It will be removed in the future `fn` +A function that checks if a given node is a member expression of a Pragma member. + ▸ (`node`, `context`, `pragma?`): `boolean` ##### Parameters @@ -682,15 +950,32 @@ It will be removed in the future --- -### isMemoOrForwardRefCall +### isMemo + +▸ **isMemo**(`node`, `context`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `Identifier` \| `MemberExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | + +#### Returns + +`boolean` + +--- + +### isMemoCall -▸ **isMemoOrForwardRefCall**(`node`, `context`): `boolean` +▸ **isMemoCall**(`node`, `context`): `boolean` #### Parameters | Name | Type | | :-------- | :------------------------------------------------------------ | -| `node` | `Node` | +| `node` | `CallExpression` | | `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | #### Returns @@ -718,6 +1003,64 @@ Check if a node is a React PureComponent --- +### isReactAPI + +▸ **isReactAPI**(`name`): `ReturnType`\ + +#### Parameters + +| Name | Type | +| :----- | :------- | +| `name` | `string` | + +#### Returns + +`ReturnType`\ + +▸ **isReactAPI**(`name`, `member`): `ReturnType`\ + +#### Parameters + +| Name | Type | +| :------- | :------- | +| `name` | `string` | +| `member` | `string` | + +#### Returns + +`ReturnType`\ + +--- + +### isReactAPICall + +▸ **isReactAPICall**(`name`): `ReturnType`\ + +#### Parameters + +| Name | Type | +| :----- | :------- | +| `name` | `string` | + +#### Returns + +`ReturnType`\ + +▸ **isReactAPICall**(`name`, `member`): `ReturnType`\ + +#### Parameters + +| Name | Type | +| :------- | :------- | +| `name` | `string` | +| `member` | `string` | + +#### Returns + +`ReturnType`\ + +--- + ### isReactHook ▸ **isReactHook**(`node`): `boolean` @@ -784,6 +1127,24 @@ Check if the given node is a React Hook call by its name and its hierarchy. --- +### isUnstableAssignmentPattern + +▸ **isUnstableAssignmentPattern**(`node`): node is AssignmentPattern & Object + +Check if the given node is an unstable assignment pattern (will change between assignments) + +#### Parameters + +| Name | Type | Description | +| :----- | :------------------ | :-------------------- | +| `node` | `AssignmentPattern` | The AST node to check | + +#### Returns + +node is AssignmentPattern & Object + +--- + ### isUseCallbackCall ▸ **isUseCallbackCall**(`node`, `context`, `pragma`): `boolean` diff --git a/packages/core/docs/interfaces/ERAnalyzerNode.md b/packages/core/docs/interfaces/ERAnalyzerNode.md new file mode 100644 index 000000000..9b7322604 --- /dev/null +++ b/packages/core/docs/interfaces/ERAnalyzerNode.md @@ -0,0 +1,65 @@ +[@eslint-react/core](../README.md) / ERAnalyzerNode + +# Interface: ERAnalyzerNode + +## Hierarchy + +- **`ERAnalyzerNode`** + + ↳ [`ERFunctionComponent`](ERFunctionComponent.md) + + ↳ [`ERClassComponent`](ERClassComponent.md) + +## Table of contents + +### Properties + +- [\_](ERAnalyzerNode.md#_) +- [flag](ERAnalyzerNode.md#flag) +- [hint](ERAnalyzerNode.md#hint) +- [id](ERAnalyzerNode.md#id) +- [kind](ERAnalyzerNode.md#kind) +- [name](ERAnalyzerNode.md#name) +- [node](ERAnalyzerNode.md#node) + +## Properties + +### \_ + +• **\_**: `string` + +--- + +### flag + +• **flag**: `bigint` + +--- + +### hint + +• **hint**: `bigint` + +--- + +### id + +• **id**: `Option`\<`Identifier` \| `Identifier`[]\> + +--- + +### kind + +• **kind**: `string` + +--- + +### name + +• **name**: `Option`\<`string`\> + +--- + +### node + +• **node**: `Node` diff --git a/packages/core/docs/interfaces/ERClassComponent.md b/packages/core/docs/interfaces/ERClassComponent.md index b7125ac22..77c398b5c 100644 --- a/packages/core/docs/interfaces/ERClassComponent.md +++ b/packages/core/docs/interfaces/ERClassComponent.md @@ -2,6 +2,12 @@ # Interface: ERClassComponent +## Hierarchy + +- [`ERAnalyzerNode`](ERAnalyzerNode.md) + + ↳ **`ERClassComponent`** + ## Table of contents ### Properties @@ -9,6 +15,7 @@ - [\_](ERClassComponent.md#_) - [displayName](ERClassComponent.md#displayname) - [flag](ERClassComponent.md#flag) +- [hint](ERClassComponent.md#hint) - [id](ERClassComponent.md#id) - [kind](ERClassComponent.md#kind) - [methods](ERClassComponent.md#methods) @@ -21,6 +28,10 @@ • **\_**: `string` +#### Inherited from + +[ERAnalyzerNode](ERAnalyzerNode.md).[_](ERAnalyzerNode.md#_) + --- ### displayName @@ -33,18 +44,40 @@ • **flag**: `bigint` +#### Overrides + +[ERAnalyzerNode](ERAnalyzerNode.md).[flag](ERAnalyzerNode.md#flag) + +--- + +### hint + +• **hint**: `bigint` + +#### Overrides + +[ERAnalyzerNode](ERAnalyzerNode.md).[hint](ERAnalyzerNode.md#hint) + --- ### id • **id**: `Option`\<`Identifier`\> +#### Overrides + +[ERAnalyzerNode](ERAnalyzerNode.md).[id](ERAnalyzerNode.md#id) + --- ### kind • **kind**: `"class"` +#### Overrides + +[ERAnalyzerNode](ERAnalyzerNode.md).[kind](ERAnalyzerNode.md#kind) + --- ### methods @@ -57,8 +90,16 @@ • **name**: `Option`\<`string`\> +#### Inherited from + +[ERAnalyzerNode](ERAnalyzerNode.md).[name](ERAnalyzerNode.md#name) + --- ### node • **node**: `TSESTreeClass` + +#### Overrides + +[ERAnalyzerNode](ERAnalyzerNode.md).[node](ERAnalyzerNode.md#node) diff --git a/packages/core/docs/interfaces/ERFunctionComponent.md b/packages/core/docs/interfaces/ERFunctionComponent.md index 505f86eff..58908c450 100644 --- a/packages/core/docs/interfaces/ERFunctionComponent.md +++ b/packages/core/docs/interfaces/ERFunctionComponent.md @@ -2,6 +2,12 @@ # Interface: ERFunctionComponent +## Hierarchy + +- [`ERAnalyzerNode`](ERAnalyzerNode.md) + + ↳ **`ERFunctionComponent`** + ## Table of contents ### Properties @@ -23,6 +29,10 @@ • **\_**: `string` +#### Inherited from + +[ERAnalyzerNode](ERAnalyzerNode.md).[_](ERAnalyzerNode.md#_) + --- ### displayName @@ -35,12 +45,20 @@ • **flag**: `bigint` +#### Overrides + +[ERAnalyzerNode](ERAnalyzerNode.md).[flag](ERAnalyzerNode.md#flag) + --- ### hint • **hint**: `bigint` +#### Overrides + +[ERAnalyzerNode](ERAnalyzerNode.md).[hint](ERAnalyzerNode.md#hint) + --- ### hookCalls @@ -53,6 +71,10 @@ • **id**: `Option`\<`Identifier` \| `Identifier`[]\> +#### Overrides + +[ERAnalyzerNode](ERAnalyzerNode.md).[id](ERAnalyzerNode.md#id) + --- ### initPath @@ -65,14 +87,26 @@ • **kind**: `"function"` +#### Overrides + +[ERAnalyzerNode](ERAnalyzerNode.md).[kind](ERAnalyzerNode.md#kind) + --- ### name • **name**: `Option`\<`string`\> +#### Inherited from + +[ERAnalyzerNode](ERAnalyzerNode.md).[name](ERAnalyzerNode.md#name) + --- ### node • **node**: `TSESTreeFunction` + +#### Overrides + +[ERAnalyzerNode](ERAnalyzerNode.md).[node](ERAnalyzerNode.md#node) diff --git a/packages/core/package.json b/packages/core/package.json index cd5e7975c..a6ac13ec9 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -43,14 +43,15 @@ }, "dependencies": { "@eslint-react/ast": "workspace:*", + "@eslint-react/eslint-utils": "workspace:*", "@eslint-react/jsx": "workspace:*", "@eslint-react/shared": "workspace:*", "@eslint-react/tools": "workspace:*", "@eslint-react/types": "workspace:*", - "@eslint-react/utils": "workspace:*", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/type-utils": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/utils": "6.14.0" + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/type-utils": "6.15.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/utils": "6.15.0", + "short-unique-id": "5.0.3" } } diff --git a/packages/core/src/api/api.ts b/packages/core/src/api/api.ts new file mode 100644 index 000000000..a4299a168 --- /dev/null +++ b/packages/core/src/api/api.ts @@ -0,0 +1,34 @@ +import type { RuleContext } from "@eslint-react/types"; +import type { TSESTree } from "@typescript-eslint/types"; + +import { isReactAPI, isReactAPICall } from "../internal"; + +// workaround for @typescript-eslint/utils's TS2742 error. +type A = (node: TSESTree.Identifier | TSESTree.MemberExpression, context: RuleContext) => boolean; +type B = (node: TSESTree.MemberExpression, context: RuleContext, pragma?: string) => boolean; +type X = (node: TSESTree.CallExpression, context: RuleContext) => boolean; +type Y = (node: TSESTree.CallExpression, context: RuleContext, pragma?: string) => boolean; + +export const isChildrenCount: B = isReactAPI("Children", "count"); +export const isChildrenForEach: B = isReactAPI("Children", "forEach"); +export const isChildrenMap: B = isReactAPI("Children", "map"); +export const isChildrenOnly: B = isReactAPI("Children", "only"); +export const isChildrenToArray: B = isReactAPI("Children", "toArray"); +export const isCloneElement: A = isReactAPI("cloneElement"); +export const isCreateContext: A = isReactAPI("createContext"); +export const isCreateElement: A = isReactAPI("createElement"); +export const isCreateRef: A = isReactAPI("createRef"); +export const isForwardRef: A = isReactAPI("forwardRef"); +export const isMemo: A = isReactAPI("memo"); + +export const isChildrenCountCall: Y = isReactAPICall("Children", "count"); +export const isChildrenForEachCall: Y = isReactAPICall("Children", "forEach"); +export const isChildrenMapCall: Y = isReactAPICall("Children", "map"); +export const isChildrenOnlyCall: Y = isReactAPICall("Children", "only"); +export const isChildrenToArrayCall: Y = isReactAPICall("Children", "toArray"); +export const isCloneElementCall: X = isReactAPICall("cloneElement"); +export const isCreateContextCall: X = isReactAPICall("createContext"); +export const isCreateElementCall: X = isReactAPICall("createElement"); +export const isCreateRefCall: X = isReactAPICall("createRef"); +export const isForwardRefCall: X = isReactAPICall("forwardRef"); +export const isMemoCall: X = isReactAPICall("memo"); diff --git a/packages/core/src/api/children.ts b/packages/core/src/api/children.ts deleted file mode 100644 index e3b4f6945..000000000 --- a/packages/core/src/api/children.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { RuleContext } from "@eslint-react/types"; -import type { TSESTree } from "@typescript-eslint/types"; - -import { isMemberExpressionOfReactMember } from "../internal"; - -// workaround for @typescript-eslint/utils's TS2742 error. -type ChildrenMethodPredicate = ( - node: TSESTree.MemberExpression, - context: RuleContext, - pragma?: string, -) => boolean; - -export const isChildrenCount: ChildrenMethodPredicate = isMemberExpressionOfReactMember("Children", "count"); - -export const isChildrenForEach: ChildrenMethodPredicate = isMemberExpressionOfReactMember("Children", "forEach"); - -export const isChildrenMap: ChildrenMethodPredicate = isMemberExpressionOfReactMember("Children", "map"); - -export const isChildrenOnly: ChildrenMethodPredicate = isMemberExpressionOfReactMember("Children", "only"); - -export const isChildrenToArray: ChildrenMethodPredicate = isMemberExpressionOfReactMember("Children", "toArray"); diff --git a/packages/core/src/api/index.ts b/packages/core/src/api/index.ts index 2c05fcf59..d158c5764 100644 --- a/packages/core/src/api/index.ts +++ b/packages/core/src/api/index.ts @@ -1 +1 @@ -export * from "./children"; +export * from "./api"; diff --git a/packages/core/src/component/component-Identifier.ts b/packages/core/src/component/component-Identifier.ts index 3c0af2916..8d8a5a8b0 100644 --- a/packages/core/src/component/component-Identifier.ts +++ b/packages/core/src/component/component-Identifier.ts @@ -1,13 +1,18 @@ /* eslint-disable filenames-simple/naming-convention */ import { isOneOf, NodeType, type TSESTreeFunction } from "@eslint-react/ast"; -import { isCallFromPragma } from "@eslint-react/jsx"; import { O } from "@eslint-react/tools"; import type { RuleContext } from "@eslint-react/types"; import type { TSESTree } from "@typescript-eslint/types"; +import { isForwardRefCall, isMemoCall } from "../api"; + function isMemoOrForwardRefCall(node: TSESTree.Node, context: RuleContext) { - return isCallFromPragma("memo")(node, context) - || isCallFromPragma("forwardRef")(node, context); + if (node.type !== NodeType.CallExpression) { + return false; + } + + return isMemoCall(node, context) + || isForwardRefCall(node, context); } export function getFunctionComponentIdentifier( diff --git a/packages/core/src/component/component-collector-legacy.ts b/packages/core/src/component/component-collector-legacy.ts index dd7c715fe..f624754f8 100644 --- a/packages/core/src/component/component-collector-legacy.ts +++ b/packages/core/src/component/component-collector-legacy.ts @@ -1,10 +1,11 @@ import { getClassIdentifier, NodeType, type TSESTreeClass } from "@eslint-react/ast"; import { getPragmaFromContext } from "@eslint-react/jsx"; -import { M, O } from "@eslint-react/tools"; +import { O } from "@eslint-react/tools"; import type { RuleContext } from "@eslint-react/types"; -import { uid } from "@eslint-react/utils"; import type { ESLintUtils, TSESTree } from "@typescript-eslint/utils"; +import { match, P } from "ts-pattern"; +import { uid } from "../utils"; import type { ERClassComponent } from "./component"; import { ERClassComponentFlag } from "./component-flag"; @@ -20,13 +21,13 @@ export function isClassComponent(node: TSESTree.Node, context: RuleContext): nod const pragma = getPragmaFromContext(context); const { superClass } = node; - return M.match(superClass) - .with({ type: NodeType.Identifier, name: M.P.string }, ({ name }) => /^(Pure)?Component$/u.test(name)) + return match(superClass) + .with({ type: NodeType.Identifier, name: P.string }, ({ name }) => /^(Pure)?Component$/u.test(name)) .with( { type: NodeType.MemberExpression, object: { name: pragma }, - property: { name: M.P.string }, + property: { name: P.string }, }, ({ property }) => /^(Pure)?Component$/u.test(property.name), ) @@ -85,6 +86,7 @@ export function componentCollectorLegacy(context: RuleContext) { // TODO: get displayName of class component displayName: O.none(), flag, + hint: 0n, // TODO: get methods of class component methods: [], node, diff --git a/packages/core/src/component/component-collector.ts b/packages/core/src/component/component-collector.ts index 278f7e964..b77d7d5aa 100644 --- a/packages/core/src/component/component-collector.ts +++ b/packages/core/src/component/component-collector.ts @@ -10,13 +10,14 @@ import { unsafeIsMapCall, } from "@eslint-react/ast"; import { getPragmaFromContext, isChildrenOfCreateElement, isJSXValue } from "@eslint-react/jsx"; -import { F, M, MutList, MutRef, O } from "@eslint-react/tools"; +import { F, MutList, MutRef, O } from "@eslint-react/tools"; import type { RuleContext } from "@eslint-react/types"; -import { uid } from "@eslint-react/utils"; import { type TSESTree } from "@typescript-eslint/types"; import type { ESLintUtils } from "@typescript-eslint/utils"; +import { match } from "ts-pattern"; import { unsafeIsReactHookCall } from "../hook"; +import { uid } from "../utils"; import type { ERFunctionComponent } from "./component"; import { DEFAULT_COMPONENT_COLLECTOR_HINT, ERComponentCollectorHint } from "./component-collector-hint"; import { ERFunctionComponentFlag } from "./component-flag"; @@ -214,7 +215,7 @@ export function componentCollector( return; } - const maybeComponentName = M.match(left.object) + const maybeComponentName = match(left.object) .with({ type: NodeType.Identifier }, n => O.some(n.name)) .otherwise(O.none); diff --git a/packages/core/src/component/component-render-method.ts b/packages/core/src/component/component-render-method.ts index 13429b69e..cef5a851e 100644 --- a/packages/core/src/component/component-render-method.ts +++ b/packages/core/src/component/component-render-method.ts @@ -1,16 +1,17 @@ import { NodeType, traverseUp, type TSESTreeFunction } from "@eslint-react/ast"; -import { M, O } from "@eslint-react/tools"; +import { O } from "@eslint-react/tools"; import type { RuleContext } from "@eslint-react/types"; import type { ESLintUtils, TSESTree } from "@typescript-eslint/utils"; +import { isMatching, P } from "ts-pattern"; import { isClassComponent } from "./component-collector-legacy"; -const isRenderMethodLike = M.isMatching({ +const isRenderMethodLike = isMatching({ key: { type: NodeType.Identifier, name: "render", }, - type: M.P.union(NodeType.MethodDefinition, NodeType.PropertyDefinition), + type: P.union(NodeType.MethodDefinition, NodeType.PropertyDefinition), parent: { type: NodeType.ClassBody, parent: { diff --git a/packages/core/src/component/component.ts b/packages/core/src/component/component.ts index 832395986..9979540fc 100644 --- a/packages/core/src/component/component.ts +++ b/packages/core/src/component/component.ts @@ -2,17 +2,16 @@ import type { TSESTreeClass, TSESTreeFunction } from "@eslint-react/ast"; import type { O } from "@eslint-react/tools"; import type { TSESTree } from "@typescript-eslint/types"; +import type { ERAnalyzerNode } from "../internal"; import type { ERComponentCollectorHint } from "./component-collector-hint"; import type { ERClassComponentFlag, ERFunctionComponentFlag } from "./component-flag"; import type { ERComponentInitPath } from "./component-init-path"; /* eslint-disable perfectionist/sort-interfaces */ -export interface ERFunctionComponent { - _: string; +export interface ERFunctionComponent extends ERAnalyzerNode { id: O.Option; kind: "function"; node: TSESTreeFunction; - name: O.Option; flag: ERFunctionComponentFlag; hint: ERComponentCollectorHint; initPath: O.Option; @@ -20,13 +19,12 @@ export interface ERFunctionComponent { displayName: O.Option; } -export interface ERClassComponent { - _: string; +export interface ERClassComponent extends ERAnalyzerNode { id: O.Option; kind: "class"; node: TSESTreeClass; - name: O.Option; flag: ERClassComponentFlag; + hint: ERComponentCollectorHint; methods: (TSESTree.MethodDefinition | TSESTree.PropertyDefinition)[]; displayName: O.Option; } diff --git a/packages/core/src/construction/construction-detector.ts b/packages/core/src/construction/construction-detector.ts index 3a7ca4996..493399f23 100644 --- a/packages/core/src/construction/construction-detector.ts +++ b/packages/core/src/construction/construction-detector.ts @@ -1,8 +1,40 @@ import { is, isOneOf, NodeType } from "@eslint-react/ast"; -import { Data, M, O, P } from "@eslint-react/tools"; +import type { Helper } from "@eslint-react/tools"; +import { _, Data, O } from "@eslint-react/tools"; import type { RuleContext } from "@eslint-react/types"; import { DefinitionType } from "@typescript-eslint/scope-manager"; import type { TSESTree } from "@typescript-eslint/types"; +import { match } from "ts-pattern"; + +const unstableAssignmentPatternTypes = [ + NodeType.JSXElement, + NodeType.ArrayExpression, + NodeType.ObjectExpression, + NodeType.FunctionExpression, + NodeType.ArrowFunctionExpression, + NodeType.ClassExpression, + NodeType.NewExpression, + NodeType.CallExpression, +] as const; + +/** + * Check if the given node is an unstable assignment pattern (will change between assignments) + * @param node The AST node to check + * @param node.right The right side of the assignment + */ +export function isUnstableAssignmentPattern(node: TSESTree.AssignmentPattern): node is + & TSESTree.AssignmentPattern + & Helper.Narrow<{ + right: TSESTree.RegExpLiteral | typeof unstableAssignmentPatternTypes[number]; + }> +{ + const { right } = node; + if (right.type === NodeType.Literal) { + return "regex" in right; + } + + return isOneOf(unstableAssignmentPatternTypes)(right); +} export type Construction = Data.TaggedEnum<{ None: {}; @@ -67,7 +99,7 @@ export function constructionDetector(context: T): (node: const detect = (node: TSESTree.Node): Construction => { const scope = context.sourceCode.getScope?.(node) ?? context.getScope(); - return M.match(node) + return match(node) .when(is(NodeType.ArrayExpression), (node) => Construction.Array({ node, usage: O.none() })) .when(is(NodeType.ObjectExpression), (node) => Construction.ObjectExpression({ node, usage: O.none() })) .when(is(NodeType.ClassExpression), (node) => Construction.ClassExpression({ node, usage: O.none() })) @@ -123,7 +155,7 @@ export function constructionDetector(context: T): (node: return detect(node.right); }) .when(is(NodeType.ConditionalExpression), (node) => { - if (!("consequent" in node && "alternate" in node && !P.isNullable(node.alternate))) { + if (!("consequent" in node && "alternate" in node && !_.isNullable(node.alternate))) { return None; } @@ -136,7 +168,7 @@ export function constructionDetector(context: T): (node: return detect(node.alternate); }) .when(is(NodeType.Identifier), (node) => { - if (!("name" in node && P.isString(node.name))) { + if (!("name" in node && _.isString(node.name))) { return None; } @@ -176,7 +208,7 @@ export function constructionDetector(context: T): (node: return None; }) .when(isOneOf([NodeType.TSAsExpression, NodeType.TSTypeAssertion]), () => { - if (!("expression" in node) || !P.isObject(node.expression)) { + if (!("expression" in node) || !_.isObject(node.expression)) { return None; } diff --git a/packages/core/src/context/index.ts b/packages/core/src/context/index.ts deleted file mode 100644 index 7e064dde4..000000000 --- a/packages/core/src/context/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./is-create-context"; diff --git a/packages/core/src/context/is-create-context.ts b/packages/core/src/context/is-create-context.ts deleted file mode 100644 index e2864fcdd..000000000 --- a/packages/core/src/context/is-create-context.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { NodeType } from "@eslint-react/ast"; -import { F, M, P } from "@eslint-react/tools"; -import type { TSESTree } from "@typescript-eslint/types"; - -/** - * Determines whether `createContext` is used - * @param node The AST node to check - * @returns `true` if the node is a call expression to `createContext` - */ -export function isCreateContext(node: TSESTree.Node) { - if ("init" in node) { - return M.match(node.init) - .with({ type: NodeType.CallExpression, callee: { name: "createContext" } }, F.constTrue) - .with( - { callee: { type: NodeType.MemberExpression, property: { name: "createContext" } } }, - F.constTrue, - ) - .otherwise(F.constFalse); - } - - if ( - "expression" in node - && P.isObject(node.expression) - && node.expression.type === NodeType.AssignmentExpression - && node.expression.operator === "=" - ) { - return M.match(node.expression.right) - .with({ type: NodeType.CallExpression, callee: { name: "createContext" } }, F.constTrue) - .with( - { callee: { type: NodeType.MemberExpression, property: { name: "createContext" } } }, - F.constTrue, - ) - .otherwise(F.constFalse); - } - - return false; -} diff --git a/packages/core/src/hook/hook-call.ts b/packages/core/src/hook/hook-call.ts index 743628a01..54172aec4 100644 --- a/packages/core/src/hook/hook-call.ts +++ b/packages/core/src/hook/hook-call.ts @@ -1,8 +1,9 @@ import { is, NodeType, traverseUp } from "@eslint-react/ast"; -import { isCallFromPragma, isInitializedFromPragma } from "@eslint-react/jsx"; -import { F, M, O } from "@eslint-react/tools"; +import { isInitializedFromPragma } from "@eslint-react/jsx"; +import { F, O } from "@eslint-react/tools"; import type { RuleContext } from "@eslint-react/types"; import type { TSESTree } from "@typescript-eslint/types"; +import { match } from "ts-pattern"; import { isValidReactHookName } from "./hook-name"; @@ -11,7 +12,7 @@ export function isReactHookCallWithName(name: string, alias?: string[]) { const initialScope = context.sourceCode.getScope?.(node) ?? context.getScope(); if (alias) { - const isAlias = M.match(node.callee) + const isAlias = match(node.callee) .with({ type: NodeType.Identifier, name }, n => alias.includes(n.name)) .with({ type: NodeType.MemberExpression, object: { name: pragma }, property: { name } }, F.constTrue) .otherwise(F.constFalse); @@ -21,7 +22,7 @@ export function isReactHookCallWithName(name: string, alias?: string[]) { } } - return M.match(node.callee) + return match(node.callee) .with({ type: NodeType.Identifier, name }, n => isInitializedFromPragma(n.name, context, initialScope, pragma)) .with({ type: NodeType.MemberExpression, object: { name: pragma }, property: { name } }, F.constTrue) .otherwise(F.constFalse); @@ -75,11 +76,6 @@ export function isReactHookCall(node: TSESTree.CallExpression) { throw new Error("Not implemented"); } -export function isMemoOrForwardRefCall(node: TSESTree.Node, context: RuleContext) { - return isCallFromPragma("memo")(node, context) - || isCallFromPragma("forwardRef")(node, context); -} - export function unsafeIsInsideReactHookCall(node: TSESTree.Node): boolean { return O.isSome(traverseUp(node, n => is(NodeType.CallExpression)(n) && unsafeIsReactHookCall(n))); } diff --git a/packages/core/src/hook/hook-collector.ts b/packages/core/src/hook/hook-collector.ts index 31ce40bc9..d8ea323ad 100644 --- a/packages/core/src/hook/hook-collector.ts +++ b/packages/core/src/hook/hook-collector.ts @@ -1,8 +1,8 @@ import { getFunctionIdentifier, type TSESTreeFunction } from "@eslint-react/ast"; import { O } from "@eslint-react/tools"; -import { uid } from "@eslint-react/utils"; import type { ESLintUtils, TSESTree } from "@typescript-eslint/utils"; +import { uid } from "../utils"; import type { ERHook } from "./hook"; import { unsafeIsReactHookCall } from "./hook-call"; import { isValidReactHookName } from "./hook-name"; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 036e1e425..1d572da5b 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,7 +1,7 @@ export * from "./api"; export * from "./component"; export * from "./construction"; -export * from "./context"; export * from "./hook"; export * from "./internal"; export * from "./render-prop"; +export * from "./utils"; diff --git a/packages/core/src/internal/analyzer-node.ts b/packages/core/src/internal/analyzer-node.ts new file mode 100644 index 000000000..5c43e0600 --- /dev/null +++ b/packages/core/src/internal/analyzer-node.ts @@ -0,0 +1,12 @@ +import type { O } from "@eslint-react/tools"; +import type { TSESTree } from "@typescript-eslint/types"; + +export interface ERAnalyzerNode { + _: string; + flag: bigint; + hint: bigint; + id: O.Option; + kind: string; + name: O.Option; + node: TSESTree.Node; +} diff --git a/packages/core/src/internal/index.ts b/packages/core/src/internal/index.ts index 5aba021de..9c323f575 100644 --- a/packages/core/src/internal/index.ts +++ b/packages/core/src/internal/index.ts @@ -1 +1,3 @@ -export * from "./api-detection"; +export * from "./analyzer-node"; +export * from "./is-member-expression-of-react-member"; +export * from "./is-react-api"; diff --git a/packages/core/src/internal/api-detection.ts b/packages/core/src/internal/is-member-expression-of-react-member.ts similarity index 88% rename from packages/core/src/internal/api-detection.ts rename to packages/core/src/internal/is-member-expression-of-react-member.ts index 53c89a391..1e69cb02b 100644 --- a/packages/core/src/internal/api-detection.ts +++ b/packages/core/src/internal/is-member-expression-of-react-member.ts @@ -3,6 +3,12 @@ import { getPragmaFromContext, isInitializedFromPragma } from "@eslint-react/jsx import type { RuleContext } from "@eslint-react/types"; import type { TSESTree } from "@typescript-eslint/types"; +/** + * @internal + * @param pragmaMemberName + * @param memberName + * @returns A function that checks if a given node is a member expression of a Pragma member. + */ export function isMemberExpressionOfReactMember( pragmaMemberName: string, memberName: string, diff --git a/packages/core/src/internal/is-react-api.ts b/packages/core/src/internal/is-react-api.ts new file mode 100644 index 000000000..c9eaad2f9 --- /dev/null +++ b/packages/core/src/internal/is-react-api.ts @@ -0,0 +1,17 @@ +import { isCallFromPragma, isCallFromPragmaMember, isFromPragma, isFromPragmaMember } from "@eslint-react/jsx"; + +export function isReactAPI(name: string): ReturnType; +export function isReactAPI(name: string, member: string): ReturnType; +export function isReactAPI(name: string, member?: string) { + return member + ? isFromPragmaMember(name, member) + : isFromPragma(name); +} + +export function isReactAPICall(name: string): ReturnType; +export function isReactAPICall(name: string, member: string): ReturnType; +export function isReactAPICall(name: string, member?: string) { + return member + ? isCallFromPragmaMember(name, member) + : isCallFromPragma(name); +} diff --git a/packages/core/src/render-prop/hierarchy.ts b/packages/core/src/render-prop/hierarchy.ts index cece86a34..503b0cb6d 100644 --- a/packages/core/src/render-prop/hierarchy.ts +++ b/packages/core/src/render-prop/hierarchy.ts @@ -1,6 +1,7 @@ import { is, NodeType, traverseUpGuard } from "@eslint-react/ast"; -import { F, M, O } from "@eslint-react/tools"; +import { F, O } from "@eslint-react/tools"; import type { TSESTree } from "@typescript-eslint/types"; +import { isMatching, P } from "ts-pattern"; /** * Unsafe check whether given node is declared directly inside a render property @@ -14,10 +15,10 @@ import type { TSESTree } from "@typescript-eslint/types"; * @returns `true` if component is declared inside a render property, `false` if not */ export function unsafeIsDirectValueOfRenderProperty(node: TSESTree.Node) { - const matching = M.isMatching({ + const matching = isMatching({ key: { type: NodeType.Identifier, - name: M.P.string.startsWith("render"), + name: P.string.startsWith("render"), }, type: NodeType.Property, }); @@ -46,9 +47,9 @@ export function unsafeIsDeclaredInRenderProp(node: TSESTree.Node) { O.flatMapNullable(c => c.parent), O.filter(is(NodeType.JSXAttribute)), O.flatMapNullable(a => a.name), - O.exists(M.isMatching({ + O.exists(isMatching({ type: NodeType.JSXIdentifier, - name: M.P.string.startsWith("render"), + name: P.string.startsWith("render"), })), ); } diff --git a/packages/core/src/render-prop/is-render-prop.ts b/packages/core/src/render-prop/is-render-prop.ts index b7ad27a02..387c60fad 100644 --- a/packages/core/src/render-prop/is-render-prop.ts +++ b/packages/core/src/render-prop/is-render-prop.ts @@ -1,8 +1,9 @@ import { getFunctionIdentifier, isFunction, NodeType, type TSESTreeFunction } from "@eslint-react/ast"; import { isJSXValue, JSXValueCheckHint } from "@eslint-react/jsx"; -import { M, O } from "@eslint-react/tools"; +import { O } from "@eslint-react/tools"; import type { RuleContext } from "@eslint-react/types"; import type { TSESTree } from "@typescript-eslint/types"; +import { isMatching, P } from "ts-pattern"; /** * Unsafe check whether given node is a render function @@ -22,13 +23,13 @@ export function unsafeIsRenderFunction(node: TSESTreeFunction, context: RuleCont const maybeId = getFunctionIdentifier(node); if (O.isSome(maybeId) && !maybeId.value.name.startsWith("render")) { - return M.isMatching({ + return isMatching({ type: NodeType.JSXExpressionContainer, parent: { type: NodeType.JSXAttribute, name: { type: NodeType.JSXIdentifier, - name: M.P.string.startsWith("render"), + name: P.string.startsWith("render"), }, }, }, parent); @@ -55,15 +56,15 @@ export function unsafeIsRenderFunction(node: TSESTreeFunction, context: RuleCont * @returns `true` if node is a render prop, `false` if not */ export function unsafeIsRenderProp(node: TSESTree.JSXAttribute, context: RuleContext) { - return M.isMatching({ + return isMatching({ type: NodeType.JSXAttribute, name: { type: NodeType.JSXIdentifier, - name: M.P.string.startsWith("render"), + name: P.string.startsWith("render"), }, value: { type: NodeType.JSXExpressionContainer, - expression: M.P.when(isFunction), + expression: P.when(isFunction), }, }, node) && unsafeIsRenderFunction(node.value.expression, context); } diff --git a/packages/core/src/utils/index.ts b/packages/core/src/utils/index.ts new file mode 100644 index 000000000..140f3762d --- /dev/null +++ b/packages/core/src/utils/index.ts @@ -0,0 +1 @@ +export * from "./uid"; diff --git a/packages/utils/src/uid.ts b/packages/core/src/utils/uid.ts similarity index 100% rename from packages/utils/src/uid.ts rename to packages/core/src/utils/uid.ts diff --git a/packages/eslint-plugin-debug/package.json b/packages/eslint-plugin-debug/package.json index 83a9b9513..9529ef898 100644 --- a/packages/eslint-plugin-debug/package.json +++ b/packages/eslint-plugin-debug/package.json @@ -43,25 +43,21 @@ "dependencies": { "@eslint-react/ast": "workspace:*", "@eslint-react/core": "workspace:*", + "@eslint-react/eslint-utils": "workspace:*", "@eslint-react/jsx": "workspace:*", "@eslint-react/shared": "workspace:*", "@eslint-react/tools": "workspace:*", "@eslint-react/types": "workspace:*", - "@eslint-react/utils": "workspace:*", - "@typescript-eslint/parser": ">=6.14.0", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/type-utils": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/utils": "6.14.0", - "dedent": "1.5.1", - "effect": "2.0.0-next.60", - "rambda": "8.6.0", + "@typescript-eslint/parser": ">=6.15.0", + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/type-utils": "6.15.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/utils": "6.15.0", "string-ts": "1.3.3", - "ts-api-utils": "1.0.3", "typescript": ">=5.3.3" }, "peerDependencies": { - "@typescript-eslint/parser": ">=6.14.0", + "@typescript-eslint/parser": ">=6.15.0", "eslint": ">=8.56.0", "typescript": ">=5.3.3" }, diff --git a/packages/eslint-plugin-debug/src/utils/create-rule.ts b/packages/eslint-plugin-debug/src/utils/create-rule.ts index 3e1c85560..03917eaf3 100644 --- a/packages/eslint-plugin-debug/src/utils/create-rule.ts +++ b/packages/eslint-plugin-debug/src/utils/create-rule.ts @@ -1,4 +1,4 @@ -import { createRuleForPlugin } from "@eslint-react/utils"; +import { createRuleForPlugin } from "@eslint-react/eslint-utils"; import { ESLintUtils } from "@typescript-eslint/utils"; export const createRule = createRuleForPlugin("debug"); diff --git a/packages/eslint-plugin-jsx/package.json b/packages/eslint-plugin-jsx/package.json index 45e4e6645..95764d05d 100644 --- a/packages/eslint-plugin-jsx/package.json +++ b/packages/eslint-plugin-jsx/package.json @@ -43,26 +43,23 @@ "dependencies": { "@eslint-react/ast": "workspace:*", "@eslint-react/core": "workspace:*", + "@eslint-react/eslint-utils": "workspace:*", "@eslint-react/jsx": "workspace:*", "@eslint-react/shared": "workspace:*", "@eslint-react/tools": "workspace:*", "@eslint-react/types": "workspace:*", - "@eslint-react/utils": "workspace:*", - "@typescript-eslint/parser": ">=6.14.0", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/type-utils": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/utils": "6.14.0", - "dedent": "1.5.1", - "effect": "2.0.0-next.60", - "rambda": "8.6.0", - "string-ts": "1.3.3", + "@typescript-eslint/parser": ">=6.15.0", + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/type-utils": "6.15.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/utils": "6.15.0", "ts-api-utils": "1.0.3", "typescript": ">=5.3.3" }, "peerDependencies": { - "@typescript-eslint/parser": ">=6.14.0", + "@typescript-eslint/parser": ">=6.15.0", "eslint": ">=8.56.0", + "string-ts": "1.3.3", "typescript": ">=5.3.3" }, "engines": { diff --git a/packages/eslint-plugin-jsx/src/rules/no-array-index-key.ts b/packages/eslint-plugin-jsx/src/rules/no-array-index-key.ts index 2dcfa3116..f825026ec 100644 --- a/packages/eslint-plugin-jsx/src/rules/no-array-index-key.ts +++ b/packages/eslint-plugin-jsx/src/rules/no-array-index-key.ts @@ -1,10 +1,11 @@ import { isOneOf, NodeType, unsafeIsStringCall, unsafeIsToStringCall } from "@eslint-react/ast"; import { getPragmaFromContext, isCloneElementCall, isCreateElementCall } from "@eslint-react/jsx"; -import { M, O, Record } from "@eslint-react/tools"; +import { O, Record } from "@eslint-react/tools"; import type { RuleContext } from "@eslint-react/types"; import type { ESLintUtils, TSESTree } from "@typescript-eslint/utils"; import type { ReportDescriptor } from "@typescript-eslint/utils/ts-eslint"; import type { ConstantCase } from "string-ts"; +import { isMatching } from "ts-pattern"; import { createRule } from "../utils"; @@ -47,7 +48,7 @@ function isUsingReactChildren(node: TSESTree.CallExpression, context: RuleContex } const pragma = getPragmaFromContext(context); - return M.isMatching({ object: { name: pragma } }, obj); + return isMatching({ object: { name: pragma } }, obj); } function getMapIndexParamName(node: TSESTree.CallExpression, context: RuleContext) { @@ -189,7 +190,7 @@ export default createRule<[], MessageID>({ } for (const prop of props.properties) { - if (!M.isMatching({ key: { name: "key" } }, prop)) { + if (!isMatching({ key: { name: "key" } }, prop)) { continue; } diff --git a/packages/eslint-plugin-jsx/src/rules/no-complicated-conditional-rendering.ts b/packages/eslint-plugin-jsx/src/rules/no-complicated-conditional-rendering.ts index 21dc98a60..23fff30ed 100644 --- a/packages/eslint-plugin-jsx/src/rules/no-complicated-conditional-rendering.ts +++ b/packages/eslint-plugin-jsx/src/rules/no-complicated-conditional-rendering.ts @@ -1,8 +1,9 @@ import { isOneOf, NodeType } from "@eslint-react/ast"; -import { F, M } from "@eslint-react/tools"; +import { F } from "@eslint-react/tools"; import { type TSESTree } from "@typescript-eslint/types"; import { ESLintUtils } from "@typescript-eslint/utils"; import type { ConstantCase } from "string-ts"; +import { match } from "ts-pattern"; import { createRule } from "../utils"; @@ -29,7 +30,7 @@ export default createRule<[], MessageID>({ const isConditionalOrLogicalExp = isOneOf([NodeType.ConditionalExpression, NodeType.LogicalExpression]); function isComplicatedExpression(node: TSESTree.Expression): boolean { - return M.match(node) + return match(node) .with({ type: NodeType.LogicalExpression }, ({ left, right }) => { return isConditionalOrLogicalExp(left) || isConditionalOrLogicalExp(right); }) diff --git a/packages/eslint-plugin-jsx/src/rules/no-duplicate-key.ts b/packages/eslint-plugin-jsx/src/rules/no-duplicate-key.ts index a77d1ad0c..21e720e71 100644 --- a/packages/eslint-plugin-jsx/src/rules/no-duplicate-key.ts +++ b/packages/eslint-plugin-jsx/src/rules/no-duplicate-key.ts @@ -8,11 +8,12 @@ import { unsafeIsMapCall, } from "@eslint-react/ast"; import { findPropInAttributes, getPragmaFromContext } from "@eslint-react/jsx"; -import { F, M, MutRef, O } from "@eslint-react/tools"; +import { F, MutRef, O } from "@eslint-react/tools"; import type { TSESTree } from "@typescript-eslint/types"; import type { ESLintUtils } from "@typescript-eslint/utils"; import type { ReportDescriptor } from "@typescript-eslint/utils/ts-eslint"; import type { ConstantCase } from "string-ts"; +import { isMatching, match } from "ts-pattern"; import { createRule, getChildrenToArraySelector } from "../utils"; @@ -65,7 +66,7 @@ export default createRule<[], MessageID>({ } function checkExpression(node: TSESTree.Expression): O.Option> { - return M.match(node) + return match(node) .with({ type: NodeType.JSXElement }, checkIteratorElement) .with({ type: NodeType.JSXFragment }, checkIteratorElement) .with({ type: NodeType.ConditionalExpression }, (n) => { @@ -115,7 +116,7 @@ export default createRule<[], MessageID>({ return; } - const elements = M.match(node) + const elements = match(node) .with({ type: NodeType.ArrayExpression }, ({ elements }) => elements) .with({ type: NodeType.JSXElement }, ({ parent }) => "children" in parent ? parent.children : []) .otherwise(() => []) @@ -129,7 +130,7 @@ export default createRule<[], MessageID>({ ][]>( (acc, element) => { const attr = element.openingElement.attributes - .findLast(M.isMatching({ + .findLast(isMatching({ type: NodeType.JSXAttribute, name: { name: "key", diff --git a/packages/eslint-plugin-jsx/src/rules/no-leaked-conditional-rendering.ts b/packages/eslint-plugin-jsx/src/rules/no-leaked-conditional-rendering.ts index 14d783110..354b4d9e2 100644 --- a/packages/eslint-plugin-jsx/src/rules/no-leaked-conditional-rendering.ts +++ b/packages/eslint-plugin-jsx/src/rules/no-leaked-conditional-rendering.ts @@ -1,11 +1,12 @@ import { findVariableByNameUpToGlobal, getVariableInitExpression, isJSX, NodeType } from "@eslint-react/ast"; -import { F, M, O } from "@eslint-react/tools"; +import { F, O } from "@eslint-react/tools"; import { getConstrainedTypeAtLocation } from "@typescript-eslint/type-utils"; import { type TSESTree } from "@typescript-eslint/types"; import { ESLintUtils } from "@typescript-eslint/utils"; import type { ReportDescriptor } from "@typescript-eslint/utils/ts-eslint"; import type { ConstantCase } from "string-ts"; import * as tsutils from "ts-api-utils"; +import { isMatching, match } from "ts-pattern"; import ts from "typescript"; import { createRule } from "../utils"; @@ -69,7 +70,7 @@ function inspectVariantTypes(types: ts.Type[]) { case booleans.length === 1 && !!booleans[0]: { const [first] = booleans; F.pipe( - M.match>(first) + match>(first) .when(tsutils.isTrueLiteralType, () => O.some("truthy boolean")) .when(tsutils.isFalseLiteralType, () => O.some("falsy boolean")) .otherwise(O.none), @@ -89,7 +90,7 @@ function inspectVariantTypes(types: ts.Type[]) { const strings = types.filter(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.StringLike)); if (strings.length > 0) { - const evaluated = M.match(strings) + const evaluated = match(strings) .when( types => types.every(type => type.isStringLiteral() && type.value !== ""), F.constant("truthy string"), @@ -111,7 +112,7 @@ function inspectVariantTypes(types: ts.Type[]) { ); if (numbers.length > 0) { - const evaluated = M.match(numbers) + const evaluated = match(numbers) .when( types => types.every(type => type.isNumberLiteral() && type.value !== 0), F.constant("truthy number"), @@ -201,10 +202,10 @@ export default createRule<[], MessageID>({ } function checkExpression(node: TSESTree.Expression): O.Option> { - return M.match>>(node) + return match>>(node) .when(isJSX, O.none) .with({ type: NodeType.LogicalExpression, operator: "&&" }, ({ left, right }) => { - const isLeftUnaryNot = M.isMatching({ + const isLeftUnaryNot = isMatching({ type: NodeType.UnaryExpression, operator: "!", }, left); diff --git a/packages/eslint-plugin-jsx/src/rules/no-missing-key.ts b/packages/eslint-plugin-jsx/src/rules/no-missing-key.ts index 9dc4f9cda..87b4b0cb8 100644 --- a/packages/eslint-plugin-jsx/src/rules/no-missing-key.ts +++ b/packages/eslint-plugin-jsx/src/rules/no-missing-key.ts @@ -7,10 +7,11 @@ import { unsafeIsMapCall, } from "@eslint-react/ast"; import { getFragmentFromContext, getPragmaFromContext, hasProp } from "@eslint-react/jsx"; -import { M, MutRef, O } from "@eslint-react/tools"; +import { MutRef, O } from "@eslint-react/tools"; import type { TSESTree } from "@typescript-eslint/types"; import type { ESLintUtils } from "@typescript-eslint/utils"; import type { ReportDescriptor } from "@typescript-eslint/utils/ts-eslint"; +import { match } from "ts-pattern"; import { createRule, getChildrenToArraySelector } from "../utils"; @@ -66,7 +67,7 @@ export default createRule<[], MessageID>({ } function checkExpression(node: TSESTree.Expression): O.Option> { - return M.match(node) + return match(node) .with({ type: NodeType.JSXElement }, checkIteratorElement) .with({ type: NodeType.JSXFragment }, checkIteratorElement) .with({ type: NodeType.ConditionalExpression }, (n) => { diff --git a/packages/eslint-plugin-jsx/src/utils/create-rule.ts b/packages/eslint-plugin-jsx/src/utils/create-rule.ts index 3e76f0055..9dfd49f70 100644 --- a/packages/eslint-plugin-jsx/src/utils/create-rule.ts +++ b/packages/eslint-plugin-jsx/src/utils/create-rule.ts @@ -1,4 +1,4 @@ -import { createRuleForPlugin } from "@eslint-react/utils"; +import { createRuleForPlugin } from "@eslint-react/eslint-utils"; import { ESLintUtils } from "@typescript-eslint/utils"; export const createRule = createRuleForPlugin("jsx"); diff --git a/packages/eslint-plugin-naming-convention/package.json b/packages/eslint-plugin-naming-convention/package.json index d1a86c8cb..eb0b09d4e 100644 --- a/packages/eslint-plugin-naming-convention/package.json +++ b/packages/eslint-plugin-naming-convention/package.json @@ -43,25 +43,22 @@ "dependencies": { "@eslint-react/ast": "workspace:*", "@eslint-react/core": "workspace:*", + "@eslint-react/eslint-utils": "workspace:*", "@eslint-react/jsx": "workspace:*", "@eslint-react/shared": "workspace:*", + "@eslint-react/third-party": "workspace:*", "@eslint-react/tools": "workspace:*", "@eslint-react/types": "workspace:*", - "@eslint-react/utils": "workspace:*", - "@typescript-eslint/parser": ">=6.14.0", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/type-utils": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/utils": "6.14.0", - "dedent": "1.5.1", - "effect": "2.0.0-next.60", - "rambda": "8.6.0", + "@typescript-eslint/parser": ">=6.15.0", + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/type-utils": "6.15.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/utils": "6.15.0", "string-ts": "1.3.3", - "ts-api-utils": "1.0.3", "typescript": ">=5.3.3" }, "peerDependencies": { - "@typescript-eslint/parser": ">=6.14.0", + "@typescript-eslint/parser": ">=6.15.0", "eslint": ">=8.56.0", "typescript": ">=5.3.3" }, diff --git a/packages/eslint-plugin-naming-convention/src/rules/component-name.ts b/packages/eslint-plugin-naming-convention/src/rules/component-name.ts index ae17ce997..3405c1e3f 100644 --- a/packages/eslint-plugin-naming-convention/src/rules/component-name.ts +++ b/packages/eslint-plugin-naming-convention/src/rules/component-name.ts @@ -1,14 +1,16 @@ import { getClassIdentifier, getFunctionIdentifier } from "@eslint-react/ast"; import { componentCollector, componentCollectorLegacy } from "@eslint-react/core"; import { elementType } from "@eslint-react/jsx"; -import { O, P } from "@eslint-react/tools"; -import { getCaseValidator } from "@eslint-react/utils"; +import { ESLintPluginFilenamesSimple } from "@eslint-react/third-party"; +import { _, O } from "@eslint-react/tools"; import { type ESLintUtils } from "@typescript-eslint/utils"; import type { JSONSchema4 } from "@typescript-eslint/utils/json-schema"; import { type ConstantCase } from "string-ts"; import { createRule } from "../utils"; +const { getCaseValidator } = ESLintPluginFilenamesSimple; + export const RULE_NAME = "component-name"; export type MessageID = ConstantCase; @@ -75,8 +77,8 @@ export default createRule({ defaultOptions, create(context) { const options = context.options[0] ?? defaultOptions[0]; - const excepts = P.isString(options) ? [] : options.excepts ?? []; - const rule = P.isString(options) ? options : options.rule ?? "PascalCase"; + const excepts = _.isString(options) ? [] : options.excepts ?? []; + const rule = _.isString(options) ? options : options.rule ?? "PascalCase"; const validator = getCaseValidator(rule, [...excepts]); const validate = (name: string) => validator.validate(name); diff --git a/packages/eslint-plugin-naming-convention/src/rules/filename-extension.ts b/packages/eslint-plugin-naming-convention/src/rules/filename-extension.ts index 2bcdc653b..72c892187 100644 --- a/packages/eslint-plugin-naming-convention/src/rules/filename-extension.ts +++ b/packages/eslint-plugin-naming-convention/src/rules/filename-extension.ts @@ -1,5 +1,5 @@ import { ESLintSettingsSchema, parse } from "@eslint-react/shared"; -import { MutRef, P } from "@eslint-react/tools"; +import { _, MutRef } from "@eslint-react/tools"; import type { ESLintUtils } from "@typescript-eslint/utils"; import type { JSONSchema4 } from "@typescript-eslint/utils/json-schema"; @@ -77,8 +77,8 @@ export default createRule({ create(context) { const configs = parse(ESLintSettingsSchema, context.settings).eslintReact; const options = context.options[0] ?? defaultOptions[0]; - const allow = P.isObject(options) ? options.allow : options; - const extensions = P.isObject(options) && "extensions" in options + const allow = _.isObject(options) ? options.allow : options; + const extensions = _.isObject(options) && "extensions" in options ? options.extensions : configs?.jsx?.extensions ?? defaultOptions[0].extensions; diff --git a/packages/eslint-plugin-naming-convention/src/rules/filename.ts b/packages/eslint-plugin-naming-convention/src/rules/filename.ts index 8571d3458..70ff1e925 100644 --- a/packages/eslint-plugin-naming-convention/src/rules/filename.ts +++ b/packages/eslint-plugin-naming-convention/src/rules/filename.ts @@ -1,12 +1,14 @@ import { ESLintSettingsSchema, parse } from "@eslint-react/shared"; -import { O, P } from "@eslint-react/tools"; -import { getCaseValidator } from "@eslint-react/utils"; +import { ESLintPluginFilenamesSimple } from "@eslint-react/third-party"; +import { _, O } from "@eslint-react/tools"; import type { ESLintUtils } from "@typescript-eslint/utils"; import type { JSONSchema4 } from "@typescript-eslint/utils/json-schema"; import path from "pathe"; import { createRule } from "../utils"; +const { getCaseValidator } = ESLintPluginFilenamesSimple; + export const RULE_NAME = "filename"; export type MessageID = @@ -86,9 +88,9 @@ export default createRule({ create(context) { const configs = parse(ESLintSettingsSchema, context.settings).eslintReact; const options = context.options[0] ?? defaultOptions[0]; - const rule = P.isString(options) ? options : options.rule ?? "PascalCase"; - const excepts = P.isString(options) ? [] : options.excepts ?? []; - const extensions = P.isObject(options) && "extensions" in options + const rule = _.isString(options) ? options : options.rule ?? "PascalCase"; + const excepts = _.isString(options) ? [] : options.excepts ?? []; + const extensions = _.isObject(options) && "extensions" in options ? options.extensions : configs?.jsx?.extensions ?? defaultOptions[0].extensions; @@ -133,7 +135,7 @@ export default createRule({ data: { name: filename, rule, - suggestion: `${[maybeSuggestion.value, ...rest].join(".")}`, + suggestion: [maybeSuggestion.value, ...rest].join("."), }, messageId: "FILENAME_CASE_MISMATCH_SUGGESTION", node, diff --git a/packages/eslint-plugin-naming-convention/src/rules/use-state.ts b/packages/eslint-plugin-naming-convention/src/rules/use-state.ts index 59f7d858e..0467e5a00 100644 --- a/packages/eslint-plugin-naming-convention/src/rules/use-state.ts +++ b/packages/eslint-plugin-naming-convention/src/rules/use-state.ts @@ -1,10 +1,11 @@ import { NodeType } from "@eslint-react/ast"; import { componentCollector, isUseStateCall } from "@eslint-react/core"; import { getPragmaFromContext } from "@eslint-react/jsx"; -import { F, M, O, P } from "@eslint-react/tools"; +import { _, F, O } from "@eslint-react/tools"; import type { ESLintUtils } from "@typescript-eslint/utils"; import type { ReportDescriptor } from "@typescript-eslint/utils/ts-eslint"; import { capitalize, type ConstantCase } from "string-ts"; +import { match } from "ts-pattern"; import { createRule } from "../utils"; @@ -61,7 +62,7 @@ export default createRule<[], MessageID>({ const descriptor = O.some({ messageId: "USE_STATE", node: id } as const); F.pipe( - M.match>>(id) + match>>(id) .with({ type: NodeType.Identifier }, F.constant(descriptor)) .with({ type: NodeType.ArrayPattern }, n => { const [state, setState] = n.elements; @@ -71,7 +72,7 @@ export default createRule<[], MessageID>({ && setState?.type === NodeType.Identifier ) { return F.pipe( - O.liftPredicate(P.not(isValidSetterNameLoose))(setState.name), + O.liftPredicate(_.not(isValidSetterNameLoose))(setState.name), O.flatMap(F.constant(descriptor)), ); } diff --git a/packages/eslint-plugin-naming-convention/src/utils/create-rule.ts b/packages/eslint-plugin-naming-convention/src/utils/create-rule.ts index 09320079b..c3b62868d 100644 --- a/packages/eslint-plugin-naming-convention/src/utils/create-rule.ts +++ b/packages/eslint-plugin-naming-convention/src/utils/create-rule.ts @@ -1,4 +1,4 @@ -import { createRuleForPlugin } from "@eslint-react/utils"; +import { createRuleForPlugin } from "@eslint-react/eslint-utils"; import { ESLintUtils } from "@typescript-eslint/utils"; export const createRule = createRuleForPlugin("naming-convention"); diff --git a/packages/eslint-plugin-react-hooks/package.json b/packages/eslint-plugin-react-hooks/package.json index 98a55e1ed..50f2dbd41 100644 --- a/packages/eslint-plugin-react-hooks/package.json +++ b/packages/eslint-plugin-react-hooks/package.json @@ -43,25 +43,21 @@ "dependencies": { "@eslint-react/ast": "workspace:*", "@eslint-react/core": "workspace:*", + "@eslint-react/eslint-utils": "workspace:*", "@eslint-react/jsx": "workspace:*", "@eslint-react/shared": "workspace:*", "@eslint-react/tools": "workspace:*", "@eslint-react/types": "workspace:*", - "@eslint-react/utils": "workspace:*", - "@typescript-eslint/parser": ">=6.14.0", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/type-utils": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/utils": "6.14.0", - "dedent": "1.5.1", - "effect": "2.0.0-next.60", - "rambda": "8.6.0", + "@typescript-eslint/parser": ">=6.15.0", + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/type-utils": "6.15.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/utils": "6.15.0", "string-ts": "1.3.3", - "ts-api-utils": "1.0.3", "typescript": ">=5.3.3" }, "peerDependencies": { - "@typescript-eslint/parser": ">=6.14.0", + "@typescript-eslint/parser": ">=6.15.0", "eslint": ">=8.56.0", "typescript": ">=5.3.3" }, diff --git a/packages/eslint-plugin-react-hooks/src/rules/ensure-use-callback-has-non-empty-deps.ts b/packages/eslint-plugin-react-hooks/src/rules/ensure-use-callback-has-non-empty-deps.ts index 36b09be8a..4470ba4da 100644 --- a/packages/eslint-plugin-react-hooks/src/rules/ensure-use-callback-has-non-empty-deps.ts +++ b/packages/eslint-plugin-react-hooks/src/rules/ensure-use-callback-has-non-empty-deps.ts @@ -1,9 +1,10 @@ import { findVariableByNameUpToGlobal, getVariableInit, is, NodeType } from "@eslint-react/ast"; import { isUseCallbackCall, unsafeIsReactHookCall } from "@eslint-react/core"; import { getPragmaFromContext } from "@eslint-react/jsx"; -import { F, M, O } from "@eslint-react/tools"; +import { F, O } from "@eslint-react/tools"; import type { ESLintUtils } from "@typescript-eslint/utils"; import { type ConstantCase } from "string-ts"; +import { match } from "ts-pattern"; import { createRule } from "../utils"; @@ -48,7 +49,7 @@ export default createRule<[], MessageID>({ } const maybeDescriptor = F.pipe( - M.match(deps) + match(deps) .with({ type: NodeType.ArrayExpression }, O.some) .with({ type: NodeType.Identifier }, n => { return F.pipe( diff --git a/packages/eslint-plugin-react-hooks/src/rules/ensure-use-memo-has-non-empty-deps.ts b/packages/eslint-plugin-react-hooks/src/rules/ensure-use-memo-has-non-empty-deps.ts index c14bfa68b..aff3b6409 100644 --- a/packages/eslint-plugin-react-hooks/src/rules/ensure-use-memo-has-non-empty-deps.ts +++ b/packages/eslint-plugin-react-hooks/src/rules/ensure-use-memo-has-non-empty-deps.ts @@ -1,9 +1,10 @@ import { findVariableByNameUpToGlobal, getVariableInit, is, NodeType } from "@eslint-react/ast"; import { isUseMemoCall, unsafeIsReactHookCall } from "@eslint-react/core"; import { getPragmaFromContext } from "@eslint-react/jsx"; -import { F, M, O } from "@eslint-react/tools"; +import { F, O } from "@eslint-react/tools"; import type { ESLintUtils } from "@typescript-eslint/utils"; import { type ConstantCase } from "string-ts"; +import { match } from "ts-pattern"; import { createRule } from "../utils"; @@ -48,7 +49,7 @@ export default createRule<[], MessageID>({ } const maybeDescriptor = F.pipe( - M.match(deps) + match(deps) .with({ type: NodeType.ArrayExpression }, O.some) .with({ type: NodeType.Identifier }, n => { return F.pipe( diff --git a/packages/eslint-plugin-react-hooks/src/utils/create-rule.ts b/packages/eslint-plugin-react-hooks/src/utils/create-rule.ts index d88b7d64a..9e3e2bc7b 100644 --- a/packages/eslint-plugin-react-hooks/src/utils/create-rule.ts +++ b/packages/eslint-plugin-react-hooks/src/utils/create-rule.ts @@ -1,4 +1,4 @@ -import { createRuleForPlugin } from "@eslint-react/utils"; +import { createRuleForPlugin } from "@eslint-react/eslint-utils"; import { ESLintUtils } from "@typescript-eslint/utils"; export const createRule = createRuleForPlugin("react-hooks"); diff --git a/packages/eslint-plugin-react/package.json b/packages/eslint-plugin-react/package.json index 5763c3eff..922605793 100644 --- a/packages/eslint-plugin-react/package.json +++ b/packages/eslint-plugin-react/package.json @@ -43,25 +43,21 @@ "dependencies": { "@eslint-react/ast": "workspace:*", "@eslint-react/core": "workspace:*", + "@eslint-react/eslint-utils": "workspace:*", "@eslint-react/jsx": "workspace:*", "@eslint-react/shared": "workspace:*", "@eslint-react/tools": "workspace:*", "@eslint-react/types": "workspace:*", - "@eslint-react/utils": "workspace:*", - "@typescript-eslint/parser": ">=6.14.0", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/type-utils": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/utils": "6.14.0", - "dedent": "1.5.1", - "effect": "2.0.0-next.60", - "rambda": "8.6.0", + "@typescript-eslint/parser": ">=6.15.0", + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/type-utils": "6.15.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/utils": "6.15.0", "string-ts": "1.3.3", - "ts-api-utils": "1.0.3", "typescript": ">=5.3.3" }, "peerDependencies": { - "@typescript-eslint/parser": ">=6.14.0", + "@typescript-eslint/parser": ">=6.15.0", "eslint": ">=8.56.0", "typescript": ">=5.3.3" }, diff --git a/packages/eslint-plugin-react/src/rules/ensure-forward-ref-using-ref.ts b/packages/eslint-plugin-react/src/rules/ensure-forward-ref-using-ref.ts index 46783ed16..c6e514cd7 100644 --- a/packages/eslint-plugin-react/src/rules/ensure-forward-ref-using-ref.ts +++ b/packages/eslint-plugin-react/src/rules/ensure-forward-ref-using-ref.ts @@ -1,6 +1,6 @@ // Ported from https://github.com/jsx-eslint/eslint-plugin-react/pull/3667 import { isFunction } from "@eslint-react/ast"; -import { isCallFromPragma } from "@eslint-react/jsx"; +import { isForwardRefCall } from "@eslint-react/core"; import type { ESLintUtils } from "@typescript-eslint/utils"; import type { ConstantCase } from "string-ts"; @@ -10,8 +10,6 @@ export const RULE_NAME = "ensure-forward-ref-using-ref"; export type MessageID = ConstantCase; -const isForwardRefCall = isCallFromPragma("forwardRef"); - export default createRule<[], MessageID>({ name: RULE_NAME, meta: { diff --git a/packages/eslint-plugin-react/src/rules/no-create-ref.ts b/packages/eslint-plugin-react/src/rules/no-create-ref.ts index d601a5fbf..8a4093d89 100644 --- a/packages/eslint-plugin-react/src/rules/no-create-ref.ts +++ b/packages/eslint-plugin-react/src/rules/no-create-ref.ts @@ -1,6 +1,5 @@ import { type TSESTreeFunction } from "@eslint-react/ast"; -import { componentCollector } from "@eslint-react/core"; -import { isCallFromPragma } from "@eslint-react/jsx"; +import { componentCollector, isCreateRefCall } from "@eslint-react/core"; import { O } from "@eslint-react/tools"; import type { TSESTree } from "@typescript-eslint/types"; import type { ESLintUtils } from "@typescript-eslint/utils"; @@ -12,8 +11,6 @@ export const RULE_NAME = "no-create-ref"; export type MessageID = ConstantCase; -const isCreateRefCall = isCallFromPragma("createRef"); - export default createRule<[], MessageID>({ name: RULE_NAME, meta: { diff --git a/packages/eslint-plugin-react/src/rules/no-dangerously-set-innerhtml-with-children.ts b/packages/eslint-plugin-react/src/rules/no-dangerously-set-innerhtml-with-children.ts index 4fead84af..2263eb474 100644 --- a/packages/eslint-plugin-react/src/rules/no-dangerously-set-innerhtml-with-children.ts +++ b/packages/eslint-plugin-react/src/rules/no-dangerously-set-innerhtml-with-children.ts @@ -1,9 +1,10 @@ import { findVariableByNameUpToGlobal, getVariableInit, is, isOneOf, NodeType } from "@eslint-react/ast"; import { findPropInProperties, hasChildren, hasProp, isCreateElementCall, isLineBreak } from "@eslint-react/jsx"; -import { F, M, O, P } from "@eslint-react/tools"; +import { _, F, O } from "@eslint-react/tools"; import type { TSESTree } from "@typescript-eslint/types"; import type { ESLintUtils } from "@typescript-eslint/utils"; import type { ConstantCase } from "string-ts"; +import { match } from "ts-pattern"; import { createRule } from "../utils"; @@ -15,7 +16,7 @@ function firstChildIsText(node: TSESTree.JSXElement) { const [firstChild] = node.children; return node.children.length > 0 - && !P.isNullable(firstChild) + && !_.isNullable(firstChild) && !isLineBreak(firstChild); } @@ -42,7 +43,7 @@ export default createRule<[], MessageID>({ return; } const props = node.arguments[1]; - const maybeProperties = M.match(props) + const maybeProperties = match(props) .when(isOneOf([NodeType.ObjectExpression, NodeType.ObjectPattern]), (n) => { return "properties" in n ? O.some(n.properties) : O.none(); }) diff --git a/packages/eslint-plugin-react/src/rules/no-dangerously-set-innerhtml.ts b/packages/eslint-plugin-react/src/rules/no-dangerously-set-innerhtml.ts index a5d76ab65..57059f9a1 100644 --- a/packages/eslint-plugin-react/src/rules/no-dangerously-set-innerhtml.ts +++ b/packages/eslint-plugin-react/src/rules/no-dangerously-set-innerhtml.ts @@ -1,8 +1,9 @@ import { findVariableByNameUpToGlobal, getVariableInit, is, isOneOf, NodeType } from "@eslint-react/ast"; import { findPropInAttributes, findPropInProperties, isCreateElementCall } from "@eslint-react/jsx"; -import { F, M, O } from "@eslint-react/tools"; +import { F, O } from "@eslint-react/tools"; import type { ESLintUtils } from "@typescript-eslint/utils"; import type { ConstantCase } from "string-ts"; +import { match } from "ts-pattern"; import { createRule } from "../utils"; @@ -34,7 +35,7 @@ export default createRule<[], MessageID>({ } const props = node.arguments[1]; - const maybeProperties = M.match(props) + const maybeProperties = match(props) .when(isOneOf([NodeType.ObjectExpression, NodeType.ObjectPattern]), (n) => { return "properties" in n ? O.some(n.properties) : O.none(); }) diff --git a/packages/eslint-plugin-react/src/rules/no-find-dom-node.ts b/packages/eslint-plugin-react/src/rules/no-find-dom-node.ts index 49d208024..a2fdfb26a 100644 --- a/packages/eslint-plugin-react/src/rules/no-find-dom-node.ts +++ b/packages/eslint-plugin-react/src/rules/no-find-dom-node.ts @@ -1,7 +1,8 @@ import { NodeType } from "@eslint-react/ast"; -import { F, M } from "@eslint-react/tools"; +import { F } from "@eslint-react/tools"; import { ESLintUtils } from "@typescript-eslint/utils"; import type { ConstantCase } from "string-ts"; +import { match } from "ts-pattern"; import { createRule } from "../utils"; @@ -30,7 +31,7 @@ export default createRule<[], MessageID>({ CallExpression(node) { const { callee } = node; - const isFindDOMNode = M.match(callee) + const isFindDOMNode = match(callee) .with({ type: NodeType.Identifier }, ({ name }) => name === "findDOMNode") .with( { type: NodeType.MemberExpression }, diff --git a/packages/eslint-plugin-react/src/rules/no-missing-button-type.ts b/packages/eslint-plugin-react/src/rules/no-missing-button-type.ts index 55f232ada..1d2bd6d8e 100644 --- a/packages/eslint-plugin-react/src/rules/no-missing-button-type.ts +++ b/packages/eslint-plugin-react/src/rules/no-missing-button-type.ts @@ -1,8 +1,9 @@ import { NodeType } from "@eslint-react/ast"; import { findPropInAttributes, findPropInProperties, getPropValue, isCreateElementCall } from "@eslint-react/jsx"; -import { F, M, O, P } from "@eslint-react/tools"; +import { _, F, O } from "@eslint-react/tools"; import type { ESLintUtils } from "@typescript-eslint/utils"; import type { ConstantCase } from "string-ts"; +import { isMatching, P } from "ts-pattern"; import { createRule } from "../utils"; @@ -37,7 +38,7 @@ export default createRule<[], MessageID>({ const [name, props] = node.arguments; - if (!M.isMatching({ type: NodeType.Literal, value: "button" }, name)) { + if (!isMatching({ type: NodeType.Literal, value: "button" }, name)) { return; } @@ -62,11 +63,11 @@ export default createRule<[], MessageID>({ } const typeProperty = maybeTypeProperty.value; - const hasValidType = M.isMatching({ + const hasValidType = isMatching({ type: NodeType.Property, value: { type: NodeType.Literal, - value: M.P.union(...validTypes), + value: P.union(...validTypes), }, }, typeProperty); @@ -104,7 +105,7 @@ export default createRule<[], MessageID>({ const hasValidType = F.pipe( getPropValue(typeAttribute, context), O.flatMapNullable(v => v?.value), - O.filter(P.isString), + O.filter(_.isString), O.exists((value) => validTypes.some((type) => type === value)), ); diff --git a/packages/eslint-plugin-react/src/rules/no-missing-iframe-sandbox.ts b/packages/eslint-plugin-react/src/rules/no-missing-iframe-sandbox.ts index f85e3709a..8b7e29737 100644 --- a/packages/eslint-plugin-react/src/rules/no-missing-iframe-sandbox.ts +++ b/packages/eslint-plugin-react/src/rules/no-missing-iframe-sandbox.ts @@ -1,8 +1,9 @@ import { NodeType } from "@eslint-react/ast"; import { findPropInAttributes, findPropInProperties, getPropValue, isCreateElementCall } from "@eslint-react/jsx"; -import { F, M, O, P } from "@eslint-react/tools"; +import { _, F, O } from "@eslint-react/tools"; import type { ESLintUtils } from "@typescript-eslint/utils"; import type { ConstantCase } from "string-ts"; +import { isMatching, P } from "ts-pattern"; import { createRule } from "../utils"; @@ -53,7 +54,7 @@ export default createRule<[], MessageID>({ const [name, props] = node.arguments; - if (!M.isMatching({ type: NodeType.Literal, value: "iframe" }, name)) { + if (!isMatching({ type: NodeType.Literal, value: "iframe" }, name)) { return; } @@ -78,11 +79,11 @@ export default createRule<[], MessageID>({ } const sandboxProperty = maybeSandboxProperty.value; - const hasValidSandbox = M.isMatching({ + const hasValidSandbox = isMatching({ type: NodeType.Property, value: { type: NodeType.Literal, - value: M.P.union(...validTypes), + value: P.union(...validTypes), }, }, sandboxProperty); @@ -120,7 +121,7 @@ export default createRule<[], MessageID>({ const hasValidSandbox = F.pipe( getPropValue(sandboxAttribute, context), O.flatMapNullable(v => v?.value), - O.filter(P.isString), + O.filter(_.isString), O.map((value) => value.split(" ")), O.exists((values) => values.every((value) => validTypes.some((validType) => validType === value))), ); diff --git a/packages/eslint-plugin-react/src/rules/no-script-url.ts b/packages/eslint-plugin-react/src/rules/no-script-url.ts index 44a13b19c..a78f3fd86 100644 --- a/packages/eslint-plugin-react/src/rules/no-script-url.ts +++ b/packages/eslint-plugin-react/src/rules/no-script-url.ts @@ -1,7 +1,7 @@ import { NodeType } from "@eslint-react/ast"; import { getPropValue } from "@eslint-react/jsx"; import { RE_JAVASCRIPT_PROTOCOL } from "@eslint-react/shared"; -import { F, O, P } from "@eslint-react/tools"; +import { _, F, O } from "@eslint-react/tools"; import type { ESLintUtils } from "@typescript-eslint/utils"; import type { ConstantCase } from "string-ts"; @@ -40,7 +40,7 @@ export default createRule<[], MessageID>({ const isJavaScript = F.pipe( getPropValue(node, context), O.flatMapNullable(v => v?.value), - O.filter(P.isString), + O.filter(_.isString), O.exists(v => RE_JAVASCRIPT_PROTOCOL.test(v)), ); diff --git a/packages/eslint-plugin-react/src/rules/no-string-refs.ts b/packages/eslint-plugin-react/src/rules/no-string-refs.ts index 4882f0688..8dfe5b010 100644 --- a/packages/eslint-plugin-react/src/rules/no-string-refs.ts +++ b/packages/eslint-plugin-react/src/rules/no-string-refs.ts @@ -1,6 +1,6 @@ import { NodeType } from "@eslint-react/ast"; import { getParentClassComponent } from "@eslint-react/core"; -import { O, P } from "@eslint-react/tools"; +import { _, O } from "@eslint-react/tools"; import type { TSESTree } from "@typescript-eslint/types"; import type { ESLintUtils } from "@typescript-eslint/utils"; import type { ConstantCase } from "string-ts"; @@ -12,7 +12,7 @@ export const RULE_NAME = "no-string-refs"; export type MessageID = ConstantCase; function containsStringLiteral({ value }: TSESTree.JSXAttribute) { - return value?.type === NodeType.Literal && P.isString(value.value); + return value?.type === NodeType.Literal && _.isString(value.value); } function containsStringExpressionContainer({ value }: TSESTree.JSXAttribute) { @@ -21,7 +21,7 @@ function containsStringExpressionContainer({ value }: TSESTree.JSXAttribute) { } if (value.expression.type === NodeType.Literal) { - return P.isString(value.expression.value); + return _.isString(value.expression.value); } return value.expression.type === NodeType.TemplateLiteral; diff --git a/packages/eslint-plugin-react/src/rules/no-unsafe-iframe-sandbox.ts b/packages/eslint-plugin-react/src/rules/no-unsafe-iframe-sandbox.ts index b3c271eb0..75236a3aa 100644 --- a/packages/eslint-plugin-react/src/rules/no-unsafe-iframe-sandbox.ts +++ b/packages/eslint-plugin-react/src/rules/no-unsafe-iframe-sandbox.ts @@ -1,8 +1,9 @@ import { NodeType } from "@eslint-react/ast"; import { findPropInAttributes, findPropInProperties, getPropValue, isCreateElementCall } from "@eslint-react/jsx"; -import { F, M, O, P } from "@eslint-react/tools"; +import { _, F, O } from "@eslint-react/tools"; import type { ESLintUtils } from "@typescript-eslint/utils"; import type { ConstantCase } from "string-ts"; +import { isMatching, P } from "ts-pattern"; import { createRule } from "../utils"; @@ -40,7 +41,7 @@ export default createRule<[], MessageID>({ const [name, props] = node.arguments; - if (!M.isMatching({ type: NodeType.Literal, value: "iframe" }, name)) { + if (!isMatching({ type: NodeType.Literal, value: "iframe" }, name)) { return; } @@ -56,11 +57,11 @@ export default createRule<[], MessageID>({ const isSafeSandboxValue = !F.pipe( maybeSandboxProperty, - O.filter(M.isMatching({ + O.filter(isMatching({ type: NodeType.Property, value: { type: NodeType.Literal, - value: M.P.string, + value: P.string, }, })), O.flatMapNullable(v => v.value.value), @@ -98,7 +99,7 @@ export default createRule<[], MessageID>({ const isSafeSandboxValue = !F.pipe( getPropValue(maybeSandboxAttribute.value, context), O.flatMapNullable(v => v?.value), - O.filter(P.isString), + O.filter(_.isString), O.map((value) => value.split(" ")), O.exists(values => unsafeCombinations.some(combinations => combinations.every(unsafeValue => values.includes(unsafeValue))) diff --git a/packages/eslint-plugin-react/src/rules/no-unsafe-target-blank.ts b/packages/eslint-plugin-react/src/rules/no-unsafe-target-blank.ts index d82a2487f..83baa0fe8 100644 --- a/packages/eslint-plugin-react/src/rules/no-unsafe-target-blank.ts +++ b/packages/eslint-plugin-react/src/rules/no-unsafe-target-blank.ts @@ -1,6 +1,6 @@ import { NodeType } from "@eslint-react/ast"; import { findPropInAttributes, getPropValue } from "@eslint-react/jsx"; -import { F, O, P } from "@eslint-react/tools"; +import { _, F, O } from "@eslint-react/tools"; import { ESLintUtils } from "@typescript-eslint/utils"; import type { ConstantCase } from "string-ts"; @@ -58,7 +58,7 @@ export default createRule<[], MessageID>({ return F.pipe( getPropValue(attr, context), O.flatMapNullable(v => v?.value), - O.filter(P.isString), + O.filter(_.isString), O.exists(isExternalLinkLike), ); }); @@ -71,7 +71,7 @@ export default createRule<[], MessageID>({ findPropInAttributes(attributes, context, initialScope)("rel"), O.flatMap(attr => getPropValue(attr, context)), O.flatMapNullable(v => v?.value), - O.filter(P.isString), + O.filter(_.isString), O.exists(isSafeRel), ); diff --git a/packages/eslint-plugin-react/src/rules/no-unstable-default-props.ts b/packages/eslint-plugin-react/src/rules/no-unstable-default-props.ts index 05cf9afc3..96e8bd6bc 100644 --- a/packages/eslint-plugin-react/src/rules/no-unstable-default-props.ts +++ b/packages/eslint-plugin-react/src/rules/no-unstable-default-props.ts @@ -1,5 +1,5 @@ -import { isUnstableAssignmentPattern, NodeType, readableNodeType } from "@eslint-react/ast"; -import { componentCollector } from "@eslint-react/core"; +import { NodeType, readableNodeType } from "@eslint-react/ast"; +import { componentCollector, isUnstableAssignmentPattern } from "@eslint-react/core"; import { type TSESTree } from "@typescript-eslint/types"; import type { ESLintUtils } from "@typescript-eslint/utils"; import type { ConstantCase } from "string-ts"; diff --git a/packages/eslint-plugin-react/src/rules/prefer-destructuring-assignment.ts b/packages/eslint-plugin-react/src/rules/prefer-destructuring-assignment.ts index 938994262..d4213bf0f 100644 --- a/packages/eslint-plugin-react/src/rules/prefer-destructuring-assignment.ts +++ b/packages/eslint-plugin-react/src/rules/prefer-destructuring-assignment.ts @@ -1,10 +1,11 @@ import { getFunctionIdentifier, isFunction, NodeType, type TSESTreeFunction } from "@eslint-react/ast"; import { componentCollector, isValidComponentName } from "@eslint-react/core"; -import { M, MutRef, O } from "@eslint-react/tools"; +import { MutRef, O } from "@eslint-react/tools"; import type { Scope } from "@typescript-eslint/scope-manager"; import { type TSESTree } from "@typescript-eslint/types"; import type { ESLintUtils } from "@typescript-eslint/utils"; import type { ConstantCase } from "string-ts"; +import { isMatching } from "ts-pattern"; import { createRule } from "../utils"; @@ -85,7 +86,7 @@ export default createRule<[], MessageID>({ const [props, ctx] = component.params; - const isMatch = M.isMatching({ name: memberExpression.object.name }); + const isMatch = isMatching({ name: memberExpression.object.name }); if (isMatch(props)) { context.report({ diff --git a/packages/eslint-plugin-react/src/utils/create-rule.ts b/packages/eslint-plugin-react/src/utils/create-rule.ts index a84f27d52..32edd125b 100644 --- a/packages/eslint-plugin-react/src/utils/create-rule.ts +++ b/packages/eslint-plugin-react/src/utils/create-rule.ts @@ -1,4 +1,4 @@ -import { createRuleForPlugin } from "@eslint-react/utils"; +import { createRuleForPlugin } from "@eslint-react/eslint-utils"; import { ESLintUtils } from "@typescript-eslint/utils"; export const createRule = createRuleForPlugin("react"); diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index a55e33364..c9ca665df 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -60,12 +60,11 @@ "@eslint-react/shared": "workspace:*", "@eslint-react/tools": "workspace:*", "@eslint-react/types": "workspace:*", - "@typescript-eslint/parser": ">=6.14.0", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/type-utils": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/utils": "6.14.0", - "string-ts": "1.3.3" + "@typescript-eslint/parser": ">=6.15.0", + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/type-utils": "6.15.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/utils": "6.15.0" }, "peerDependencies": { "eslint": ">=8.56.0", diff --git a/packages/eslint-plugin/src/index.ts b/packages/eslint-plugin/src/index.ts index 9eee06875..3f9e3b93d 100644 --- a/packages/eslint-plugin/src/index.ts +++ b/packages/eslint-plugin/src/index.ts @@ -3,7 +3,7 @@ import * as jsx from "@eslint-react/eslint-plugin-jsx"; import * as namingConvention from "@eslint-react/eslint-plugin-naming-convention"; import * as react from "@eslint-react/eslint-plugin-react"; import * as hooks from "@eslint-react/eslint-plugin-react-hooks"; -import { entries, fromEntries } from "@eslint-react/tools"; +import { Helper } from "@eslint-react/tools"; import type { RulePreset } from "@eslint-react/types"; import tsParser from "@typescript-eslint/parser"; // workaround for @typescript-eslint/utils's TS2742 error. @@ -12,6 +12,8 @@ import type { ESLintUtils } from "@typescript-eslint/utils"; import { name, version } from "../package.json"; import { padKeysLeft } from "./utils"; +const { entries, fromEntries } = Helper.Record; + const rulePreset = { "debug/class-component": "warn", "debug/function-component": "warn", diff --git a/packages/eslint-plugin/src/utils/transform-keys.ts b/packages/eslint-plugin/src/utils/transform-keys.ts index bd4824a45..04fecfa51 100644 --- a/packages/eslint-plugin/src/utils/transform-keys.ts +++ b/packages/eslint-plugin/src/utils/transform-keys.ts @@ -5,10 +5,10 @@ /* eslint-disable guard-for-in */ /* eslint-disable functional/no-loop-statements */ // Copied from https://github.com/gustavoguichard/string-ts/blob/9dd444f03fdfa225f1643e6f1f8c18f9480224bb/src/utils/object-keys/transform-keys.ts#L12 -import { P } from "@eslint-react/tools"; +import { _ } from "@eslint-react/tools"; export function transformKeys(obj: T, transform: (s: string) => string): T { - if (!P.isObject(obj)) { + if (!_.isObject(obj)) { return obj; } diff --git a/packages/utils/README.md b/packages/eslint-utils/README.md similarity index 89% rename from packages/utils/README.md rename to packages/eslint-utils/README.md index 031d2b4d5..2737a753e 100644 --- a/packages/utils/README.md +++ b/packages/eslint-utils/README.md @@ -1,4 +1,4 @@ -# `@eslint-react/utils` +# `@eslint-react/eslint-utils` > ESLint React's utilities. diff --git a/packages/utils/docs/.nojekyll b/packages/eslint-utils/docs/.nojekyll similarity index 100% rename from packages/utils/docs/.nojekyll rename to packages/eslint-utils/docs/.nojekyll diff --git a/packages/utils/docs/README.md b/packages/eslint-utils/docs/README.md similarity index 53% rename from packages/utils/docs/README.md rename to packages/eslint-utils/docs/README.md index 782a7d888..c3f89b55d 100644 --- a/packages/utils/docs/README.md +++ b/packages/eslint-utils/docs/README.md @@ -1,38 +1,13 @@ -@eslint-react/shared +@eslint-react/eslint-utils -# @eslint-react/shared +# @eslint-react/eslint-utils ## Table of contents -### Classes - -- [CaseValidator](classes/CaseValidator.md) - -### Variables - -- [presetRules](README.md#presetrules) -- [uid](README.md#uid) - ### Functions - [createRuleForPlugin](README.md#createruleforplugin) -- [getCaseConverter](README.md#getcaseconverter) -- [getCaseValidator](README.md#getcasevalidator) -- [getRule](README.md#getrule) - [mergeConfigs](README.md#mergeconfigs) -- [splitName](README.md#splitname) - -## Variables - -### presetRules - -• `Const` **presetRules**: `PresetRules` - ---- - -### uid - -• `Const` **uid**: `default` ## Functions @@ -75,56 +50,6 @@ Function to create a rule with the docs URL format. --- -### getCaseConverter - -▸ **getCaseConverter**(`rule`): \(`str`: `T`) => `ConstantCase`\<`T`\> \| \(`str`: `T`) => `PascalCase`\<`T`\> \| \(`str`: `T`) => `CamelCase`\<`T`\> \| \(`str`: `T`) => `KebabCase`\<`T`\> \| \(`str`: `T`) => `SnakeCase`\<`T`\> - -#### Parameters - -| Name | Type | -| :----- | :--------------------------------------------------------------------------------------- | -| `rule` | `"CONSTANT_CASE"` \| `"PascalCase"` \| `"camelCase"` \| `"kebab-case"` \| `"snake_case"` | - -#### Returns - -\(`str`: `T`) => `ConstantCase`\<`T`\> \| \(`str`: `T`) => `PascalCase`\<`T`\> \| \(`str`: `T`) => `CamelCase`\<`T`\> \| \(`str`: `T`) => `KebabCase`\<`T`\> \| \(`str`: `T`) => `SnakeCase`\<`T`\> - ---- - -### getCaseValidator - -▸ **getCaseValidator**(`ruleName`, `ignorePattern?`): [`CaseValidator`](classes/CaseValidator.md) - -#### Parameters - -| Name | Type | Default value | -| :-------------- | :--------- | :------------ | -| `ruleName` | `string` | `undefined` | -| `ignorePattern` | `string`[] | `[]` | - -#### Returns - -[`CaseValidator`](classes/CaseValidator.md) - ---- - -### getRule - -▸ **getRule**(`expression`, `preset?`): `Rule` - -#### Parameters - -| Name | Type | Default value | -| :----------- | :------------ | :------------ | -| `expression` | `string` | `undefined` | -| `preset` | `PresetRules` | `presetRules` | - -#### Returns - -`Rule` - ---- - ### mergeConfigs ▸ **mergeConfigs**\<`Ts`\>(`...objects`): `DeepMergeHKT`\<`Ts`, `Readonly`\<\{ `DeepMergeArraysURI`: `"DeepMergeArraysDefaultURI"` ; `DeepMergeMapsURI`: `"DeepMergeMapsDefaultURI"` ; `DeepMergeOthersURI`: `"DeepMergeLeafURI"` ; `DeepMergeRecordsURI`: `"DeepMergeRecordsDefaultURI"` ; `DeepMergeSetsURI`: `"DeepMergeSetsDefaultURI"` }\>, \{ `keyPath`: `PropertyKey`[] }\> @@ -146,19 +71,3 @@ Deeply merge two or more objects using the given options and meta data. #### Returns `DeepMergeHKT`\<`Ts`, `Readonly`\<\{ `DeepMergeArraysURI`: `"DeepMergeArraysDefaultURI"` ; `DeepMergeMapsURI`: `"DeepMergeMapsDefaultURI"` ; `DeepMergeOthersURI`: `"DeepMergeLeafURI"` ; `DeepMergeRecordsURI`: `"DeepMergeRecordsDefaultURI"` ; `DeepMergeSetsURI`: `"DeepMergeSetsDefaultURI"` }\>, \{ `keyPath`: `PropertyKey`[] }\> - ---- - -### splitName - -▸ **splitName**(`name`): `string`[] - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `name` | `string` | - -#### Returns - -`string`[] diff --git a/packages/utils/package.json b/packages/eslint-utils/package.json similarity index 78% rename from packages/utils/package.json rename to packages/eslint-utils/package.json index a6c0880fc..cf0b53459 100644 --- a/packages/utils/package.json +++ b/packages/eslint-utils/package.json @@ -1,5 +1,5 @@ { - "name": "@eslint-react/utils", + "name": "@eslint-react/eslint-utils", "version": "0.9.8-beta.0", "description": "ESLint React's utilities.", "homepage": "https://github.com/rel1cx/eslint-react", @@ -9,7 +9,7 @@ "repository": { "type": "git", "url": "https://github.com/Rel1cx/eslint-react", - "directory": "packages/utils" + "directory": "packages/eslint-utils" }, "license": "MIT", "author": "Eva1ent", @@ -43,13 +43,7 @@ }, "dependencies": { "@eslint-react/shared": "workspace:*", - "@eslint-react/tools": "workspace:*", - "@eslint-react/types": "workspace:*", - "@typescript-eslint/utils": "6.14.0", - "dedent": "1.5.1", - "deepmerge-ts": "5.1.0", - "short-unique-id": "5.0.3", - "string-ts": "1.3.3", - "tslib": "2.6.2" + "@typescript-eslint/utils": "6.15.0", + "deepmerge-ts": "5.1.0" } } diff --git a/packages/utils/rollup.config.ts b/packages/eslint-utils/rollup.config.ts similarity index 100% rename from packages/utils/rollup.config.ts rename to packages/eslint-utils/rollup.config.ts diff --git a/packages/utils/src/create-rule.ts b/packages/eslint-utils/src/create-rule.ts similarity index 100% rename from packages/utils/src/create-rule.ts rename to packages/eslint-utils/src/create-rule.ts diff --git a/packages/eslint-utils/src/index.ts b/packages/eslint-utils/src/index.ts new file mode 100644 index 000000000..ce93bc18f --- /dev/null +++ b/packages/eslint-utils/src/index.ts @@ -0,0 +1,2 @@ +export * from "./create-rule"; +export * from "./merge-configs"; diff --git a/packages/utils/src/merge-configs.ts b/packages/eslint-utils/src/merge-configs.ts similarity index 100% rename from packages/utils/src/merge-configs.ts rename to packages/eslint-utils/src/merge-configs.ts diff --git a/packages/eslint-utils/tsconfig.json b/packages/eslint-utils/tsconfig.json new file mode 100644 index 000000000..52371f605 --- /dev/null +++ b/packages/eslint-utils/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.base.json", + "include": [ + "src", + "../tools/src/third-party/string/case-validator" + ] +} diff --git a/packages/eslint-utils/typedoc.json b/packages/eslint-utils/typedoc.json new file mode 100644 index 000000000..2dba1c901 --- /dev/null +++ b/packages/eslint-utils/typedoc.json @@ -0,0 +1,10 @@ +{ + "extends": [ + "../../typedoc.base.json" + ], + "name": "@eslint-react/eslint-utils", + "entryPoints": [ + "src/index.ts" + ], + "out": "docs" +} diff --git a/packages/jsx/docs/README.md b/packages/jsx/docs/README.md index 10d2c9255..9629ac018 100644 --- a/packages/jsx/docs/README.md +++ b/packages/jsx/docs/README.md @@ -42,13 +42,18 @@ - [hasEveryProp](README.md#haseveryprop) - [hasProp](README.md#hasprop) - [isCallFromPragma](README.md#iscallfrompragma) +- [isCallFromPragmaMember](README.md#iscallfrompragmamember) - [isChildOfJSXElement](README.md#ischildofjsxelement) - [isChildrenOfCreateElement](README.md#ischildrenofcreateelement) +- [isCloneElement](README.md#iscloneelement) - [isCloneElementCall](README.md#iscloneelementcall) +- [isCreateElement](README.md#iscreateelement) - [isCreateElementCall](README.md#iscreateelementcall) - [isFragment](README.md#isfragment) - [isFragmentElement](README.md#isfragmentelement) - [isFragmentSyntax](README.md#isfragmentsyntax) +- [isFromPragma](README.md#isfrompragma) +- [isFromPragmaMember](README.md#isfrompragmamember) - [isFunctionReturningJSXValue](README.md#isfunctionreturningjsxvalue) - [isInitializedFromPragma](README.md#isinitializedfrompragma) - [isInsideCreateElementProps](README.md#isinsidecreateelementprops) @@ -478,34 +483,60 @@ Check if the given prop name is present in the given attributes ### isCallFromPragma -▸ **isCallFromPragma**(`name`): (`node`: `Node`, `context`: `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\>) => node is CallExpression - -Checks if the given node is a call expression to the given function or method of the pragma +▸ **isCallFromPragma**(`name`): (`node`: `CallExpression`, `context`: `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\>) => `boolean` #### Parameters -| Name | Type | Description | -| :----- | :------- | :------------------------------------------ | -| `name` | `string` | The name of the function or method to check | +| Name | Type | +| :----- | :------- | +| `name` | `string` | #### Returns `fn` -A predicate that checks if the given node is a call expression to the given function or method +▸ (`node`, `context`): `boolean` + +##### Parameters -▸ (`node`, `context`): node is CallExpression +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `CallExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | + +##### Returns + +`boolean` + +--- + +### isCallFromPragmaMember + +▸ **isCallFromPragmaMember**(`pragmaMemberName`, `name`): (`node`: `CallExpression`, `context`: `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\>) => `boolean` + +#### Parameters + +| Name | Type | +| :----------------- | :------- | +| `pragmaMemberName` | `string` | +| `name` | `string` | + +#### Returns + +`fn` + +▸ (`node`, `context`): `boolean` ##### Parameters | Name | Type | | :-------- | :------------------------------------------------------------ | -| `node` | `Node` | +| `node` | `CallExpression` | | `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | ##### Returns -node is CallExpression +`boolean` --- @@ -546,45 +577,71 @@ node is JSXElement & Object --- -### isCloneElementCall +### isCloneElement + +▸ **isCloneElement**(`node`, `context`): `boolean` -▸ **isCloneElementCall**(`node`, `context`): node is CallExpression +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `Identifier` \| `MemberExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | + +#### Returns + +`boolean` + +--- + +### isCloneElementCall -Checks if the given node is a call expression to `cloneElement` +▸ **isCloneElementCall**(`node`, `context`): `boolean` #### Parameters -| Name | Type | Description | -| :-------- | :------------------------------------------------------------ | :-------------------- | -| `node` | `Node` | The AST node to check | -| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | The rule context | +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `CallExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | #### Returns -node is CallExpression +`boolean` + +--- + +### isCreateElement + +▸ **isCreateElement**(`node`, `context`): `boolean` + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `Identifier` \| `MemberExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | + +#### Returns -`true` if the node is a call expression to `cloneElement` +`boolean` --- ### isCreateElementCall -▸ **isCreateElementCall**(`node`, `context`): node is CallExpression - -Checks if the given node is a call expression to `createElement` +▸ **isCreateElementCall**(`node`, `context`): `boolean` #### Parameters -| Name | Type | Description | -| :-------- | :------------------------------------------------------------ | :-------------------- | -| `node` | `Node` | The AST node to check | -| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | The rule context | +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `CallExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | #### Returns -node is CallExpression - -`true` if the node is a call expression to `createElement` +`boolean` --- @@ -644,6 +701,72 @@ node is JSXFragment --- +### isFromPragma + +▸ **isFromPragma**(`name`): (`node`: `Identifier` \| `MemberExpression`, `context`: `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\>) => `boolean` + +Checks if the given node is a call expression to the given function or method of the pragma + +#### Parameters + +| Name | Type | Description | +| :----- | :------- | :------------------------------------------ | +| `name` | `string` | The name of the function or method to check | + +#### Returns + +`fn` + +A predicate that checks if the given node is a call expression to the given function or method + +▸ (`node`, `context`): `boolean` + +##### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------------ | +| `node` | `Identifier` \| `MemberExpression` | +| `context` | `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\> | + +##### Returns + +`boolean` + +--- + +### isFromPragmaMember + +▸ **isFromPragmaMember**(`pragmaMemberName`, `name`): (`node`: `TSESTree.MemberExpression`, `context`: `RuleContext`, `pragma?`: `string`) => `boolean` + +#### Parameters + +| Name | Type | +| :----------------- | :------- | +| `pragmaMemberName` | `string` | +| `name` | `string` | + +#### Returns + +`fn` + +A function that checks if a given node is a member expression of a Pragma member. + +▸ (`node`, `context`, `pragma?`): `boolean` + +##### Parameters + +| Name | Type | +| :-------- | :-------------------------- | +| `node` | `TSESTree.MemberExpression` | +| `context` | `RuleContext` | +| `pragma?` | `string` | + +##### Returns + +`boolean` + +--- + ### isFunctionReturningJSXValue ▸ **isFunctionReturningJSXValue**(`node`, `context`, `hint?`): `boolean` diff --git a/packages/jsx/package.json b/packages/jsx/package.json index b0c9e79dc..c4fde53be 100644 --- a/packages/jsx/package.json +++ b/packages/jsx/package.json @@ -44,11 +44,12 @@ "dependencies": { "@eslint-react/ast": "workspace:*", "@eslint-react/shared": "workspace:*", + "@eslint-react/third-party": "workspace:*", "@eslint-react/tools": "workspace:*", "@eslint-react/types": "workspace:*", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/utils": "6.14.0", + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/utils": "6.15.0", "micro-memoize": "4.1.2" } } diff --git a/packages/jsx/src/element/api.ts b/packages/jsx/src/element/api.ts new file mode 100644 index 000000000..ab78033b7 --- /dev/null +++ b/packages/jsx/src/element/api.ts @@ -0,0 +1,34 @@ +import { isOneOf, NodeType } from "@eslint-react/ast"; +import type { RuleContext } from "@eslint-react/types"; +import type { TSESTree } from "@typescript-eslint/types"; + +import { isFromPragma } from "../pragma"; + +// workaround for @typescript-eslint/utils's TS2742 error. +type _ = (node: TSESTree.Identifier | TSESTree.MemberExpression, context: RuleContext) => boolean; + +export const isCreateElement: _ = isFromPragma("createElement"); + +export const isCreateElementCall = ( + node: TSESTree.CallExpression, + context: RuleContext, +) => { + if (!isOneOf([NodeType.Identifier, NodeType.MemberExpression])(node.callee)) { + return false; + } + + return isCreateElement(node.callee, context); +}; + +export const isCloneElement: _ = isFromPragma("cloneElement"); + +export const isCloneElementCall = ( + node: TSESTree.CallExpression, + context: RuleContext, +) => { + if (!isOneOf([NodeType.Identifier, NodeType.MemberExpression])(node.callee)) { + return false; + } + + return isCloneElement(node.callee, context); +}; diff --git a/packages/jsx/src/element/hierarchy.ts b/packages/jsx/src/element/hierarchy.ts index 928863918..cafaa109f 100644 --- a/packages/jsx/src/element/hierarchy.ts +++ b/packages/jsx/src/element/hierarchy.ts @@ -3,7 +3,7 @@ import { F, O } from "@eslint-react/tools"; import type { RuleContext } from "@eslint-react/types"; import type { TSESTree } from "@typescript-eslint/types"; -import { isCreateElementCall } from "./is-element-call"; +import { isCreateElementCall } from "./api"; /** * Determines whether inside createElement's props. @@ -13,7 +13,7 @@ import { isCreateElementCall } from "./is-element-call"; */ export function isInsideCreateElementProps(node: TSESTree.Node, context: RuleContext) { return F.pipe( - traverseUp(node, n => isCreateElementCall(n, context)), + traverseUp(node, n => is(NodeType.CallExpression)(n) && isCreateElementCall(n, context)), O.filter(is(NodeType.CallExpression)), O.flatMapNullable(c => c.arguments.at(1)), O.filter(is(NodeType.ObjectExpression)), @@ -23,15 +23,16 @@ export function isInsideCreateElementProps(node: TSESTree.Node, context: RuleCon } export function isChildrenOfCreateElement(node: TSESTree.Node, context: RuleContext) { - const maybeCallExpression = node.parent; - - if (!maybeCallExpression || !isCreateElementCall(maybeCallExpression, context)) { - return false; - } - - return maybeCallExpression.arguments - .slice(2) - .some((child) => child === node); + return F.pipe( + O.fromNullable(node.parent), + O.filter(is(NodeType.CallExpression)), + O.filter(n => isCreateElementCall(n, context)), + O.exists(n => + n.arguments + .slice(2) + .some(arg => arg === node) + ), + ); } /** diff --git a/packages/jsx/src/element/index.ts b/packages/jsx/src/element/index.ts index cf3b67c42..90c7e2433 100644 --- a/packages/jsx/src/element/index.ts +++ b/packages/jsx/src/element/index.ts @@ -1,4 +1,4 @@ +export * from "./api"; export * from "./element-type"; export * from "./hierarchy"; export * from "./is-element"; -export * from "./is-element-call"; diff --git a/packages/jsx/src/element/is-element-call.ts b/packages/jsx/src/element/is-element-call.ts deleted file mode 100644 index 42774f541..000000000 --- a/packages/jsx/src/element/is-element-call.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { type CallFromPragmaPredicate, isCallFromPragma } from "../pragma"; - -/** - * Checks if the given node is a call expression to `createElement` - * @param node The AST node to check - * @param context The rule context - * @returns `true` if the node is a call expression to `createElement` - */ -export const isCreateElementCall: CallFromPragmaPredicate = isCallFromPragma("createElement"); - -/** - * Checks if the given node is a call expression to `cloneElement` - * @param node The AST node to check - * @param context The rule context - * @returns `true` if the node is a call expression to `cloneElement` - */ -export const isCloneElementCall: CallFromPragmaPredicate = isCallFromPragma("cloneElement"); diff --git a/packages/jsx/src/pragma/get-pragma.ts b/packages/jsx/src/pragma/get-pragma.ts index d0d488b72..f13f8274f 100644 --- a/packages/jsx/src/pragma/get-pragma.ts +++ b/packages/jsx/src/pragma/get-pragma.ts @@ -1,5 +1,5 @@ import { ESLintSettingsSchema, parse } from "@eslint-react/shared"; -import { F, O, P } from "@eslint-react/tools"; +import { _, F, O } from "@eslint-react/tools"; import type { RuleContext } from "@eslint-react/types"; import memo from "micro-memoize"; @@ -11,7 +11,7 @@ export function getFragmentFromContext(context: T) { const settings = parse(ESLintSettingsSchema, context.settings); const fragment = settings.eslintReact?.jsx?.fragment; - if (P.isString(fragment) && RE_JS_IDENTIFIER_REGEX.test(fragment)) { + if (_.isString(fragment) && RE_JS_IDENTIFIER_REGEX.test(fragment)) { return fragment; } diff --git a/packages/jsx/src/pragma/is-from-pragma.ts b/packages/jsx/src/pragma/is-from-pragma.ts index ee912d154..9e52c0a47 100644 --- a/packages/jsx/src/pragma/is-from-pragma.ts +++ b/packages/jsx/src/pragma/is-from-pragma.ts @@ -1,8 +1,9 @@ -import { findVariableByName, getVariablesUpToGlobal, NodeType } from "@eslint-react/ast"; -import { M, O } from "@eslint-react/tools"; +import { findVariableByName, getVariablesUpToGlobal, is, isOneOf, NodeType } from "@eslint-react/ast"; +import { O } from "@eslint-react/tools"; import type { RuleContext } from "@eslint-react/types"; import type { Scope } from "@typescript-eslint/scope-manager"; import type { TSESTree } from "@typescript-eslint/types"; +import { isMatching, match } from "ts-pattern"; import { getPragmaFromContext } from "./get-pragma"; @@ -27,17 +28,17 @@ export function isInitializedFromPragma( const { init } = node; // check for: `variable = pragma.variable` - if (M.isMatching({ type: "MemberExpression", object: { type: "Identifier", name: pragma } }, init)) { + if (isMatching({ type: "MemberExpression", object: { type: "Identifier", name: pragma } }, init)) { return true; } // check for: `{ variable } = pragma` - if (M.isMatching({ type: "Identifier", name: pragma }, init)) { + if (isMatching({ type: "Identifier", name: pragma }, init)) { return true; } // check if from a require call: `require("react")` - const maybeRequireExpression = M.match(init) + const maybeRequireExpression = match(init) .with({ type: NodeType.CallExpression, callee: { type: NodeType.Identifier, name: "require" }, @@ -66,11 +67,11 @@ export function isInitializedFromPragma( } // latest definition is an import declaration: import { variable } from 'react' - return M.isMatching({ type: "ImportDeclaration", source: { value: pragma.toLowerCase() } }, parent); + return isMatching({ type: "ImportDeclaration", source: { value: pragma.toLowerCase() } }, parent); } export function isPropertyOfPragma(name: string, context: RuleContext, pragma = getPragmaFromContext(context)) { - const isMatch: (node: TSESTree.Node) => boolean = M.isMatching({ + const isMatch: (node: TSESTree.Node) => boolean = isMatching({ type: NodeType.MemberExpression, object: { type: NodeType.Identifier, @@ -94,21 +95,87 @@ export type CallFromPragmaPredicate = ( * @param name The name of the function or method to check * @returns A predicate that checks if the given node is a call expression to the given function or method */ -export function isCallFromPragma(name: string) { - return (node: TSESTree.Node, context: RuleContext): node is TSESTree.CallExpression => { +export function isFromPragma(name: string) { + return ( + node: TSESTree.Identifier | TSESTree.MemberExpression, + context: RuleContext, + ) => { const initialScope = context.sourceCode.getScope?.(node) ?? context.getScope(); - if (node.type !== NodeType.CallExpression || !("callee" in node)) { + if (node.type === NodeType.MemberExpression) { + return isPropertyOfPragma(name, context)(node); + } + + if (node.name === name) { + return isInitializedFromPragma(name, context, initialScope); + } + + return false; + }; +} + +/** + * @internal + * @param pragmaMemberName + * @param name + * @returns A function that checks if a given node is a member expression of a Pragma member. + */ +export function isFromPragmaMember( + pragmaMemberName: string, + name: string, +): (node: TSESTree.MemberExpression, context: RuleContext, pragma?: string) => boolean { + return ( + node: TSESTree.MemberExpression, + context: RuleContext, + pragma = getPragmaFromContext(context), + ) => { + const initialScope = context.sourceCode.getScope?.(node) ?? context.getScope(); + + if ( + node.property.type !== NodeType.Identifier + || node.property.name !== name + ) { return false; } - if (node.callee.type === NodeType.MemberExpression) { - return isPropertyOfPragma(name, context)(node.callee); + if ( + node.object.type === NodeType.Identifier + && node.object.name === pragmaMemberName + ) { + return isInitializedFromPragma(node.object.name, context, initialScope, pragma); } - if ("name" in node.callee && node.callee.name === name) { - return isInitializedFromPragma(name, context, initialScope); + if ( + node.object.type === NodeType.MemberExpression + && node.object.object.type === NodeType.Identifier + && node.object.object.name === pragma + && node.object.property.type === NodeType.Identifier + ) { + return node.object.property.name === pragmaMemberName; } return false; }; } + +export function isCallFromPragma(name: string) { + return (node: TSESTree.CallExpression, context: RuleContext) => { + if (!isOneOf([NodeType.Identifier, NodeType.MemberExpression])(node.callee)) { + return false; + } + + return isFromPragma(name)(node.callee, context); + }; +} + +export function isCallFromPragmaMember( + pragmaMemberName: string, + name: string, +) { + return (node: TSESTree.CallExpression, context: RuleContext) => { + if (!is(NodeType.MemberExpression)(node.callee)) { + return false; + } + + return isFromPragmaMember(pragmaMemberName, name)(node.callee, context); + }; +} diff --git a/packages/jsx/src/prop/get-prop.ts b/packages/jsx/src/prop/get-prop.ts index e687ef695..1a703e561 100644 --- a/packages/jsx/src/prop/get-prop.ts +++ b/packages/jsx/src/prop/get-prop.ts @@ -1,8 +1,11 @@ -import { findVariableByNameUpToGlobal, getStaticValue, getVariableInit, is, NodeType } from "@eslint-react/ast"; -import { F, M, O } from "@eslint-react/tools"; +import { findVariableByNameUpToGlobal, getVariableInit, is, NodeType } from "@eslint-react/ast"; +import { ESLintCommunityESLintUtils } from "@eslint-react/third-party"; +import { F, O } from "@eslint-react/tools"; import type { RuleContext } from "@eslint-react/types"; import type { Scope } from "@typescript-eslint/scope-manager"; import type { ESLintUtils, TSESTree } from "@typescript-eslint/utils"; +import { match } from "ts-pattern"; +const { getStaticValue } = ESLintCommunityESLintUtils; /** * Get the name of a JSX attribute with namespace @@ -10,7 +13,7 @@ import type { ESLintUtils, TSESTree } from "@typescript-eslint/utils"; * @returns string */ export function getPropName(node: TSESTree.JSXAttribute) { - return M.match(node.name) + return match(node.name) .when(is(NodeType.JSXIdentifier), (n) => n.name) .when(is(NodeType.JSXNamespacedName), (n) => `${n.namespace.name}:${n.name.name}`) .exhaustive(); @@ -76,12 +79,12 @@ export function findPropInProperties( return (propName: string): O.Option<(typeof properties)[number]> => { return O.fromNullable( properties.find((prop) => { - return M.match(prop) + return match(prop) .when(is(NodeType.Property), (prop) => { return "name" in prop.key && prop.key.name === propName; }) .when(is(NodeType.SpreadElement), (prop) => { - return M.match(prop.argument) + return match(prop.argument) .when(is(NodeType.Identifier), (argument) => { const { name } = argument; const maybeInit = O.flatMap( @@ -145,10 +148,10 @@ export function findPropInAttributes( return (propName: string) => { return O.fromNullable( attributes.find((attr) => { - return M.match(attr) + return match(attr) .when(is(NodeType.JSXAttribute), (attr) => getPropName(attr) === propName) .when(is(NodeType.JSXSpreadAttribute), (attr) => { - return M.match(attr.argument) + return match(attr.argument) .with({ type: NodeType.Identifier }, (argument) => { const { name } = argument; const maybeInit = O.flatMap( diff --git a/packages/jsx/src/textnode.ts b/packages/jsx/src/textnode.ts index 6ab8a579d..d596f1276 100644 --- a/packages/jsx/src/textnode.ts +++ b/packages/jsx/src/textnode.ts @@ -1,5 +1,5 @@ import { isMultiLine, isOneOf, NodeType } from "@eslint-react/ast"; -import { P } from "@eslint-react/tools"; +import { _ } from "@eslint-react/tools"; import type { TSESTree } from "@typescript-eslint/types"; /** @@ -15,7 +15,7 @@ export const isLiteral = isOneOf([NodeType.Literal, NodeType.JSXText]); * @returns boolean `true` if the node is whitespace */ export function isWhiteSpace(node: TSESTree.JSXText | TSESTree.Literal) { - return P.isString(node.value) && node.value.trim() === ""; + return _.isString(node.value) && node.value.trim() === ""; } /** diff --git a/packages/jsx/src/value/is-jsx-value.ts b/packages/jsx/src/value/is-jsx-value.ts index 717723405..1a37a0d71 100644 --- a/packages/jsx/src/value/is-jsx-value.ts +++ b/packages/jsx/src/value/is-jsx-value.ts @@ -1,7 +1,8 @@ import { findVariableByNameUpToGlobal, getVariableInit, isJSXTagNameExpression, NodeType } from "@eslint-react/ast"; -import { F, M, O } from "@eslint-react/tools"; +import { F, O } from "@eslint-react/tools"; import type { RuleContext } from "@eslint-react/types"; import { type TSESTree } from "@typescript-eslint/utils"; +import { match, P } from "ts-pattern"; import { isCreateElementCall } from "../element"; @@ -53,17 +54,17 @@ export function isJSXValue( return false; } - return M.match(node) + return match(node) .with({ type: NodeType.JSXElement }, F.constTrue) .with({ type: NodeType.JSXFragment }, F.constTrue) .with({ type: NodeType.JSXMemberExpression }, F.constTrue) .with({ type: NodeType.JSXNamespacedName }, F.constTrue) .with({ type: NodeType.Literal }, (node) => { - return M.match(node.value) + return match(node.value) .with(null, () => !(hint & JSXValueCheckHint.SkipNullLiteral)) - .with(M.P.boolean, () => !(hint & JSXValueCheckHint.SkipBooleanLiteral)) - .with(M.P.string, () => !(hint & JSXValueCheckHint.SkipStringLiteral)) - .with(M.P.number, () => !(hint & JSXValueCheckHint.SkipNumberLiteral)) + .with(P.boolean, () => !(hint & JSXValueCheckHint.SkipBooleanLiteral)) + .with(P.string, () => !(hint & JSXValueCheckHint.SkipStringLiteral)) + .with(P.number, () => !(hint & JSXValueCheckHint.SkipNumberLiteral)) .otherwise(F.constFalse); }) .with({ type: NodeType.TemplateLiteral }, () => { diff --git a/packages/shared/package.json b/packages/shared/package.json index 45f0b4b26..d0572b5c1 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -42,13 +42,9 @@ "publish": "pnpm run build && pnpm run lint:publish" }, "dependencies": { - "@eslint-react/tools": "workspace:*", - "@eslint-react/types": "workspace:*", - "@typescript-eslint/utils": "6.14.0", - "dedent": "1.5.1", - "deepmerge-ts": "5.1.0", - "short-unique-id": "5.0.3", - "tslib": "2.6.2", "valibot": "0.24.1" + }, + "devDependencies": { + "type-fest": "4.8.3" } } diff --git a/packages/shared/tsconfig.json b/packages/shared/tsconfig.json index a0b43515f..425388bf9 100644 --- a/packages/shared/tsconfig.json +++ b/packages/shared/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base.json", "include": [ - "src" + "src", + "../third-party/src/case-validator" ] } diff --git a/packages/third-party/README.md b/packages/third-party/README.md new file mode 100644 index 000000000..2c07c076c --- /dev/null +++ b/packages/third-party/README.md @@ -0,0 +1,10 @@ +# `@eslint-react/tools` + +> ESLint React's std library and primitives. + +## ✋ Internal Package + +This is an internal package to the [ESLint React monorepo](https://github.com/Rel1cx/eslint-react). +You likely don't want to use it directly. + +👉 See **** for docs on ESLint React. diff --git a/packages/third-party/docs/.nojekyll b/packages/third-party/docs/.nojekyll new file mode 100644 index 000000000..e2ac6616a --- /dev/null +++ b/packages/third-party/docs/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/packages/third-party/docs/README.md b/packages/third-party/docs/README.md new file mode 100644 index 000000000..8a6ddc1c4 --- /dev/null +++ b/packages/third-party/docs/README.md @@ -0,0 +1,10 @@ +@eslint-react/third-party + +# @eslint-react/third-party + +## Table of contents + +### Namespaces + +- [ESLintCommunityESLintUtils](modules/ESLintCommunityESLintUtils.md) +- [ESLintPluginFilenamesSimple](modules/ESLintPluginFilenamesSimple.md) diff --git a/packages/third-party/docs/modules/ESLintCommunityESLintUtils.md b/packages/third-party/docs/modules/ESLintCommunityESLintUtils.md new file mode 100644 index 000000000..444f58bb8 --- /dev/null +++ b/packages/third-party/docs/modules/ESLintCommunityESLintUtils.md @@ -0,0 +1,228 @@ +[@eslint-react/third-party](../README.md) / ESLintCommunityESLintUtils + +# Namespace: ESLintCommunityESLintUtils + +## Table of contents + +### Functions + +- [getFunctionHeadLocation](ESLintCommunityESLintUtils.md#getfunctionheadlocation) +- [getFunctionNameWithKind](ESLintCommunityESLintUtils.md#getfunctionnamewithkind) +- [getPropertyName](ESLintCommunityESLintUtils.md#getpropertyname) +- [getStaticValue](ESLintCommunityESLintUtils.md#getstaticvalue) +- [getStringIfConstant](ESLintCommunityESLintUtils.md#getstringifconstant) +- [hasSideEffect](ESLintCommunityESLintUtils.md#hassideeffect) +- [isParenthesized](ESLintCommunityESLintUtils.md#isparenthesized) + +## Functions + +### getFunctionHeadLocation + +▸ **getFunctionHeadLocation**(`node`, `sourceCode`): `SourceLocation` + +Get the proper location of a given function node to report. + +#### Parameters + +| Name | Type | +| :----------- | :------------------------------------------------------------------------- | +| `node` | `ArrowFunctionExpression` \| `FunctionDeclaration` \| `FunctionExpression` | +| `sourceCode` | `SourceCode` | + +#### Returns + +`SourceLocation` + +**`See`** + +[https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionheadlocation](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionheadlocation) + +--- + +### getFunctionNameWithKind + +▸ **getFunctionNameWithKind**(`node`, `sourceCode?`): `string` + +Get the name and kind of a given function node. + +#### Parameters + +| Name | Type | +| :------------ | :------------------------------------------------------------------------- | +| `node` | `ArrowFunctionExpression` \| `FunctionDeclaration` \| `FunctionExpression` | +| `sourceCode?` | `SourceCode` | + +#### Returns + +`string` + +**`See`** + +[https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionnamewithkind](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionnamewithkind) + +--- + +### getPropertyName + +▸ **getPropertyName**(`node`, `initialScope?`): `null` \| `string` + +Get the property name of a given property node. +If the node is a computed property, this tries to compute the property name by the getStringIfConstant function. + +#### Parameters + +| Name | Type | +| :-------------- | :----------------------------------------------------------------------------- | +| `node` | `MemberExpression` \| `MethodDefinition` \| `Property` \| `PropertyDefinition` | +| `initialScope?` | `Scope` | + +#### Returns + +`null` \| `string` + +The property name of the node. If the property name is not constant then it returns `null`. + +**`See`** + +[https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getpropertyname](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getpropertyname) + +--- + +### getStaticValue + +▸ **getStaticValue**(`node`, `initialScope?`): `null` \| \{ `value`: `unknown` } + +Get the value of a given node if it can decide the value statically. +If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the +given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have +not been modified. +For example, it considers `Symbol.iterator`, `String.raw`hello``, and `Object.freeze({a: 1}).a` as static. + +#### Parameters + +| Name | Type | +| :-------------- | :------ | +| `node` | `Node` | +| `initialScope?` | `Scope` | + +#### Returns + +`null` \| \{ `value`: `unknown` } + +The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the +static value of the node, it returns `null`. + +**`See`** + +[https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue) + +--- + +### getStringIfConstant + +▸ **getStringIfConstant**(`node`, `initialScope?`): `null` \| `string` + +Get the string value of a given node. +This function is a tiny wrapper of the getStaticValue function. + +#### Parameters + +| Name | Type | +| :-------------- | :------ | +| `node` | `Node` | +| `initialScope?` | `Scope` | + +#### Returns + +`null` \| `string` + +**`See`** + +[https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstringifconstant](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstringifconstant) + +--- + +### hasSideEffect + +▸ **hasSideEffect**(`node`, `sourceCode`, `options?`): `boolean` + +Check whether a given node has any side effect or not. +The side effect means that it may modify a certain variable or object member. This function considers the node which +contains the following types as the node which has side effects: + +- `AssignmentExpression` +- `AwaitExpression` +- `CallExpression` +- `ImportExpression` +- `NewExpression` +- `UnaryExpression([operator = "delete"])` +- `UpdateExpression` +- `YieldExpression` +- When `options.considerGetters` is `true`: +- `MemberExpression` +- When `options.considerImplicitTypeConversion` is `true`: +- `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])` +- `MemberExpression([computed = true])` +- `MethodDefinition([computed = true])` +- `Property([computed = true])` +- `UnaryExpression([operator = "-" | "+" | "!" | "~"])` + +#### Parameters + +| Name | Type | +| :---------------------------------------- | :----------- | +| `node` | `Node` | +| `sourceCode` | `SourceCode` | +| `options?` | `Object` | +| `options.considerGetters?` | `boolean` | +| `options.considerImplicitTypeConversion?` | `boolean` | + +#### Returns + +`boolean` + +**`See`** + +[https://eslint-community.github.io/eslint-utils/api/ast-utils.html#hassideeffect](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#hassideeffect) + +--- + +### isParenthesized + +▸ **isParenthesized**(`node`, `sourceCode`): `boolean` + +Check whether a given node is parenthesized or not. +This function detects it correctly even if it's parenthesized by specific syntax. + +#### Parameters + +| Name | Type | +| :----------- | :----------- | +| `node` | `Node` | +| `sourceCode` | `SourceCode` | + +#### Returns + +`boolean` + +`true` if the node is parenthesized. +If `times` was given, it returns `true` only if the node is parenthesized the `times` times. +For example, `isParenthesized(2, node, sourceCode)` returns true for `((foo))`, but not for `(foo)`. + +**`See`** + +[https://eslint-community.github.io/eslint-utils/api/ast-utils.html#isparenthesized](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#isparenthesized) + +▸ **isParenthesized**(`times`, `node`, `sourceCode`): `boolean` + +#### Parameters + +| Name | Type | +| :----------- | :----------- | +| `times` | `number` | +| `node` | `Node` | +| `sourceCode` | `SourceCode` | + +#### Returns + +`boolean` diff --git a/packages/third-party/docs/modules/ESLintPluginFilenamesSimple.md b/packages/third-party/docs/modules/ESLintPluginFilenamesSimple.md new file mode 100644 index 000000000..cf925ee59 --- /dev/null +++ b/packages/third-party/docs/modules/ESLintPluginFilenamesSimple.md @@ -0,0 +1,26 @@ +[@eslint-react/third-party](../README.md) / ESLintPluginFilenamesSimple + +# Namespace: ESLintPluginFilenamesSimple + +## Table of contents + +### Functions + +- [getCaseValidator](ESLintPluginFilenamesSimple.md#getcasevalidator) + +## Functions + +### getCaseValidator + +▸ **getCaseValidator**(`ruleName`, `ignorePattern?`): `CaseValidator` + +#### Parameters + +| Name | Type | Default value | +| :-------------- | :--------- | :------------ | +| `ruleName` | `string` | `undefined` | +| `ignorePattern` | `string`[] | `[]` | + +#### Returns + +`CaseValidator` diff --git a/packages/third-party/package.json b/packages/third-party/package.json new file mode 100644 index 000000000..081daf04a --- /dev/null +++ b/packages/third-party/package.json @@ -0,0 +1,50 @@ +{ + "name": "@eslint-react/third-party", + "version": "0.9.8-beta.0", + "description": "Third-party utilities maintained in the ESLint React's monorepo", + "homepage": "https://github.com/rel1cx/eslint-react", + "bugs": { + "url": "https://github.com/rel1cx/eslint-react/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/Rel1cx/eslint-react", + "directory": "packages/third-party" + }, + "license": "MIT", + "author": "Eva1ent", + "sideEffects": false, + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + }, + "./package.json": "./package.json" + }, + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "files": [ + "dist", + "./package.json" + ], + "scripts": { + "build": "rollup -c rollup.config.ts --configPlugin swc3 && cp dist/index.d.ts dist/index.d.mts", + "build:docs": "typedoc && dprint fmt ./docs/**/*.md", + "lint:publish": "publint", + "lint:type": "tsc --noEmit", + "publish": "pnpm run build && pnpm run lint:publish" + }, + "dependencies": { + "@eslint-community/eslint-utils": "4.4.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/utils": "6.15.0", + "tslib": "2.6.2" + } +} diff --git a/packages/third-party/rollup.config.ts b/packages/third-party/rollup.config.ts new file mode 100644 index 000000000..0895fb906 --- /dev/null +++ b/packages/third-party/rollup.config.ts @@ -0,0 +1,43 @@ +import { nodeResolve } from "@rollup/plugin-node-resolve"; +import { createRequire } from "module"; +import { defineConfig } from "rollup"; +import { dts } from "rollup-plugin-dts"; +import { swc } from "rollup-plugin-swc3"; +import { visualizer } from "rollup-plugin-visualizer"; +const require = createRequire(import.meta.url); +const packageJson = require("./package.json"); +const external = Object.keys(packageJson.dependencies); + +export default defineConfig([{ + external, + input: "src/index.ts", + output: [ + { file: "dist/index.cjs", format: "cjs" }, + { file: "dist/index.js", format: "cjs" }, + { file: "dist/index.mjs", format: "esm" }, + ], + plugins: [ + nodeResolve(), + swc({ + jsc: { + minify: { + compress: false, + mangle: false, + module: true, + }, + target: "es2021", + }, + minify: false, + }), + visualizer(), + ], +}, { + external, + input: "src/index.ts", + output: { + file: "dist/index.d.ts", + }, + plugins: [ + dts(), + ], +}]); diff --git a/packages/third-party/src/eslint-community-eslint-utils/index.ts b/packages/third-party/src/eslint-community-eslint-utils/index.ts new file mode 100644 index 000000000..65b7671a5 --- /dev/null +++ b/packages/third-party/src/eslint-community-eslint-utils/index.ts @@ -0,0 +1,121 @@ +/* eslint-disable no-restricted-syntax */ +/* eslint-disable @susisu/safe-typescript/no-type-assertion */ +// Ported from https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/utils/src/ast-utils/eslint-utils/astUtilities.ts + +import * as eslintUtils from "@eslint-community/eslint-utils"; +import type { TSESTree } from "@typescript-eslint/types"; +import type { TSESLint } from "@typescript-eslint/utils"; + +export namespace ESLintCommunityESLintUtils { + /** + * Get the proper location of a given function node to report. + * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionheadlocation} + */ + export const getFunctionHeadLocation = eslintUtils.getFunctionHeadLocation as ( + node: + | TSESTree.ArrowFunctionExpression + | TSESTree.FunctionDeclaration + | TSESTree.FunctionExpression, + sourceCode: TSESLint.SourceCode, + ) => TSESTree.SourceLocation; + + /** + * Get the name and kind of a given function node. + * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionnamewithkind} + */ + export const getFunctionNameWithKind = eslintUtils.getFunctionNameWithKind as ( + node: + | TSESTree.ArrowFunctionExpression + | TSESTree.FunctionDeclaration + | TSESTree.FunctionExpression, + sourceCode?: TSESLint.SourceCode, + ) => string; + + /** + * Get the property name of a given property node. + * If the node is a computed property, this tries to compute the property name by the getStringIfConstant function. + * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getpropertyname} + * @returns The property name of the node. If the property name is not constant then it returns `null`. + */ + export const getPropertyName = eslintUtils.getPropertyName as ( + node: + | TSESTree.MemberExpression + | TSESTree.MethodDefinition + | TSESTree.Property + | TSESTree.PropertyDefinition, + initialScope?: TSESLint.Scope.Scope, + ) => null | string; + + /** + * Get the value of a given node if it can decide the value statically. + * If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the + * given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have + * not been modified. + * For example, it considers `Symbol.iterator`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static. + * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue} + * @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the + * static value of the node, it returns `null`. + */ + export const getStaticValue = eslintUtils.getStaticValue as ( + node: TSESTree.Node, + initialScope?: TSESLint.Scope.Scope, + ) => { value: unknown } | null; + + /** + * Get the string value of a given node. + * This function is a tiny wrapper of the getStaticValue function. + * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstringifconstant} + */ + export const getStringIfConstant = eslintUtils.getStringIfConstant as ( + node: TSESTree.Node, + initialScope?: TSESLint.Scope.Scope, + ) => null | string; + + /** + * Check whether a given node has any side effect or not. + * The side effect means that it may modify a certain variable or object member. This function considers the node which + * contains the following types as the node which has side effects: + * - `AssignmentExpression` + * - `AwaitExpression` + * - `CallExpression` + * - `ImportExpression` + * - `NewExpression` + * - `UnaryExpression([operator = "delete"])` + * - `UpdateExpression` + * - `YieldExpression` + * - When `options.considerGetters` is `true`: + * - `MemberExpression` + * - When `options.considerImplicitTypeConversion` is `true`: + * - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])` + * - `MemberExpression([computed = true])` + * - `MethodDefinition([computed = true])` + * - `Property([computed = true])` + * - `UnaryExpression([operator = "-" | "+" | "!" | "~"])` + * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#hassideeffect} + */ + export const hasSideEffect = eslintUtils.hasSideEffect as ( + node: TSESTree.Node, + sourceCode: TSESLint.SourceCode, + options?: { + considerGetters?: boolean; + considerImplicitTypeConversion?: boolean; + }, + ) => boolean; + + export const isParenthesized = eslintUtils.isParenthesized as { + /** + * Check whether a given node is parenthesized or not. + * This function detects it correctly even if it's parenthesized by specific syntax. + * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#isparenthesized} + * @returns `true` if the node is parenthesized. + * If `times` was given, it returns `true` only if the node is parenthesized the `times` times. + * For example, `isParenthesized(2, node, sourceCode)` returns true for `((foo))`, but not for `(foo)`. + */ + (node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean; + ( + times: number, + node: TSESTree.Node, + sourceCode: TSESLint.SourceCode, + ): boolean; + }; +} diff --git a/packages/utils/src/case-validator/case-validator.ts b/packages/third-party/src/eslint-plugin-filenames-simple/case-validator/case-validator.ts similarity index 100% rename from packages/utils/src/case-validator/case-validator.ts rename to packages/third-party/src/eslint-plugin-filenames-simple/case-validator/case-validator.ts diff --git a/packages/utils/src/case-validator/index.ts b/packages/third-party/src/eslint-plugin-filenames-simple/case-validator/index.ts similarity index 100% rename from packages/utils/src/case-validator/index.ts rename to packages/third-party/src/eslint-plugin-filenames-simple/case-validator/index.ts diff --git a/packages/utils/src/case-validator/preset-rules.ts b/packages/third-party/src/eslint-plugin-filenames-simple/case-validator/preset-rules.ts similarity index 100% rename from packages/utils/src/case-validator/preset-rules.ts rename to packages/third-party/src/eslint-plugin-filenames-simple/case-validator/preset-rules.ts diff --git a/packages/utils/src/case-validator/split-name.ts b/packages/third-party/src/eslint-plugin-filenames-simple/case-validator/split-name.ts similarity index 100% rename from packages/utils/src/case-validator/split-name.ts rename to packages/third-party/src/eslint-plugin-filenames-simple/case-validator/split-name.ts diff --git a/packages/third-party/src/eslint-plugin-filenames-simple/index.ts b/packages/third-party/src/eslint-plugin-filenames-simple/index.ts new file mode 100644 index 000000000..1f9f2140b --- /dev/null +++ b/packages/third-party/src/eslint-plugin-filenames-simple/index.ts @@ -0,0 +1,5 @@ +import * as caseValidator from "./case-validator"; + +export namespace ESLintPluginFilenamesSimple { + export const { getCaseValidator } = caseValidator; +} diff --git a/packages/third-party/src/index.ts b/packages/third-party/src/index.ts new file mode 100644 index 000000000..b799860d1 --- /dev/null +++ b/packages/third-party/src/index.ts @@ -0,0 +1,2 @@ +export * from "./eslint-community-eslint-utils"; +export * from "./eslint-plugin-filenames-simple"; diff --git a/packages/utils/tsconfig.json b/packages/third-party/tsconfig.json similarity index 71% rename from packages/utils/tsconfig.json rename to packages/third-party/tsconfig.json index a0b43515f..5858a6fa3 100644 --- a/packages/utils/tsconfig.json +++ b/packages/third-party/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base.json", "include": [ - "src" + "src", + "typings" ] } diff --git a/packages/utils/typedoc.json b/packages/third-party/typedoc.json similarity index 74% rename from packages/utils/typedoc.json rename to packages/third-party/typedoc.json index ba9ee8002..0a37a3861 100644 --- a/packages/utils/typedoc.json +++ b/packages/third-party/typedoc.json @@ -2,7 +2,7 @@ "extends": [ "../../typedoc.base.json" ], - "name": "@eslint-react/shared", + "name": "@eslint-react/third-party", "entryPoints": [ "src/index.ts" ], diff --git a/packages/ast/typings/eslint-community-eslint-utils.d.ts b/packages/third-party/typings/eslint-community-eslint-utils.d.ts similarity index 100% rename from packages/ast/typings/eslint-community-eslint-utils.d.ts rename to packages/third-party/typings/eslint-community-eslint-utils.d.ts diff --git a/packages/tools/docs/README.md b/packages/tools/docs/README.md index b84eb6bf0..cc263a9aa 100644 --- a/packages/tools/docs/README.md +++ b/packages/tools/docs/README.md @@ -7,976 +7,16 @@ ### Namespaces - [Array](modules/Array.md) -- [Chunk](modules/Chunk.md) - [Data](modules/Data.md) - [E](modules/E.md) - [Equal](modules/Equal.md) - [F](modules/F.md) +- [Helper](modules/Helper.md) - [List](modules/List.md) -- [M](modules/M.md) - [MutList](modules/MutList.md) - [MutRef](modules/MutRef.md) - [O](modules/O.md) - [Ord](modules/Ord.md) -- [P](modules/P.md) - [Record](modules/Record.md) - [Ref](modules/Ref.md) - -### Type Aliases - -- [ArrayElement](README.md#arrayelement) -- [Assume](README.md#assume) -- [Cast](README.md#cast) -- [Combine](README.md#combine) -- [DeepWriteable](README.md#deepwriteable) -- [Defined](README.md#defined) -- [FieldDiff](README.md#fielddiff) -- [FromEntries](README.md#fromentries) -- [FromEntriesWithReadOnly](README.md#fromentrieswithreadonly) -- [Guard](README.md#guard) -- [GuardRecord](README.md#guardrecord) -- [GuardReturnType](README.md#guardreturntype) -- [KeyGuard](README.md#keyguard) -- [LazyGuardRecord](README.md#lazyguardrecord) -- [LooseRecord](README.md#looserecord) -- [Narrow](README.md#narrow) -- [Pretty](README.md#pretty) -- [Remap](README.md#remap) -- [UnionFromTuple](README.md#unionfromtuple) -- [UnionToIntersection](README.md#uniontointersection) - -### Functions - -- [asConst](README.md#asconst) -- [entries](README.md#entries) -- [fromEntries](README.md#fromentries-1) -- [fromEntriesWithReadOnly](README.md#fromentrieswithreadonly-1) -- [identity](README.md#identity) -- [isKindObjectLazy](README.md#iskindobjectlazy) -- [isKindOfArray](README.md#iskindofarray) -- [isKindOfObject](README.md#iskindofobject) -- [isKindOfOptional](README.md#iskindofoptional) -- [isKindOfRecord](README.md#iskindofrecord) -- [isKindOfTuple](README.md#iskindoftuple) -- [isKindOfUnion](README.md#iskindofunion) -- [keys](README.md#keys) -- [narrow](README.md#narrow-1) -- [noop](README.md#noop) -- [uniqueBy](README.md#uniqueby) -- [values](README.md#values) - -## Type Aliases - -### ArrayElement - -Ƭ **ArrayElement**\<`A`\>: `A` extends readonly infer T[] ? `T` : `never` - -Returns the element type of an array. - -**`Since`** - -0.4.0 - -**`Template`** - -type of the array elements. - -**`Param`** - -The array to get the element type from. - -#### Type parameters - -| Name | -| :--- | -| `A` | - ---- - -### Assume - -Ƭ **Assume**\<`T`, `U`\>: `T` extends `U` ? `T` : `never` - -**`Since`** - -0.9.0 - -#### Type parameters - -| Name | -| :--- | -| `T` | -| `U` | - ---- - -### Cast - -Ƭ **Cast**\<`X`, `Y`\>: `X` extends `Y` ? `X` : `Y` - -**`Since`** - -0.4.0 - -#### Type parameters - -| Name | -| :--- | -| `X` | -| `Y` | - ---- - -### Combine - -Ƭ **Combine**\<`T1`, `T2`\>: [`Pretty`](README.md#pretty)\<\{ [K in keyof (T1 \| T2)]: T1[K] \| T2[K] } & `Partial`\<`T1` & `T2`\>\> - -**`Since`** - -0.3.4 - -#### Type parameters - -| Name | -| :--- | -| `T1` | -| `T2` | - ---- - -### DeepWriteable - -Ƭ **DeepWriteable**\<`T`\>: \{ -readonly [P in keyof T]: DeepWriteable\ } - -#### Type parameters - -| Name | -| :--- | -| `T` | - ---- - -### Defined - -Ƭ **Defined**\<`T`\>: `T` extends `undefined` ? `never` : `T` - -**`Since`** - -0.9.0 - -#### Type parameters - -| Name | -| :--- | -| `T` | - ---- - -### FieldDiff - -Ƭ **FieldDiff**\<`T1`, `T2`\>: `Omit`\<`T1`, keyof `T2`\> \| `Omit`\<`T2`, keyof `T1`\> - -**`Since`** - -0.3.4 - -#### Type parameters - -| Name | -| :--- | -| `T1` | -| `T2` | - ---- - -### FromEntries - -Ƭ **FromEntries**\<`T`\>: `T` extends [infer Key, `unknown`][] ? \{ [K in Cast\]: Extract\, [K, unknown]\>[1] } : \{ [key in string]: unknown } - -#### Type parameters - -| Name | -| :--- | -| `T` | - ---- - -### FromEntriesWithReadOnly - -Ƭ **FromEntriesWithReadOnly**\<`T`\>: [`FromEntries`](README.md#fromentries)\<[`DeepWriteable`](README.md#deepwriteable)\<`T`\>\> - -#### Type parameters - -| Name | -| :--- | -| `T` | - ---- - -### Guard - -Ƭ **Guard**\<`T`\>: (`x`: `unknown`) => x is T - -#### Type parameters - -| Name | Type | -| :--- | :-------- | -| `T` | `unknown` | - -#### Type declaration - -▸ (`x`): x is T - -##### Parameters - -| Name | Type | -| :--- | :-------- | -| `x` | `unknown` | - -##### Returns - -x is T - -**`Since`** - -0.9.0 - ---- - -### GuardRecord - -Ƭ **GuardRecord**: `Record`\<`PropertyKey`, [`Guard`](README.md#guard)\> - -**`Since`** - -0.9.0 - ---- - -### GuardReturnType - -Ƭ **GuardReturnType**\<`T`\>: `T` extends [`Guard`](README.md#guard)\ ? `U` : `never` - -**`Since`** - -0.9.0 - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------- | -| `T` | extends [`Guard`](README.md#guard) | - ---- - -### KeyGuard - -Ƭ **KeyGuard**: [`Guard`](README.md#guard)\<`number` \| `string` \| `symbol`\> - -**`Since`** - -0.9.0 - ---- - -### LazyGuardRecord - -Ƭ **LazyGuardRecord**: `Record`\<`PropertyKey`, () => [`Guard`](README.md#guard)\> - -**`Since`** - -0.9.0 - ---- - -### LooseRecord - -Ƭ **LooseRecord**\<`T`\>: `Record`\<`PropertyKey`, `T`\> - -A record with loose keys. - -**`Since`** - -0.4.0 - -#### Type parameters - -| Name | Description | -| :--- | :---------------------- | -| `T` | The type of the values. | - ---- - -### Narrow - -Ƭ **Narrow**\<`TType`\>: \{ [K in keyof TType]: Narrow\ } \| `TType` extends [] ? [] : `never` \| `TType` extends `Function` ? `TType` : `never` \| `TType` extends `bigint` \| `boolean` \| `number` \| `string` ? `TType` : `never` - -Infers embedded primitive type of any type - -**`Since`** - -0.0.1 - -**`Param`** - -Type to infer - -**`Example`** - -```ts -type Result = Narrow<["foo", "bar", 1]>; -``` - -**`See`** - -https://twitter.com/hd_nvim/status/1578567206190780417 - -#### Type parameters - -| Name | -| :------ | -| `TType` | - ---- - -### Pretty - -Ƭ **Pretty**\<`T`\>: \{ [P in keyof T]: T[P] } & {} - -**`Since`** - -0.0.1 - -#### Type parameters - -| Name | -| :--- | -| `T` | - ---- - -### Remap - -Ƭ **Remap**\<`T`\>: \{ [P in keyof T]: T[P] } - -**`Since`** - -0.0.1 - -#### Type parameters - -| Name | -| :--- | -| `T` | - ---- - -### UnionFromTuple - -Ƭ **UnionFromTuple**\<`T`\>: `T` extends infer U[] ? `U` : `never` - -**`Since`** - -0.0.1 - -**`Example`** - -```ts -type Result = UnionFromTuple<["foo", "bar", 1]>; -// Result = 'foo' | 'bar' | 1 -``` - -#### Type parameters - -| Name | Description | -| :--- | :----------------------------- | -| `T` | The type to get the union from | - ---- - -### UnionToIntersection - -Ƭ **UnionToIntersection**\<`U`\>: `U` extends `unknown` ? (`k`: `U`) => `void` : `never` extends (`k`: infer I) => `void` ? `I` : `never` - -**`Since`** - -0.0.1 - -**`Template`** - -The type to get the intersection from - -**`Example`** - -```ts -type Result = IntersectionFromTuple<["foo", "bar", 1]>; -// Result = 'foo' & 'bar' & 1 -``` - -#### Type parameters - -| Name | -| :--- | -| `U` | - -## Functions - -### asConst - -▸ **asConst**\<`T`\>(`a`): `T` - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | Description | -| :--- | :--- | :------------------ | -| `a` | `T` | The value to infer. | - -#### Returns - -`T` - -**`Since`** - -0.0.1 - ---- - -### entries - -▸ **entries**\<`T`\>(`value`): \{ [K in string \| number \| symbol]-?: [K, T[K]] }[keyof `T`][] - -type-safe version of Object.entries - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------- | -| `T` | extends [`LooseRecord`](README.md#looserecord)\<`unknown`\> | - -#### Parameters - -| Name | Type | Description | -| :------ | :--- | :--------------------------------- | -| `value` | `T` | The value to get the entries from. | - -#### Returns - -\{ [K in string \| number \| symbol]-?: [K, T[K]] }[keyof `T`][] - -The entries of the value. - -**`Since`** - -0.4.0 - ---- - -### fromEntries - -▸ **fromEntries**\<`T`\>(`entries`): [`FromEntries`](README.md#fromentries)\<`T`\> - -type-safe version of Object.fromEntries - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------- | -| `T` | extends [`PropertyKey`, `unknown`][] | - -#### Parameters - -| Name | Type | Description | -| :-------- | :--- | :------------------------------------- | -| `entries` | `T` | The entries to create the object from. | - -#### Returns - -[`FromEntries`](README.md#fromentries)\<`T`\> - -The object created from the entries. - -**`Since`** - -0.4.0 - ---- - -### fromEntriesWithReadOnly - -▸ **fromEntriesWithReadOnly**\<`T`\>(`entries`): [`FromEntries`](README.md#fromentries)\<[`DeepWriteable`](README.md#deepwriteable)\<`T`\>\> - -type-safe version of Object.fromEntries - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------- | -| `T` | extends [`PropertyKey`, `unknown`][] | - -#### Parameters - -| Name | Type | Description | -| :-------- | :--- | :------------------------------------- | -| `entries` | `T` | The entries to create the object from. | - -#### Returns - -[`FromEntries`](README.md#fromentries)\<[`DeepWriteable`](README.md#deepwriteable)\<`T`\>\> - -The object created from the entries. - -**`Since`** - -0.4.0 - ---- - -### identity - -▸ **identity**\<`T`\>(`a`): `T` - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | Description | -| :--- | :--- | :------------------- | -| `a` | `T` | The value to return. | - -#### Returns - -`T` - -**`Since`** - -0.0.1 - ---- - -### isKindObjectLazy - -▸ **isKindObjectLazy**\<`T`\>(`guards`): (`x`: `unknown`) => x is \{ [key in string \| number \| symbol]: GuardReturnType\\> } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------------------------- | -| `T` | extends [`LazyGuardRecord`](README.md#lazyguardrecord) | - -#### Parameters - -| Name | Type | -| :------- | :--- | -| `guards` | `T` | - -#### Returns - -`fn` - -▸ (`x`): x is \{ [key in string \| number \| symbol]: GuardReturnType\\> } - -##### Parameters - -| Name | Type | -| :--- | :-------- | -| `x` | `unknown` | - -##### Returns - -x is \{ [key in string \| number \| symbol]: GuardReturnType\\> } - -**`Since`** - -0.9.0 - ---- - -### isKindOfArray - -▸ **isKindOfArray**\<`T`\>(`guard`): (`x`: `unknown`) => x is T[] - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------- | -| `T` | extends [`Guard`](README.md#guard) | - -#### Parameters - -| Name | Type | Description | -| :------ | :--- | :------------------ | -| `guard` | `T` | The guard to check. | - -#### Returns - -`fn` - -A guard that checks if given value is the kind of array. - -▸ (`x`): x is T[] - -##### Parameters - -| Name | Type | -| :--- | :-------- | -| `x` | `unknown` | - -##### Returns - -x is T[] - -**`Since`** - -0.9.0 - ---- - -### isKindOfObject - -▸ **isKindOfObject**\<`T`\>(`guards`): (`x`: `unknown`) => x is \{ [key in string \| number \| symbol]: GuardReturnType\ } - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------- | -| `T` | extends [`GuardRecord`](README.md#guardrecord) | - -#### Parameters - -| Name | Type | Description | -| :------- | :--- | :------------------- | -| `guards` | `T` | The guards to check. | - -#### Returns - -`fn` - -A guard that checks if given value is the kind of object. - -▸ (`x`): x is \{ [key in string \| number \| symbol]: GuardReturnType\ } - -##### Parameters - -| Name | Type | -| :--- | :-------- | -| `x` | `unknown` | - -##### Returns - -x is \{ [key in string \| number \| symbol]: GuardReturnType\ } - -**`Since`** - -0.9.0 - ---- - -### isKindOfOptional - -▸ **isKindOfOptional**\<`T`\>(`guard`): (`x`: `unknown`) => x is undefined \| T - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :-------------------------------- | -| `guard` | [`Guard`](README.md#guard)\<`T`\> | - -#### Returns - -`fn` - -▸ (`x`): x is undefined \| T - -##### Parameters - -| Name | Type | -| :--- | :-------- | -| `x` | `unknown` | - -##### Returns - -x is undefined \| T - -**`Since`** - -0.9.0 - ---- - -### isKindOfRecord - -▸ **isKindOfRecord**\<`K`, `V`\>(`isK`, `isV`): (`x`: `unknown`) => x is Record\, GuardReturnType\\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------- | -| `K` | extends [`KeyGuard`](README.md#keyguard) | -| `V` | extends [`Guard`](README.md#guard) | - -#### Parameters - -| Name | Type | Description | -| :---- | :--- | :----------------------- | -| `isK` | `K` | The guard for the key. | -| `isV` | `V` | The guard for the value. | - -#### Returns - -`fn` - -A guard that checks if given value is the kind of record. - -▸ (`x`): x is Record\, GuardReturnType\\> - -##### Parameters - -| Name | Type | -| :--- | :-------- | -| `x` | `unknown` | - -##### Returns - -x is Record\, GuardReturnType\\> - -**`Since`** - -0.9.0 - ---- - -### isKindOfTuple - -▸ **isKindOfTuple**\<`T`\>(`guards`): (`x`: `unknown`) => x is \{ [key in string \| number \| symbol]: GuardReturnType\ } - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------- | -| `T` | extends [`Guard`](README.md#guard)[] | - -#### Parameters - -| Name | Type | Description | -| :------- | :--- | :------------------- | -| `guards` | `T` | The guards to check. | - -#### Returns - -`fn` - -A guard that checks if given value is the kind of tuple. - -▸ (`x`): x is \{ [key in string \| number \| symbol]: GuardReturnType\ } - -##### Parameters - -| Name | Type | -| :--- | :-------- | -| `x` | `unknown` | - -##### Returns - -x is \{ [key in string \| number \| symbol]: GuardReturnType\ } - -**`Since`** - -0.9.0 - ---- - -### isKindOfUnion - -▸ **isKindOfUnion**\<`T`\>(`...guards`): (`x`: `unknown`) => x is GuardReturnType\ - -#### Type parameters - -| Name | Type | -| :--- | :----------------------------------- | -| `T` | extends [`Guard`](README.md#guard)[] | - -#### Parameters - -| Name | Type | Description | -| :---------- | :--- | :------------------- | -| `...guards` | `T` | The guards to check. | - -#### Returns - -`fn` - -A guard that checks if given value is the kind of union. - -▸ (`x`): x is GuardReturnType\ - -##### Parameters - -| Name | Type | -| :--- | :-------- | -| `x` | `unknown` | - -##### Returns - -x is GuardReturnType\ - -**`Since`** - -0.9.0 - ---- - -### keys - -▸ **keys**\<`T`\>(`value`): keyof `T`[] - -type-safe version of Object.keys - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------- | -| `T` | extends [`LooseRecord`](README.md#looserecord)\<`unknown`\> | - -#### Parameters - -| Name | Type | Description | -| :------ | :--- | :------------------------------ | -| `value` | `T` | The value to get the keys from. | - -#### Returns - -keyof `T`[] - -The keys of the value. - -**`Since`** - -0.4.0 - ---- - -### narrow - -▸ **narrow**\<`TType`\>(`a`): [`Narrow`](README.md#narrow)\<`TType`\> - -Infers embedded primitive type of any type -Same as `as const` but without setting the object as readonly and without needing the user to use it. - -#### Type parameters - -| Name | -| :------ | -| `TType` | - -#### Parameters - -| Name | Type | Description | -| :--- | :-------------------------------------- | :------------- | -| `a` | [`Narrow`](README.md#narrow)\<`TType`\> | Value to infer | - -#### Returns - -[`Narrow`](README.md#narrow)\<`TType`\> - -Value with embedded type inferred - -**`Since`** - -0.0.1 - -**`Example`** - -```ts -const result = narrow(["foo", "bar", 1]); -``` - ---- - -### noop - -▸ **noop**(): `void` - -#### Returns - -`void` - -**`Since`** - -0.0.1 - ---- - -### uniqueBy - -▸ **uniqueBy**\<`T`\>(`arr`, `fn`): `T`[] - -Returns a new array with unique values based on the given function. - -#### Type parameters - -| Name | Description | -| :--- | :-------------------------- | -| `T` | type of the array elements. | - -#### Parameters - -| Name | Type | Description | -| :---- | :---------------------- | :---------------------------------------- | -| `arr` | readonly `T`[] | The array to filter. | -| `fn` | (`x`: `T`) => `unknown` | The function to get the value to compare. | - -#### Returns - -`T`[] - -new array with unique values. - -**`Since`** - -0.0.1 - ---- - -### values - -▸ **values**\<`T`\>(`value`): `T`[keyof `T`][] - -type-safe version of Object.values - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------- | -| `T` | extends [`LooseRecord`](README.md#looserecord)\<`unknown`\> | - -#### Parameters - -| Name | Type | Description | -| :------ | :--- | :-------------------------------- | -| `value` | `T` | The value to get the values from. | - -#### Returns - -`T`[keyof `T`][] - -The values of the value. - -**`Since`** - -0.4.0 +- [\_](modules/.md) diff --git a/packages/tools/docs/interfaces/P.Predicate.md b/packages/tools/docs/interfaces/.Predicate.md similarity index 73% rename from packages/tools/docs/interfaces/P.Predicate.md rename to packages/tools/docs/interfaces/.Predicate.md index b311879b1..a7b484f65 100644 --- a/packages/tools/docs/interfaces/P.Predicate.md +++ b/packages/tools/docs/interfaces/.Predicate.md @@ -1,8 +1,8 @@ -[@eslint-react/tools](../README.md) / [P](../modules/P.md) / Predicate +[@eslint-react/tools](../README.md) / [\_](../modules/.md) / Predicate # Interface: Predicate\ -[P](../modules/P.md).Predicate +[\_](../modules/.md).Predicate **`Since`** diff --git a/packages/tools/docs/interfaces/P.PredicateTypeLambda.md b/packages/tools/docs/interfaces/.PredicateTypeLambda.md similarity index 59% rename from packages/tools/docs/interfaces/P.PredicateTypeLambda.md rename to packages/tools/docs/interfaces/.PredicateTypeLambda.md index c67f98af4..57b0313f4 100644 --- a/packages/tools/docs/interfaces/P.PredicateTypeLambda.md +++ b/packages/tools/docs/interfaces/.PredicateTypeLambda.md @@ -1,8 +1,8 @@ -[@eslint-react/tools](../README.md) / [P](../modules/P.md) / PredicateTypeLambda +[@eslint-react/tools](../README.md) / [\_](../modules/.md) / PredicateTypeLambda # Interface: PredicateTypeLambda -[P](../modules/P.md).PredicateTypeLambda +[\_](../modules/.md).PredicateTypeLambda **`Since`** @@ -18,11 +18,11 @@ ### Properties -- [In](P.PredicateTypeLambda.md#in) -- [Out1](P.PredicateTypeLambda.md#out1) -- [Out2](P.PredicateTypeLambda.md#out2) -- [Target](P.PredicateTypeLambda.md#target) -- [type](P.PredicateTypeLambda.md#type) +- [In](.PredicateTypeLambda.md#in) +- [Out1](.PredicateTypeLambda.md#out1) +- [Out2](.PredicateTypeLambda.md#out2) +- [Target](.PredicateTypeLambda.md#target) +- [type](.PredicateTypeLambda.md#type) ## Properties @@ -68,4 +68,4 @@ TypeLambda.Target ### type -• `Readonly` **type**: [`Predicate`](P.Predicate.md)\<`unknown`\> +• `Readonly` **type**: [`Predicate`](.Predicate.md)\<`unknown`\> diff --git a/packages/tools/docs/interfaces/P.Refinement.md b/packages/tools/docs/interfaces/.Refinement.md similarity index 77% rename from packages/tools/docs/interfaces/P.Refinement.md rename to packages/tools/docs/interfaces/.Refinement.md index 4ee42d6ef..59e328a22 100644 --- a/packages/tools/docs/interfaces/P.Refinement.md +++ b/packages/tools/docs/interfaces/.Refinement.md @@ -1,8 +1,8 @@ -[@eslint-react/tools](../README.md) / [P](../modules/P.md) / Refinement +[@eslint-react/tools](../README.md) / [\_](../modules/.md) / Refinement # Interface: Refinement\ -[P](../modules/P.md).Refinement +[\_](../modules/.md).Refinement **`Since`** diff --git a/packages/tools/docs/interfaces/Chunk.Chunk-1.md b/packages/tools/docs/interfaces/Chunk.Chunk-1.md deleted file mode 100644 index 6c22b09bb..000000000 --- a/packages/tools/docs/interfaces/Chunk.Chunk-1.md +++ /dev/null @@ -1,1080 +0,0 @@ -[@eslint-react/tools](../README.md) / [Chunk](../modules/Chunk.md) / Chunk - -# Interface: Chunk\ - -[Chunk](../modules/Chunk.md).Chunk - -**`Since`** - -2.0.0 - -## Type parameters - -| Name | -| :--- | -| `A` | - -## Hierarchy - -- `Iterable`\<`A`\> - -- [`Equal`](Equal.Equal.md) - -- `Pipeable` - -- `Inspectable` - - ↳ **`Chunk`** - - ↳↳ [`NonEmptyChunk`](Chunk.NonEmptyChunk.md) - -## Table of contents - -### Properties - -- [[TypeId]](Chunk.Chunk-1.md#[typeid]) -- [length](Chunk.Chunk-1.md#length) - -### Methods - -- [[NodeInspectSymbol]](Chunk.Chunk-1.md#[nodeinspectsymbol]) -- [[iterator]](Chunk.Chunk-1.md#[iterator]) -- [[symbol]](Chunk.Chunk-1.md#[symbol]) -- [[symbol]](Chunk.Chunk-1.md#[symbol]-1) -- [pipe](Chunk.Chunk-1.md#pipe) -- [toJSON](Chunk.Chunk-1.md#tojson) -- [toString](Chunk.Chunk-1.md#tostring) - -## Properties - -### [TypeId] - -• `Readonly` **[TypeId]**: `Object` - -#### Type declaration - -| Name | Type | -| :--- | :----------------- | -| `_A` | `Covariant`\<`A`\> | - ---- - -### length - -• `Readonly` **length**: `number` - -## Methods - -### [NodeInspectSymbol] - -▸ **[NodeInspectSymbol]**(): `unknown` - -#### Returns - -`unknown` - -#### Inherited from - -Inspectable.[NodeInspectSymbol] - ---- - -### [iterator] - -▸ **[iterator]**(): `Iterator`\<`A`, `any`, `undefined`\> - -#### Returns - -`Iterator`\<`A`, `any`, `undefined`\> - -#### Inherited from - -Iterable.[iterator] - ---- - -### [symbol] - -▸ **[symbol]**(`that`): `boolean` - -#### Parameters - -| Name | Type | -| :----- | :------------------------ | -| `that` | [`Equal`](Equal.Equal.md) | - -#### Returns - -`boolean` - -#### Inherited from - -[Equal](Equal.Equal.md).[[symbol]](Equal.Equal.md#[symbol]-1) - ---- - -### [symbol] - -▸ **[symbol]**(): `number` - -#### Returns - -`number` - -#### Inherited from - -Equal.Equal.[symbol] - ---- - -### pipe - -▸ **pipe**\<`A`, `B`\>(`this`, `ab`): `B` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | - -#### Returns - -`B` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`\>(`this`, `ab`, `bc`): `C` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | - -#### Returns - -`C` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`\>(`this`, `ab`, `bc`, `cd`): `D` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | - -#### Returns - -`D` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`\>(`this`, `ab`, `bc`, `cd`, `de`): `E` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | - -#### Returns - -`E` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`): `F` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | - -#### Returns - -`F` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`): `G` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | - -#### Returns - -`G` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`): `H` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | - -#### Returns - -`H` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`): `I` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | - -#### Returns - -`I` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`): `J` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | - -#### Returns - -`J` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`): `K` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | - -#### Returns - -`K` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`): `L` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | - -#### Returns - -`L` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`): `M` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | - -#### Returns - -`M` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`): `N` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | - -#### Returns - -`N` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`): `O` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | - -#### Returns - -`O` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`, `P`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`, `op`): `P` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | -| `P` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | -| `op` | (`_`: `O`) => `P` | - -#### Returns - -`P` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`, `P`, `Q`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`, `op`, `pq`): `Q` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | -| `P` | -| `Q` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | -| `op` | (`_`: `O`) => `P` | -| `pq` | (`_`: `P`) => `Q` | - -#### Returns - -`Q` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`, `P`, `Q`, `R`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`, `op`, `pq`, `qr`): `R` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | -| `P` | -| `Q` | -| `R` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | -| `op` | (`_`: `O`) => `P` | -| `pq` | (`_`: `P`) => `Q` | -| `qr` | (`_`: `Q`) => `R` | - -#### Returns - -`R` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`, `P`, `Q`, `R`, `S`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`, `op`, `pq`, `qr`, `rs`): `S` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | -| `P` | -| `Q` | -| `R` | -| `S` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | -| `op` | (`_`: `O`) => `P` | -| `pq` | (`_`: `P`) => `Q` | -| `qr` | (`_`: `Q`) => `R` | -| `rs` | (`_`: `R`) => `S` | - -#### Returns - -`S` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`, `P`, `Q`, `R`, `S`, `T`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`, `op`, `pq`, `qr`, `rs`, `st`): `T` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | -| `P` | -| `Q` | -| `R` | -| `S` | -| `T` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | -| `op` | (`_`: `O`) => `P` | -| `pq` | (`_`: `P`) => `Q` | -| `qr` | (`_`: `Q`) => `R` | -| `rs` | (`_`: `R`) => `S` | -| `st` | (`_`: `S`) => `T` | - -#### Returns - -`T` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`, `P`, `Q`, `R`, `S`, `T`, `U`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`, `op`, `pq`, `qr`, `rs`, `st`, `tu`): `U` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | -| `P` | -| `Q` | -| `R` | -| `S` | -| `T` | -| `U` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | -| `op` | (`_`: `O`) => `P` | -| `pq` | (`_`: `P`) => `Q` | -| `qr` | (`_`: `Q`) => `R` | -| `rs` | (`_`: `R`) => `S` | -| `st` | (`_`: `S`) => `T` | -| `tu` | (`_`: `T`) => `U` | - -#### Returns - -`U` - -#### Inherited from - -Pipeable.pipe - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`, `P`, `Q`, `R`, `S`, `T`, `U`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`, `op`, `pq`, `qr`, `rs`, `st`, `tu`): `U` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | -| `P` | -| `Q` | -| `R` | -| `S` | -| `T` | -| `U` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | -| `op` | (`_`: `O`) => `P` | -| `pq` | (`_`: `P`) => `Q` | -| `qr` | (`_`: `Q`) => `R` | -| `rs` | (`_`: `R`) => `S` | -| `st` | (`_`: `S`) => `T` | -| `tu` | (`_`: `T`) => `U` | - -#### Returns - -`U` - -#### Inherited from - -Pipeable.pipe - ---- - -### toJSON - -▸ **toJSON**(): `unknown` - -#### Returns - -`unknown` - -#### Inherited from - -Inspectable.toJSON - ---- - -### toString - -▸ **toString**(): `string` - -#### Returns - -`string` - -#### Inherited from - -Inspectable.toString diff --git a/packages/tools/docs/interfaces/Chunk.ChunkTypeLambda.md b/packages/tools/docs/interfaces/Chunk.ChunkTypeLambda.md deleted file mode 100644 index aa429925b..000000000 --- a/packages/tools/docs/interfaces/Chunk.ChunkTypeLambda.md +++ /dev/null @@ -1,71 +0,0 @@ -[@eslint-react/tools](../README.md) / [Chunk](../modules/Chunk.md) / ChunkTypeLambda - -# Interface: ChunkTypeLambda - -[Chunk](../modules/Chunk.md).ChunkTypeLambda - -**`Since`** - -2.0.0 - -## Hierarchy - -- `TypeLambda` - - ↳ **`ChunkTypeLambda`** - -## Table of contents - -### Properties - -- [In](Chunk.ChunkTypeLambda.md#in) -- [Out1](Chunk.ChunkTypeLambda.md#out1) -- [Out2](Chunk.ChunkTypeLambda.md#out2) -- [Target](Chunk.ChunkTypeLambda.md#target) -- [type](Chunk.ChunkTypeLambda.md#type) - -## Properties - -### In - -• `Readonly` **In**: `unknown` - -#### Inherited from - -TypeLambda.In - ---- - -### Out1 - -• `Readonly` **Out1**: `unknown` - -#### Inherited from - -TypeLambda.Out1 - ---- - -### Out2 - -• `Readonly` **Out2**: `unknown` - -#### Inherited from - -TypeLambda.Out2 - ---- - -### Target - -• `Readonly` **Target**: `unknown` - -#### Inherited from - -TypeLambda.Target - ---- - -### type - -• `Readonly` **type**: [`Chunk`](Chunk.Chunk-1.md)\<`unknown`\> diff --git a/packages/tools/docs/interfaces/Chunk.NonEmptyChunk.md b/packages/tools/docs/interfaces/Chunk.NonEmptyChunk.md deleted file mode 100644 index eaecee18b..000000000 --- a/packages/tools/docs/interfaces/Chunk.NonEmptyChunk.md +++ /dev/null @@ -1,1093 +0,0 @@ -[@eslint-react/tools](../README.md) / [Chunk](../modules/Chunk.md) / NonEmptyChunk - -# Interface: NonEmptyChunk\ - -[Chunk](../modules/Chunk.md).NonEmptyChunk - -**`Since`** - -2.0.0 - -## Type parameters - -| Name | -| :--- | -| `A` | - -## Hierarchy - -- [`Chunk`](Chunk.Chunk-1.md)\<`A`\> - -- `NonEmptyIterable`\<`A`\> - - ↳ **`NonEmptyChunk`** - -## Table of contents - -### Properties - -- [[TypeId]](Chunk.NonEmptyChunk.md#[typeid]) -- [[nonEmpty]](Chunk.NonEmptyChunk.md#[nonempty]) -- [length](Chunk.NonEmptyChunk.md#length) - -### Methods - -- [[NodeInspectSymbol]](Chunk.NonEmptyChunk.md#[nodeinspectsymbol]) -- [[iterator]](Chunk.NonEmptyChunk.md#[iterator]) -- [[symbol]](Chunk.NonEmptyChunk.md#[symbol]) -- [[symbol]](Chunk.NonEmptyChunk.md#[symbol]-1) -- [pipe](Chunk.NonEmptyChunk.md#pipe) -- [toJSON](Chunk.NonEmptyChunk.md#tojson) -- [toString](Chunk.NonEmptyChunk.md#tostring) - -## Properties - -### [TypeId] - -• `Readonly` **[TypeId]**: `Object` - -#### Type declaration - -| Name | Type | -| :--- | :----------------- | -| `_A` | `Covariant`\<`A`\> | - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[[TypeId]](Chunk.Chunk-1.md#[typeid]) - ---- - -### [nonEmpty] - -• `Readonly` **[nonEmpty]**: `A` - -#### Inherited from - -NonEmptyIterable.[nonEmpty] - ---- - -### length - -• `Readonly` **length**: `number` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[length](Chunk.Chunk-1.md#length) - -## Methods - -### [NodeInspectSymbol] - -▸ **[NodeInspectSymbol]**(): `unknown` - -#### Returns - -`unknown` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[[NodeInspectSymbol]](Chunk.Chunk-1.md#[nodeinspectsymbol]) - ---- - -### [iterator] - -▸ **[iterator]**(): `Iterator`\<`A`, `any`, `undefined`\> - -#### Returns - -`Iterator`\<`A`, `any`, `undefined`\> - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[[iterator]](Chunk.Chunk-1.md#[iterator]) - ---- - -### [symbol] - -▸ **[symbol]**(`that`): `boolean` - -#### Parameters - -| Name | Type | -| :----- | :------------------------ | -| `that` | [`Equal`](Equal.Equal.md) | - -#### Returns - -`boolean` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[[symbol]](Chunk.Chunk-1.md#[symbol]-1) - ---- - -### [symbol] - -▸ **[symbol]**(): `number` - -#### Returns - -`number` - -#### Inherited from - -Chunk.[symbol] - ---- - -### pipe - -▸ **pipe**\<`A`, `B`\>(`this`, `ab`): `B` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | - -#### Returns - -`B` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`\>(`this`, `ab`, `bc`): `C` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | - -#### Returns - -`C` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`\>(`this`, `ab`, `bc`, `cd`): `D` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | - -#### Returns - -`D` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`\>(`this`, `ab`, `bc`, `cd`, `de`): `E` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | - -#### Returns - -`E` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`): `F` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | - -#### Returns - -`F` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`): `G` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | - -#### Returns - -`G` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`): `H` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | - -#### Returns - -`H` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`): `I` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | - -#### Returns - -`I` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`): `J` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | - -#### Returns - -`J` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`): `K` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | - -#### Returns - -`K` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`): `L` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | - -#### Returns - -`L` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`): `M` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | - -#### Returns - -`M` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`): `N` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | - -#### Returns - -`N` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`): `O` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | - -#### Returns - -`O` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`, `P`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`, `op`): `P` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | -| `P` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | -| `op` | (`_`: `O`) => `P` | - -#### Returns - -`P` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`, `P`, `Q`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`, `op`, `pq`): `Q` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | -| `P` | -| `Q` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | -| `op` | (`_`: `O`) => `P` | -| `pq` | (`_`: `P`) => `Q` | - -#### Returns - -`Q` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`, `P`, `Q`, `R`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`, `op`, `pq`, `qr`): `R` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | -| `P` | -| `Q` | -| `R` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | -| `op` | (`_`: `O`) => `P` | -| `pq` | (`_`: `P`) => `Q` | -| `qr` | (`_`: `Q`) => `R` | - -#### Returns - -`R` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`, `P`, `Q`, `R`, `S`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`, `op`, `pq`, `qr`, `rs`): `S` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | -| `P` | -| `Q` | -| `R` | -| `S` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | -| `op` | (`_`: `O`) => `P` | -| `pq` | (`_`: `P`) => `Q` | -| `qr` | (`_`: `Q`) => `R` | -| `rs` | (`_`: `R`) => `S` | - -#### Returns - -`S` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`, `P`, `Q`, `R`, `S`, `T`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`, `op`, `pq`, `qr`, `rs`, `st`): `T` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | -| `P` | -| `Q` | -| `R` | -| `S` | -| `T` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | -| `op` | (`_`: `O`) => `P` | -| `pq` | (`_`: `P`) => `Q` | -| `qr` | (`_`: `Q`) => `R` | -| `rs` | (`_`: `R`) => `S` | -| `st` | (`_`: `S`) => `T` | - -#### Returns - -`T` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`, `P`, `Q`, `R`, `S`, `T`, `U`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`, `op`, `pq`, `qr`, `rs`, `st`, `tu`): `U` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | -| `P` | -| `Q` | -| `R` | -| `S` | -| `T` | -| `U` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | -| `op` | (`_`: `O`) => `P` | -| `pq` | (`_`: `P`) => `Q` | -| `qr` | (`_`: `Q`) => `R` | -| `rs` | (`_`: `R`) => `S` | -| `st` | (`_`: `S`) => `T` | -| `tu` | (`_`: `T`) => `U` | - -#### Returns - -`U` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - -▸ **pipe**\<`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`, `P`, `Q`, `R`, `S`, `T`, `U`\>(`this`, `ab`, `bc`, `cd`, `de`, `ef`, `fg`, `gh`, `hi`, `ij`, `jk`, `kl`, `lm`, `mn`, `no`, `op`, `pq`, `qr`, `rs`, `st`, `tu`): `U` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | -| `D` | -| `E` | -| `F` | -| `G` | -| `H` | -| `I` | -| `J` | -| `K` | -| `L` | -| `M` | -| `N` | -| `O` | -| `P` | -| `Q` | -| `R` | -| `S` | -| `T` | -| `U` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `this` | `A` | -| `ab` | (`_`: `A`) => `B` | -| `bc` | (`_`: `B`) => `C` | -| `cd` | (`_`: `C`) => `D` | -| `de` | (`_`: `D`) => `E` | -| `ef` | (`_`: `E`) => `F` | -| `fg` | (`_`: `F`) => `G` | -| `gh` | (`_`: `G`) => `H` | -| `hi` | (`_`: `H`) => `I` | -| `ij` | (`_`: `I`) => `J` | -| `jk` | (`_`: `J`) => `K` | -| `kl` | (`_`: `K`) => `L` | -| `lm` | (`_`: `L`) => `M` | -| `mn` | (`_`: `M`) => `N` | -| `no` | (`_`: `N`) => `O` | -| `op` | (`_`: `O`) => `P` | -| `pq` | (`_`: `P`) => `Q` | -| `qr` | (`_`: `Q`) => `R` | -| `rs` | (`_`: `R`) => `S` | -| `st` | (`_`: `S`) => `T` | -| `tu` | (`_`: `T`) => `U` | - -#### Returns - -`U` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[pipe](Chunk.Chunk-1.md#pipe) - ---- - -### toJSON - -▸ **toJSON**(): `unknown` - -#### Returns - -`unknown` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[toJSON](Chunk.Chunk-1.md#tojson) - ---- - -### toString - -▸ **toString**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[Chunk](Chunk.Chunk-1.md).[toString](Chunk.Chunk-1.md#tostring) diff --git a/packages/tools/docs/interfaces/Equal.Equal.md b/packages/tools/docs/interfaces/Equal.Equal.md index 2bb62c4da..5399d5755 100644 --- a/packages/tools/docs/interfaces/Equal.Equal.md +++ b/packages/tools/docs/interfaces/Equal.Equal.md @@ -14,8 +14,6 @@ ↳ **`Equal`** - ↳↳ [`Chunk`](Chunk.Chunk-1.md) - ↳↳ [`Case`](Data.Case-1.md) ↳↳ [`Nil`](List.Nil.md) diff --git a/packages/tools/docs/interfaces/M.Pattern.unstable_Fn.md b/packages/tools/docs/interfaces/M.Pattern.unstable_Fn.md deleted file mode 100644 index faa904abd..000000000 --- a/packages/tools/docs/interfaces/M.Pattern.unstable_Fn.md +++ /dev/null @@ -1,24 +0,0 @@ -[@eslint-react/tools](../README.md) / [M](../modules/M.md) / [Pattern](../modules/M.Pattern.md) / unstable\_Fn - -# Interface: unstable\_Fn - -[M](../modules/M.md).[Pattern](../modules/M.Pattern.md).unstable_Fn - -## Table of contents - -### Properties - -- [input](M.Pattern.unstable_Fn.md#input) -- [output](M.Pattern.unstable_Fn.md#output) - -## Properties - -### input - -• **input**: `unknown` - ---- - -### output - -• **output**: `unknown` diff --git a/packages/tools/docs/modules/.md b/packages/tools/docs/modules/.md new file mode 100644 index 000000000..1a3ff18fd --- /dev/null +++ b/packages/tools/docs/modules/.md @@ -0,0 +1,1948 @@ +[@eslint-react/tools](../README.md) / \_ + +# Namespace: \_ + +## Table of contents + +### Interfaces + +- [Predicate](../interfaces/.Predicate.md) +- [PredicateTypeLambda](../interfaces/.PredicateTypeLambda.md) +- [Refinement](../interfaces/.Refinement.md) + +### Functions + +- [all](.md#all) +- [and](.md#and) +- [compose](.md#compose) +- [eqv](.md#eqv) +- [every](.md#every) +- [hasProperty](.md#hasproperty) +- [implies](.md#implies) +- [isBigInt](.md#isbigint) +- [isBoolean](.md#isboolean) +- [isDate](.md#isdate) +- [isError](.md#iserror) +- [isFunction](.md#isfunction) +- [isIterable](.md#isiterable) +- [isNever](.md#isnever) +- [isNotNull](.md#isnotnull) +- [isNotNullable](.md#isnotnullable) +- [isNotUndefined](.md#isnotundefined) +- [isNull](.md#isnull) +- [isNullable](.md#isnullable) +- [isNumber](.md#isnumber) +- [isObject](.md#isobject) +- [isPromise](.md#ispromise) +- [isReadonlyRecord](.md#isreadonlyrecord) +- [isRecord](.md#isrecord) +- [isString](.md#isstring) +- [isSymbol](.md#issymbol) +- [isTagged](.md#istagged) +- [isUint8Array](.md#isuint8array) +- [isUndefined](.md#isundefined) +- [isUnknown](.md#isunknown) +- [mapInput](.md#mapinput) +- [nand](.md#nand) +- [nor](.md#nor) +- [not](.md#not) +- [or](.md#or) +- [product](.md#product) +- [productMany](.md#productmany) +- [some](.md#some) +- [struct](.md#struct) +- [tuple](.md#tuple) +- [xor](.md#xor) + +## Other + +### compose + +▸ **compose**\<`A`, `B`, `C`\>(`bc`): (`ab`: [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\>) => [`Refinement`](../interfaces/.Refinement.md)\<`A`, `C`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | +| `B` | +| `C` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `bc` | [`Refinement`](../interfaces/.Refinement.md)\<`B`, `C`\> | + +#### Returns + +`fn` + +▸ (`ab`): [`Refinement`](../interfaces/.Refinement.md)\<`A`, `C`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `ab` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | + +##### Returns + +[`Refinement`](../interfaces/.Refinement.md)\<`A`, `C`\> + +**`Since`** + +2.0.0 + +▸ **compose**\<`A`, `B`, `C`\>(`ab`, `bc`): [`Refinement`](../interfaces/.Refinement.md)\<`A`, `C`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | +| `B` | +| `C` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ab` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | +| `bc` | [`Refinement`](../interfaces/.Refinement.md)\<`B`, `C`\> | + +#### Returns + +[`Refinement`](../interfaces/.Refinement.md)\<`A`, `C`\> + +**`Since`** + +2.0.0 + +___ + +### struct + +▸ **struct**\<`R`\>(`fields`): [`Predicate`](../interfaces/.Predicate.md)\<\{ readonly [K in string \| number \| symbol]: [R[K]] extends [Predicate\] ? A : never }\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `R` | extends `Record`\<`string`, [`Predicate`](../interfaces/.Predicate.md)\<`any`\>\> | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fields` | `R` | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<\{ readonly [K in string \| number \| symbol]: [R[K]] extends [Predicate\] ? A : never }\> + +**`Since`** + +2.0.0 + +___ + +### tuple + +▸ **tuple**\<`T`\>(`...elements`): [`Predicate`](../interfaces/.Predicate.md)\<`Readonly`\<\{ [I in string \| number \| symbol]: [T[I]] extends [Predicate\] ? A : never }\>\> + +Similar to `Promise.all` but operates on `Predicate`s. + +``` +[Predicate, Predicate, ...] -> Predicate<[A, B, ...]> +``` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends readonly [`Predicate`](../interfaces/.Predicate.md)\<`any`\>[] | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `...elements` | `T` | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`Readonly`\<\{ [I in string \| number \| symbol]: [T[I]] extends [Predicate\] ? A : never }\>\> + +**`Since`** + +2.0.0 + +## combinators + +### and + +▸ **and**\<`A`, `C`\>(`that`): \(`self`: [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\>) => [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B` & `C`\> + +Combines two predicates into a new predicate that returns `true` if both of the predicates returns `true`. + +#### Type parameters + +| Name | +| :------ | +| `A` | +| `C` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `that` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `C`\> | A predicate. | + +#### Returns + +`fn` + +▸ \<`B`\>(`self`): [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B` & `C`\> + +##### Type parameters + +| Name | +| :------ | +| `B` | + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | + +##### Returns + +[`Refinement`](../interfaces/.Refinement.md)\<`A`, `B` & `C`\> + +**`Example`** + +```ts +import * as P from "effect/Predicate" + +const minLength = (n: number) => (s: string) => s.length >= n +const maxLength = (n: number) => (s: string) => s.length <= n + +const length = (n: number) => P.and(minLength(n), maxLength(n)) + +assert.deepStrictEqual(length(2)("aa"), true) +assert.deepStrictEqual(length(2)("a"), false) +assert.deepStrictEqual(length(2)("aaa"), false) +``` + +**`Since`** + +2.0.0 + +▸ **and**\<`A`, `B`, `C`\>(`self`, `that`): [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B` & `C`\> + +Combines two predicates into a new predicate that returns `true` if both of the predicates returns `true`. + +#### Type parameters + +| Name | +| :------ | +| `A` | +| `B` | +| `C` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `self` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | A predicate. | +| `that` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `C`\> | A predicate. | + +#### Returns + +[`Refinement`](../interfaces/.Refinement.md)\<`A`, `B` & `C`\> + +**`Example`** + +```ts +import * as P from "effect/Predicate" + +const minLength = (n: number) => (s: string) => s.length >= n +const maxLength = (n: number) => (s: string) => s.length <= n + +const length = (n: number) => P.and(minLength(n), maxLength(n)) + +assert.deepStrictEqual(length(2)("aa"), true) +assert.deepStrictEqual(length(2)("a"), false) +assert.deepStrictEqual(length(2)("aaa"), false) +``` + +**`Since`** + +2.0.0 + +▸ **and**\<`A`\>(`that`): (`self`: [`Predicate`](../interfaces/.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +Combines two predicates into a new predicate that returns `true` if both of the predicates returns `true`. + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `that` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | A predicate. | + +#### Returns + +`fn` + +▸ (`self`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +##### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Example`** + +```ts +import * as P from "effect/Predicate" + +const minLength = (n: number) => (s: string) => s.length >= n +const maxLength = (n: number) => (s: string) => s.length <= n + +const length = (n: number) => P.and(minLength(n), maxLength(n)) + +assert.deepStrictEqual(length(2)("aa"), true) +assert.deepStrictEqual(length(2)("a"), false) +assert.deepStrictEqual(length(2)("aaa"), false) +``` + +**`Since`** + +2.0.0 + +▸ **and**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +Combines two predicates into a new predicate that returns `true` if both of the predicates returns `true`. + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | A predicate. | +| `that` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | A predicate. | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Example`** + +```ts +import * as P from "effect/Predicate" + +const minLength = (n: number) => (s: string) => s.length >= n +const maxLength = (n: number) => (s: string) => s.length <= n + +const length = (n: number) => P.and(minLength(n), maxLength(n)) + +assert.deepStrictEqual(length(2)("aa"), true) +assert.deepStrictEqual(length(2)("a"), false) +assert.deepStrictEqual(length(2)("aaa"), false) +``` + +**`Since`** + +2.0.0 + +___ + +### eqv + +▸ **eqv**\<`A`\>(`that`): (`self`: [`Predicate`](../interfaces/.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `that` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +#### Returns + +`fn` + +▸ (`self`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +##### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Since`** + +2.0.0 + +▸ **eqv**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | +| `that` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Since`** + +2.0.0 + +___ + +### implies + +▸ **implies**\<`A`\>(`that`): (`self`: [`Predicate`](../interfaces/.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `that` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +#### Returns + +`fn` + +▸ (`self`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +##### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Since`** + +2.0.0 + +▸ **implies**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | +| `that` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Since`** + +2.0.0 + +___ + +### mapInput + +▸ **mapInput**\<`B`, `A`\>(`f`): (`self`: [`Predicate`](../interfaces/.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/.Predicate.md)\<`B`\> + +Given a `Predicate` returns a `Predicate` + +#### Type parameters + +| Name | +| :------ | +| `B` | +| `A` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `f` | (`b`: `B`) => `A` | a function to transform `B` to `A`. | + +#### Returns + +`fn` + +▸ (`self`): [`Predicate`](../interfaces/.Predicate.md)\<`B`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +##### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`B`\> + +**`Example`** + +```ts +import * as P from "effect/Predicate" +import * as N from "effect/Number" + +const minLength3 = P.mapInput(N.greaterThan(2), (s: string) => s.length) + +assert.deepStrictEqual(minLength3("a"), false) +assert.deepStrictEqual(minLength3("aa"), false) +assert.deepStrictEqual(minLength3("aaa"), true) +assert.deepStrictEqual(minLength3("aaaa"), true) +``` + +**`Since`** + +2.0.0 + +▸ **mapInput**\<`A`, `B`\>(`self`, `f`): [`Predicate`](../interfaces/.Predicate.md)\<`B`\> + +Given a `Predicate` returns a `Predicate` + +#### Type parameters + +| Name | +| :------ | +| `A` | +| `B` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | the `Predicate` to be transformed to `Predicate`. | +| `f` | (`b`: `B`) => `A` | a function to transform `B` to `A`. | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`B`\> + +**`Example`** + +```ts +import * as P from "effect/Predicate" +import * as N from "effect/Number" + +const minLength3 = P.mapInput(N.greaterThan(2), (s: string) => s.length) + +assert.deepStrictEqual(minLength3("a"), false) +assert.deepStrictEqual(minLength3("aa"), false) +assert.deepStrictEqual(minLength3("aaa"), true) +assert.deepStrictEqual(minLength3("aaaa"), true) +``` + +**`Since`** + +2.0.0 + +___ + +### nand + +▸ **nand**\<`A`\>(`that`): (`self`: [`Predicate`](../interfaces/.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `that` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +#### Returns + +`fn` + +▸ (`self`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +##### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Since`** + +2.0.0 + +▸ **nand**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | +| `that` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Since`** + +2.0.0 + +___ + +### nor + +▸ **nor**\<`A`\>(`that`): (`self`: [`Predicate`](../interfaces/.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `that` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +#### Returns + +`fn` + +▸ (`self`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +##### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Since`** + +2.0.0 + +▸ **nor**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | +| `that` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Since`** + +2.0.0 + +___ + +### not + +▸ **not**\<`A`\>(`self`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +Negates the result of a given predicate. + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | A predicate. | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Example`** + +```ts +import * as P from "effect/Predicate" +import * as N from "effect/Number" + +const isPositive = P.not(N.lessThan(0)) + +assert.deepStrictEqual(isPositive(-1), false) +assert.deepStrictEqual(isPositive(0), true) +assert.deepStrictEqual(isPositive(1), true) +``` + +**`Since`** + +2.0.0 + +___ + +### or + +▸ **or**\<`A`\>(`that`): (`self`: [`Predicate`](../interfaces/.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +Combines two predicates into a new predicate that returns `true` if at least one of the predicates returns `true`. + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `that` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | A predicate. | + +#### Returns + +`fn` + +▸ (`self`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +##### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Example`** + +```ts +import * as P from "effect/Predicate" +import * as N from "effect/Number" + +const nonZero = P.or(N.lessThan(0), N.greaterThan(0)) + +assert.deepStrictEqual(nonZero(-1), true) +assert.deepStrictEqual(nonZero(0), false) +assert.deepStrictEqual(nonZero(1), true) +``` + +**`Since`** + +2.0.0 + +▸ **or**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +Combines two predicates into a new predicate that returns `true` if at least one of the predicates returns `true`. + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | A predicate. | +| `that` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | A predicate. | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Example`** + +```ts +import * as P from "effect/Predicate" +import * as N from "effect/Number" + +const nonZero = P.or(N.lessThan(0), N.greaterThan(0)) + +assert.deepStrictEqual(nonZero(-1), true) +assert.deepStrictEqual(nonZero(0), false) +assert.deepStrictEqual(nonZero(1), true) +``` + +**`Since`** + +2.0.0 + +___ + +### xor + +▸ **xor**\<`A`\>(`that`): (`self`: [`Predicate`](../interfaces/.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `that` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +#### Returns + +`fn` + +▸ (`self`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +##### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Since`** + +2.0.0 + +▸ **xor**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | +| `that` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Since`** + +2.0.0 + +## combining + +### all + +▸ **all**\<`A`\>(`collection`): [`Predicate`](../interfaces/.Predicate.md)\ + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `collection` | `Iterable`\<[`Predicate`](../interfaces/.Predicate.md)\<`A`\>\> | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\ + +**`Since`** + +2.0.0 + +___ + +### product + +▸ **product**\<`A`, `B`\>(`self`, `that`): [`Predicate`](../interfaces/.Predicate.md)\ + +#### Type parameters + +| Name | +| :------ | +| `A` | +| `B` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | +| `that` | [`Predicate`](../interfaces/.Predicate.md)\<`B`\> | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\ + +**`Since`** + +2.0.0 + +___ + +### productMany + +▸ **productMany**\<`A`\>(`self`, `collection`): [`Predicate`](../interfaces/.Predicate.md)\ + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | +| `collection` | `Iterable`\<[`Predicate`](../interfaces/.Predicate.md)\<`A`\>\> | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\ + +**`Since`** + +2.0.0 + +## elements + +### every + +▸ **every**\<`A`\>(`collection`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `collection` | `Iterable`\<[`Predicate`](../interfaces/.Predicate.md)\<`A`\>\> | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Since`** + +2.0.0 + +___ + +### some + +▸ **some**\<`A`\>(`collection`): [`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `collection` | `Iterable`\<[`Predicate`](../interfaces/.Predicate.md)\<`A`\>\> | + +#### Returns + +[`Predicate`](../interfaces/.Predicate.md)\<`A`\> + +**`Since`** + +2.0.0 + +## guards + +### hasProperty + +▸ **hasProperty**\<`P`\>(`property`): (`self`: `unknown`) => self is \{ [K in PropertyKey]: unknown } + +Checks whether a value is an `object` containing a specified property key. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `P` | extends `PropertyKey` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `property` | `P` | The field to check within the object. | + +#### Returns + +`fn` + +▸ (`self`): self is \{ [K in PropertyKey]: unknown } + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | `unknown` | + +##### Returns + +self is \{ [K in PropertyKey]: unknown } + +**`Since`** + +2.0.0 + +▸ **hasProperty**\<`P`\>(`self`, `property`): self is \{ [K in PropertyKey]: unknown } + +Checks whether a value is an `object` containing a specified property key. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `P` | extends `PropertyKey` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `self` | `unknown` | The value to examine. | +| `property` | `P` | The field to check within the object. | + +#### Returns + +self is \{ [K in PropertyKey]: unknown } + +**`Since`** + +2.0.0 + +___ + +### isBigInt + +▸ **isBigInt**(`input`): input is bigint + +Tests if a value is a `bigint`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is bigint + +**`Example`** + +```ts +import { isBigInt } from "effect/Predicate" + +assert.deepStrictEqual(isBigInt(1n), true) + +assert.deepStrictEqual(isBigInt(1), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isBoolean + +▸ **isBoolean**(`input`): input is boolean + +Tests if a value is a `boolean`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is boolean + +**`Example`** + +```ts +import { isBoolean } from "effect/Predicate" + +assert.deepStrictEqual(isBoolean(true), true) + +assert.deepStrictEqual(isBoolean("true"), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isDate + +▸ **isDate**(`input`): input is Date + +A guard that succeeds when the input is a `Date`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is Date + +**`Example`** + +```ts +import { isDate } from "effect/Predicate" + +assert.deepStrictEqual(isDate(new Date()), true) + +assert.deepStrictEqual(isDate(null), false) +assert.deepStrictEqual(isDate({}), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isError + +▸ **isError**(`input`): input is Error + +A guard that succeeds when the input is an `Error`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is Error + +**`Example`** + +```ts +import { isError } from "effect/Predicate" + +assert.deepStrictEqual(isError(new Error()), true) + +assert.deepStrictEqual(isError(null), false) +assert.deepStrictEqual(isError({}), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isFunction + +▸ **isFunction**(`input`): input is Function + +Tests if a value is a `function`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is Function + +**`Example`** + +```ts +import { isFunction } from "effect/Predicate" + +assert.deepStrictEqual(isFunction(isFunction), true) + +assert.deepStrictEqual(isFunction("function"), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isIterable + +▸ **isIterable**(`input`): input is Iterable\ + +A guard that succeeds when the input is an `Iterable`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is Iterable\ + +**`Example`** + +```ts +import { isIterable } from "effect/Predicate" + +assert.deepStrictEqual(isIterable([]), true) +assert.deepStrictEqual(isIterable(new Set()), true) + +assert.deepStrictEqual(isIterable(null), false) +assert.deepStrictEqual(isIterable({}), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isNever + +▸ **isNever**(`input`): input is never + +A guard that always fails. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `input` | `unknown` | + +#### Returns + +input is never + +**`Example`** + +```ts +import { isNever } from "effect/Predicate" + +assert.deepStrictEqual(isNever(null), false) +assert.deepStrictEqual(isNever(undefined), false) +assert.deepStrictEqual(isNever({}), false) +assert.deepStrictEqual(isNever([]), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isNotNull + +▸ **isNotNull**\<`A`\>(`input`): input is Exclude\ + +Tests if a value is not `undefined`. + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `A` | The value to test. | + +#### Returns + +input is Exclude\ + +**`Example`** + +```ts +import { isNotNull } from "effect/Predicate" + +assert.deepStrictEqual(isNotNull(undefined), true) +assert.deepStrictEqual(isNotNull("null"), true) + +assert.deepStrictEqual(isNotNull(null), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isNotNullable + +▸ **isNotNullable**\<`A`\>(`input`): input is NonNullable\ + +A guard that succeeds when the input is not `null` or `undefined`. + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `A` | The value to test. | + +#### Returns + +input is NonNullable\ + +**`Example`** + +```ts +import { isNotNullable } from "effect/Predicate" + +assert.deepStrictEqual(isNotNullable({}), true) +assert.deepStrictEqual(isNotNullable([]), true) + +assert.deepStrictEqual(isNotNullable(null), false) +assert.deepStrictEqual(isNotNullable(undefined), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isNotUndefined + +▸ **isNotUndefined**\<`A`\>(`input`): input is Exclude\ + +Tests if a value is not `undefined`. + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `A` | The value to test. | + +#### Returns + +input is Exclude\ + +**`Example`** + +```ts +import { isNotUndefined } from "effect/Predicate" + +assert.deepStrictEqual(isNotUndefined(null), true) +assert.deepStrictEqual(isNotUndefined("undefined"), true) + +assert.deepStrictEqual(isNotUndefined(undefined), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isNull + +▸ **isNull**(`input`): input is null + +Tests if a value is `undefined`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is null + +**`Example`** + +```ts +import { isNull } from "effect/Predicate" + +assert.deepStrictEqual(isNull(null), true) + +assert.deepStrictEqual(isNull(undefined), false) +assert.deepStrictEqual(isNull("null"), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isNullable + +▸ **isNullable**\<`A`\>(`input`): input is Extract\ + +A guard that succeeds when the input is `null` or `undefined`. + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `A` | The value to test. | + +#### Returns + +input is Extract\ + +**`Example`** + +```ts +import { isNullable } from "effect/Predicate" + +assert.deepStrictEqual(isNullable(null), true) +assert.deepStrictEqual(isNullable(undefined), true) + +assert.deepStrictEqual(isNullable({}), false) +assert.deepStrictEqual(isNullable([]), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isNumber + +▸ **isNumber**(`input`): input is number + +Tests if a value is a `number`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is number + +**`Example`** + +```ts +import { isNumber } from "effect/Predicate" + +assert.deepStrictEqual(isNumber(2), true) + +assert.deepStrictEqual(isNumber("2"), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isObject + +▸ **isObject**(`input`): input is object + +Tests if a value is an `object`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is object + +**`Example`** + +```ts +import { isObject } from "effect/Predicate" + +assert.deepStrictEqual(isObject({}), true) +assert.deepStrictEqual(isObject([]), true) + +assert.deepStrictEqual(isObject(null), false) +assert.deepStrictEqual(isObject(undefined), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isPromise + +▸ **isPromise**(`input`): input is Promise\ + +A guard that succeeds when the input is a Promise. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is Promise\ + +**`Example`** + +```ts +import { isPromise } from "effect/Predicate" + +assert.deepStrictEqual(isPromise({}), false) +assert.deepStrictEqual(isPromise(Promise.resolve("hello")), true) +``` + +**`Since`** + +2.0.0 + +___ + +### isReadonlyRecord + +▸ **isReadonlyRecord**(`input`): input is Object + +A guard that succeeds when the input is a readonly record. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is Object + +**`Example`** + +```ts +import { isReadonlyRecord } from "effect/Predicate" + +assert.deepStrictEqual(isReadonlyRecord({}), true) +assert.deepStrictEqual(isReadonlyRecord({ a: 1 }), true) + +assert.deepStrictEqual(isReadonlyRecord([]), false) +assert.deepStrictEqual(isReadonlyRecord([1, 2, 3]), false) +assert.deepStrictEqual(isReadonlyRecord(null), false) +assert.deepStrictEqual(isReadonlyRecord(undefined), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isRecord + +▸ **isRecord**(`input`): input is Object + +A guard that succeeds when the input is a record. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is Object + +**`Example`** + +```ts +import { isRecord } from "effect/Predicate" + +assert.deepStrictEqual(isRecord({}), true) +assert.deepStrictEqual(isRecord({ a: 1 }), true) + +assert.deepStrictEqual(isRecord([]), false) +assert.deepStrictEqual(isRecord([1, 2, 3]), false) +assert.deepStrictEqual(isRecord(null), false) +assert.deepStrictEqual(isRecord(undefined), false) +assert.deepStrictEqual(isRecord(() => null), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isString + +▸ **isString**(`input`): input is string + +Tests if a value is a `string`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is string + +**`Example`** + +```ts +import { isString } from "effect/Predicate" + +assert.deepStrictEqual(isString("a"), true) + +assert.deepStrictEqual(isString(1), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isSymbol + +▸ **isSymbol**(`input`): input is symbol + +Tests if a value is a `symbol`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is symbol + +**`Example`** + +```ts +import { isSymbol } from "effect/Predicate" + +assert.deepStrictEqual(isSymbol(Symbol.for("a")), true) + +assert.deepStrictEqual(isSymbol("a"), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isTagged + +▸ **isTagged**\<`K`\>(`tag`): (`self`: `unknown`) => self is Object + +Tests if a value is an `object` with a property `_tag` that matches the given tag. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `K` | extends `string` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `tag` | `K` | The tag to test for. | + +#### Returns + +`fn` + +▸ (`self`): self is Object + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `self` | `unknown` | + +##### Returns + +self is Object + +**`Example`** + +```ts +import { isTagged } from "effect/Predicate" + +assert.deepStrictEqual(isTagged(1, "a"), false) +assert.deepStrictEqual(isTagged(null, "a"), false) +assert.deepStrictEqual(isTagged({}, "a"), false) +assert.deepStrictEqual(isTagged({ a: "a" }, "a"), false) +assert.deepStrictEqual(isTagged({ _tag: "a" }, "a"), true) +assert.deepStrictEqual(isTagged("a")({ _tag: "a" }), true) +``` + +**`Since`** + +2.0.0 + +▸ **isTagged**\<`K`\>(`self`, `tag`): self is Object + +Tests if a value is an `object` with a property `_tag` that matches the given tag. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `K` | extends `string` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `self` | `unknown` | - | +| `tag` | `K` | The tag to test for. | + +#### Returns + +self is Object + +**`Example`** + +```ts +import { isTagged } from "effect/Predicate" + +assert.deepStrictEqual(isTagged(1, "a"), false) +assert.deepStrictEqual(isTagged(null, "a"), false) +assert.deepStrictEqual(isTagged({}, "a"), false) +assert.deepStrictEqual(isTagged({ a: "a" }, "a"), false) +assert.deepStrictEqual(isTagged({ _tag: "a" }, "a"), true) +assert.deepStrictEqual(isTagged("a")({ _tag: "a" }), true) +``` + +**`Since`** + +2.0.0 + +___ + +### isUint8Array + +▸ **isUint8Array**(`input`): input is Uint8Array + +A guard that succeeds when the input is a `Uint8Array`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is Uint8Array + +**`Example`** + +```ts +import { isUint8Array } from "effect/Predicate" + +assert.deepStrictEqual(isUint8Array(new Uint8Array()), true) + +assert.deepStrictEqual(isUint8Array(null), false) +assert.deepStrictEqual(isUint8Array({}), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isUndefined + +▸ **isUndefined**(`input`): input is undefined + +Tests if a value is `undefined`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `unknown` | The value to test. | + +#### Returns + +input is undefined + +**`Example`** + +```ts +import { isUndefined } from "effect/Predicate" + +assert.deepStrictEqual(isUndefined(undefined), true) + +assert.deepStrictEqual(isUndefined(null), false) +assert.deepStrictEqual(isUndefined("undefined"), false) +``` + +**`Since`** + +2.0.0 + +___ + +### isUnknown + +▸ **isUnknown**(`input`): input is unknown + +A guard that always succeeds. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `input` | `unknown` | + +#### Returns + +input is unknown + +**`Example`** + +```ts +import { isUnknown } from "effect/Predicate" + +assert.deepStrictEqual(isUnknown(null), true) +assert.deepStrictEqual(isUnknown(undefined), true) + +assert.deepStrictEqual(isUnknown({}), true) +assert.deepStrictEqual(isUnknown([]), true) +``` + +**`Since`** + +2.0.0 diff --git a/packages/tools/docs/modules/Array.md b/packages/tools/docs/modules/Array.md index 349293fd6..416bcfbba 100644 --- a/packages/tools/docs/modules/Array.md +++ b/packages/tools/docs/modules/Array.md @@ -3288,9 +3288,9 @@ Check if a predicate holds true for every `ReadonlyArray` element. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -3324,9 +3324,9 @@ Check if a predicate holds true for every `ReadonlyArray` element. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -3361,10 +3361,10 @@ Check if a predicate holds true for every `ReadonlyArray` element. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | readonly `A`[] | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `self` | readonly `A`[] | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -3386,10 +3386,10 @@ Check if a predicate holds true for every `ReadonlyArray` element. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | readonly `A`[] | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `self` | readonly `A`[] | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -3417,9 +3417,9 @@ predicate, or `None` if no such element exists. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -3455,9 +3455,9 @@ predicate, or `None` if no such element exists. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -3493,10 +3493,10 @@ predicate, or `None` if no such element exists. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | `Iterable`\<`A`\> | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `self` | `Iterable`\<`A`\> | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -3519,10 +3519,10 @@ predicate, or `None` if no such element exists. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | `Iterable`\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `self` | `Iterable`\<`A`\> | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -3548,9 +3548,9 @@ Return the first index for which a predicate holds. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -3584,10 +3584,10 @@ Return the first index for which a predicate holds. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | `Iterable`\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `self` | `Iterable`\<`A`\> | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -3614,9 +3614,9 @@ Find the last element for which a predicate holds. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -3651,9 +3651,9 @@ Find the last element for which a predicate holds. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -3688,10 +3688,10 @@ Find the last element for which a predicate holds. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | `Iterable`\<`A`\> | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `self` | `Iterable`\<`A`\> | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -3713,10 +3713,10 @@ Find the last element for which a predicate holds. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | `Iterable`\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `self` | `Iterable`\<`A`\> | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -3742,9 +3742,9 @@ Return the last index for which a predicate holds. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -3778,10 +3778,10 @@ Return the last index for which a predicate holds. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | `Iterable`\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `self` | `Iterable`\<`A`\> | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -3836,9 +3836,9 @@ Check if a predicate holds true for some `ReadonlyArray` element. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -3872,10 +3872,10 @@ Check if a predicate holds true for some `ReadonlyArray` element. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | readonly `A`[] | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `self` | readonly `A`[] | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -5092,9 +5092,9 @@ Remove the longest initial subarray for which all element satisfy the specified #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -5128,10 +5128,10 @@ Remove the longest initial subarray for which all element satisfy the specified #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | `Iterable`\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `self` | `Iterable`\<`A`\> | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -5607,9 +5607,9 @@ Calculate the longest initial subarray for which all element satisfy the specifi #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -5644,9 +5644,9 @@ Calculate the longest initial subarray for which all element satisfy the specifi #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -5681,10 +5681,10 @@ Calculate the longest initial subarray for which all element satisfy the specifi #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | `Iterable`\<`A`\> | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `self` | `Iterable`\<`A`\> | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -5706,10 +5706,10 @@ Calculate the longest initial subarray for which all element satisfy the specifi #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | `Iterable`\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `self` | `Iterable`\<`A`\> | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -6221,9 +6221,9 @@ It is useful when you need to compare two arrays of the same type and you have a #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -6255,9 +6255,9 @@ It is useful when you need to compare two arrays of the same type and you have a #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -7048,9 +7048,9 @@ Split an `Iterable` into two parts: #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -7088,9 +7088,9 @@ Split an `Iterable` into two parts: #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -7128,10 +7128,10 @@ Split an `Iterable` into two parts: #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | `Iterable`\<`A`\> | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `self` | `Iterable`\<`A`\> | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -7156,10 +7156,10 @@ Split an `Iterable` into two parts: #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | `Iterable`\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `self` | `Iterable`\<`A`\> | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -7386,9 +7386,9 @@ Returns a tuple containing two arrays: the first one is before the match, and th #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -7423,10 +7423,10 @@ Returns a tuple containing two arrays: the first one is before the match, and th #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | `Iterable`\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `self` | `Iterable`\<`A`\> | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns diff --git a/packages/tools/docs/modules/Chunk.Chunk.md b/packages/tools/docs/modules/Chunk.Chunk.md deleted file mode 100644 index 3ff306252..000000000 --- a/packages/tools/docs/modules/Chunk.Chunk.md +++ /dev/null @@ -1,104 +0,0 @@ -[@eslint-react/tools](../README.md) / [Chunk](Chunk.md) / Chunk - -# Namespace: Chunk - -[Chunk](Chunk.md).Chunk - -**`Since`** - -2.0.0 - -## Table of contents - -### Type Aliases - -- [AndNonEmpty](Chunk.Chunk.md#andnonempty) -- [Flatten](Chunk.Chunk.md#flatten) -- [Infer](Chunk.Chunk.md#infer) -- [OrNonEmpty](Chunk.Chunk.md#ornonempty) -- [With](Chunk.Chunk.md#with) - -## Type Aliases - -### AndNonEmpty - -Ƭ **AndNonEmpty**\<`S`, `T`, `A`\>: `S` extends [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`any`\> ? `T` extends [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`any`\> ? [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> : [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> : [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------- | -| `S` | extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`any`\> | -| `T` | extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`any`\> | -| `A` | `A` | - ---- - -### Flatten - -Ƭ **Flatten**\<`T`\>: `T` extends [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\\> ? [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> : `T` extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\\> ? [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> : `never` - -**`Since`** - -2.0.0 - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `T` | extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`any`\>\> | - ---- - -### Infer - -Ƭ **Infer**\<`S`\>: `S` extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\ ? `A` : `never` - -**`Since`** - -2.0.0 - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------- | -| `S` | extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`any`\> | - ---- - -### OrNonEmpty - -Ƭ **OrNonEmpty**\<`S`, `T`, `A`\>: `S` extends [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`any`\> ? [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> : `T` extends [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`any`\> ? [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> : [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------- | -| `S` | extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`any`\> | -| `T` | extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`any`\> | -| `A` | `A` | - ---- - -### With - -Ƭ **With**\<`S`, `A`\>: `S` extends [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`any`\> ? [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> : [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------- | -| `S` | extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`any`\> | -| `A` | `A` | diff --git a/packages/tools/docs/modules/Chunk.md b/packages/tools/docs/modules/Chunk.md deleted file mode 100644 index c69885528..000000000 --- a/packages/tools/docs/modules/Chunk.md +++ /dev/null @@ -1,4860 +0,0 @@ -[@eslint-react/tools](../README.md) / Chunk - -# Namespace: Chunk - -## Table of contents - -### Namespaces - -- [Chunk](Chunk.Chunk.md) - -### Interfaces - -- [Chunk](../interfaces/Chunk.Chunk-1.md) -- [ChunkTypeLambda](../interfaces/Chunk.ChunkTypeLambda.md) -- [NonEmptyChunk](../interfaces/Chunk.NonEmptyChunk.md) - -### Type Aliases - -- [TypeId](Chunk.md#typeid) - -### Functions - -- [append](Chunk.md#append) -- [appendAll](Chunk.md#appendall) -- [chunksOf](Chunk.md#chunksof) -- [compact](Chunk.md#compact) -- [contains](Chunk.md#contains) -- [containsWith](Chunk.md#containswith) -- [dedupe](Chunk.md#dedupe) -- [dedupeAdjacent](Chunk.md#dedupeadjacent) -- [drop](Chunk.md#drop) -- [dropRight](Chunk.md#dropright) -- [dropWhile](Chunk.md#dropwhile) -- [empty](Chunk.md#empty) -- [every](Chunk.md#every) -- [filter](Chunk.md#filter) -- [filterMap](Chunk.md#filtermap) -- [filterMapWhile](Chunk.md#filtermapwhile) -- [findFirst](Chunk.md#findfirst) -- [findFirstIndex](Chunk.md#findfirstindex) -- [findLast](Chunk.md#findlast) -- [findLastIndex](Chunk.md#findlastindex) -- [flatMap](Chunk.md#flatmap) -- [flatten](Chunk.md#flatten) -- [forEach](Chunk.md#foreach) -- [fromIterable](Chunk.md#fromiterable) -- [get](Chunk.md#get) -- [getEquivalence](Chunk.md#getequivalence) -- [head](Chunk.md#head) -- [headNonEmpty](Chunk.md#headnonempty) -- [intersection](Chunk.md#intersection) -- [isChunk](Chunk.md#ischunk) -- [isEmpty](Chunk.md#isempty) -- [isNonEmpty](Chunk.md#isnonempty) -- [join](Chunk.md#join) -- [last](Chunk.md#last) -- [make](Chunk.md#make) -- [makeBy](Chunk.md#makeby) -- [map](Chunk.md#map) -- [mapAccum](Chunk.md#mapaccum) -- [modify](Chunk.md#modify) -- [modifyOption](Chunk.md#modifyoption) -- [of](Chunk.md#of) -- [partition](Chunk.md#partition) -- [partitionMap](Chunk.md#partitionmap) -- [prepend](Chunk.md#prepend) -- [prependAll](Chunk.md#prependall) -- [range](Chunk.md#range) -- [reduce](Chunk.md#reduce) -- [reduceRight](Chunk.md#reduceright) -- [remove](Chunk.md#remove) -- [replace](Chunk.md#replace) -- [replaceOption](Chunk.md#replaceoption) -- [reverse](Chunk.md#reverse) -- [separate](Chunk.md#separate) -- [size](Chunk.md#size) -- [some](Chunk.md#some) -- [sort](Chunk.md#sort) -- [sortWith](Chunk.md#sortwith) -- [split](Chunk.md#split) -- [splitAt](Chunk.md#splitat) -- [splitNonEmptyAt](Chunk.md#splitnonemptyat) -- [splitWhere](Chunk.md#splitwhere) -- [tail](Chunk.md#tail) -- [tailNonEmpty](Chunk.md#tailnonempty) -- [take](Chunk.md#take) -- [takeRight](Chunk.md#takeright) -- [takeWhile](Chunk.md#takewhile) -- [toArray](Chunk.md#toarray) -- [toReadonlyArray](Chunk.md#toreadonlyarray) -- [union](Chunk.md#union) -- [unsafeFromArray](Chunk.md#unsafefromarray) -- [unsafeFromNonEmptyArray](Chunk.md#unsafefromnonemptyarray) -- [unsafeGet](Chunk.md#unsafeget) -- [unsafeHead](Chunk.md#unsafehead) -- [unsafeLast](Chunk.md#unsafelast) -- [unzip](Chunk.md#unzip) -- [zip](Chunk.md#zip) -- [zipWith](Chunk.md#zipwith) - -## Other - -### drop - -▸ **drop**(`n`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Drops the first up to `n` elements from the chunk - -#### Parameters - -| Name | Type | -| :--- | :------- | -| `n` | `number` | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - -▸ **drop**\<`A`\>(`self`, `n`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Drops the first up to `n` elements from the chunk - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `n` | `number` | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### dropRight - -▸ **dropRight**(`n`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Drops the last `n` elements. - -#### Parameters - -| Name | Type | -| :--- | :------- | -| `n` | `number` | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - -▸ **dropRight**\<`A`\>(`self`, `n`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Drops the last `n` elements. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `n` | `number` | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### dropWhile - -▸ **dropWhile**\<`B`, `A`\>(`predicate`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -Drops all elements so long as the predicate returns true. - -#### Type parameters - -| Name | Type | -| :--- | :--- | -| `B` | `B` | -| `A` | `B` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **dropWhile**\<`A`\>(`self`, `predicate`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Drops all elements so long as the predicate returns true. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### modify - -▸ **modify**\<`A`, `B`\>(`i`, `f`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -Apply a function to the element at the specified index, creating a new `Chunk`, -or returning the input if the index is out of bounds. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :--- | :---------------- | -| `i` | `number` | -| `f` | (`a`: `A`) => `B` | - -#### Returns - -`fn` - -▸ (`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -**`Since`** - -2.0.0 - -▸ **modify**\<`A`, `B`\>(`self`, `i`, `f`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -Apply a function to the element at the specified index, creating a new `Chunk`, -or returning the input if the index is out of bounds. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `i` | `number` | -| `f` | (`a`: `A`) => `B` | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -**`Since`** - -2.0.0 - ---- - -### modifyOption - -▸ **modifyOption**\<`A`, `B`\>(`i`, `f`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Option`](O.md#option)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\>\> - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :--- | :---------------- | -| `i` | `number` | -| `f` | (`a`: `A`) => `B` | - -#### Returns - -`fn` - -▸ (`self`): [`Option`](O.md#option)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\>\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Option`](O.md#option)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\>\> - -**`Since`** - -2.0.0 - -▸ **modifyOption**\<`A`, `B`\>(`self`, `i`, `f`): [`Option`](O.md#option)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\>\> - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `i` | `number` | -| `f` | (`a`: `A`) => `B` | - -#### Returns - -[`Option`](O.md#option)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\>\> - -**`Since`** - -2.0.0 - ---- - -### remove - -▸ **remove**(`i`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Delete the element at the specified index, creating a new `Chunk`, -or returning the input if the index is out of bounds. - -#### Parameters - -| Name | Type | -| :--- | :------- | -| `i` | `number` | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - -▸ **remove**\<`A`\>(`self`, `i`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Delete the element at the specified index, creating a new `Chunk`, -or returning the input if the index is out of bounds. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `i` | `number` | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### replace - -▸ **replace**\<`B`\>(`i`, `b`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B` \| `A`\> - -Change the element at the specified index, creating a new `Chunk`, -or returning the input if the index is out of bounds. - -#### Type parameters - -| Name | -| :--- | -| `B` | - -#### Parameters - -| Name | Type | -| :--- | :------- | -| `i` | `number` | -| `b` | `B` | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B` \| `A`\> - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B` \| `A`\> - -**`Since`** - -2.0.0 - -▸ **replace**\<`A`, `B`\>(`self`, `i`, `b`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -Change the element at the specified index, creating a new `Chunk`, -or returning the input if the index is out of bounds. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `i` | `number` | -| `b` | `B` | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -**`Since`** - -2.0.0 - ---- - -### replaceOption - -▸ **replaceOption**\<`B`\>(`i`, `b`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Option`](O.md#option)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B` \| `A`\>\> - -#### Type parameters - -| Name | -| :--- | -| `B` | - -#### Parameters - -| Name | Type | -| :--- | :------- | -| `i` | `number` | -| `b` | `B` | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [`Option`](O.md#option)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B` \| `A`\>\> - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Option`](O.md#option)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B` \| `A`\>\> - -**`Since`** - -2.0.0 - -▸ **replaceOption**\<`A`, `B`\>(`self`, `i`, `b`): [`Option`](O.md#option)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\>\> - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `i` | `number` | -| `b` | `B` | - -#### Returns - -[`Option`](O.md#option)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\>\> - -**`Since`** - -2.0.0 - ---- - -### take - -▸ **take**(`n`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Takes the first up to `n` elements from the chunk - -#### Parameters - -| Name | Type | -| :--- | :------- | -| `n` | `number` | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - -▸ **take**\<`A`\>(`self`, `n`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Takes the first up to `n` elements from the chunk - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `n` | `number` | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - -## combinators - -### forEach - -▸ **forEach**\<`A`, `B`\>(`f`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => `void` - -Applies the specified function to each element of the `List`. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :--- | :---------------- | -| `f` | (`a`: `A`) => `B` | - -#### Returns - -`fn` - -▸ (`self`): `void` - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -`void` - -**`Since`** - -2.0.0 - -▸ **forEach**\<`A`, `B`\>(`self`, `f`): `void` - -Applies the specified function to each element of the `List`. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `f` | (`a`: `A`) => `B` | - -#### Returns - -`void` - -**`Since`** - -2.0.0 - -## concatenating - -### append - -▸ **append**\<`A2`\>(`a`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A2` \| `A`\> - -Appends the specified element to the end of the `Chunk`. - -#### Type parameters - -| Name | -| :--- | -| `A2` | - -#### Parameters - -| Name | Type | -| :--- | :--- | -| `a` | `A2` | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A2` \| `A`\> - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A2` \| `A`\> - -**`Since`** - -2.0.0 - -▸ **append**\<`A`, `A2`\>(`self`, `a`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A` \| `A2`\> - -Appends the specified element to the end of the `Chunk`. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `A2` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `a` | `A2` | - -#### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A` \| `A2`\> - -**`Since`** - -2.0.0 - ---- - -### appendAll - -▸ **appendAll**\<`S`, `T`\>(`that`): (`self`: `S`) => [`OrNonEmpty`](Chunk.Chunk.md#ornonempty)\<`S`, `T`, [`Infer`](Chunk.Chunk.md#infer)\<`S`\> \| [`Infer`](Chunk.Chunk.md#infer)\<`T`\>\> - -Concatenates two chunks, combining their elements. -If either chunk is non-empty, the result is also a non-empty chunk. - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------- | -| `S` | extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`any`\> | -| `T` | extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`any`\> | - -#### Parameters - -| Name | Type | -| :----- | :--- | -| `that` | `T` | - -#### Returns - -`fn` - -▸ (`self`): [`OrNonEmpty`](Chunk.Chunk.md#ornonempty)\<`S`, `T`, [`Infer`](Chunk.Chunk.md#infer)\<`S`\> \| [`Infer`](Chunk.Chunk.md#infer)\<`T`\>\> - -##### Parameters - -| Name | Type | -| :----- | :--- | -| `self` | `S` | - -##### Returns - -[`OrNonEmpty`](Chunk.Chunk.md#ornonempty)\<`S`, `T`, [`Infer`](Chunk.Chunk.md#infer)\<`S`\> \| [`Infer`](Chunk.Chunk.md#infer)\<`T`\>\> - -**`Example`** - -```ts -import * as Chunk from "effect/Chunk"; - -assert.deepStrictEqual( - Chunk.make(1, 2).pipe(Chunk.appendAll(Chunk.make("a", "b")), Chunk.toArray), - [1, 2, "a", "b"], -); -``` - -**`Since`** - -2.0.0 - -▸ **appendAll**\<`A`, `B`\>(`self`, `that`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A` \| `B`\> - -Concatenates two chunks, combining their elements. -If either chunk is non-empty, the result is also a non-empty chunk. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `that` | [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`B`\> | - -#### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A` \| `B`\> - -**`Example`** - -```ts -import * as Chunk from "effect/Chunk"; - -assert.deepStrictEqual( - Chunk.make(1, 2).pipe(Chunk.appendAll(Chunk.make("a", "b")), Chunk.toArray), - [1, 2, "a", "b"], -); -``` - -**`Since`** - -2.0.0 - -▸ **appendAll**\<`A`, `B`\>(`self`, `that`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A` \| `B`\> - -Concatenates two chunks, combining their elements. -If either chunk is non-empty, the result is also a non-empty chunk. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------------------- | -| `self` | [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> | -| `that` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -#### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A` \| `B`\> - -**`Example`** - -```ts -import * as Chunk from "effect/Chunk"; - -assert.deepStrictEqual( - Chunk.make(1, 2).pipe(Chunk.appendAll(Chunk.make("a", "b")), Chunk.toArray), - [1, 2, "a", "b"], -); -``` - -**`Since`** - -2.0.0 - -▸ **appendAll**\<`A`, `B`\>(`self`, `that`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -Concatenates two chunks, combining their elements. -If either chunk is non-empty, the result is also a non-empty chunk. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `that` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -**`Example`** - -```ts -import * as Chunk from "effect/Chunk"; - -assert.deepStrictEqual( - Chunk.make(1, 2).pipe(Chunk.appendAll(Chunk.make("a", "b")), Chunk.toArray), - [1, 2, "a", "b"], -); -``` - -**`Since`** - -2.0.0 - ---- - -### prepend - -▸ **prepend**\<`B`\>(`elem`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`B` \| `A`\> - -Prepend an element to the front of a `Chunk`, creating a new `NonEmptyChunk`. - -#### Type parameters - -| Name | -| :--- | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :--- | -| `elem` | `B` | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`B` \| `A`\> - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`B` \| `A`\> - -**`Since`** - -2.0.0 - -▸ **prepend**\<`A`, `B`\>(`self`, `elem`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A` \| `B`\> - -Prepend an element to the front of a `Chunk`, creating a new `NonEmptyChunk`. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `elem` | `B` | - -#### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A` \| `B`\> - -**`Since`** - -2.0.0 - ---- - -### prependAll - -▸ **prependAll**\<`S`, `T`\>(`that`): (`self`: `S`) => [`OrNonEmpty`](Chunk.Chunk.md#ornonempty)\<`S`, `T`, [`Infer`](Chunk.Chunk.md#infer)\<`S`\> \| [`Infer`](Chunk.Chunk.md#infer)\<`T`\>\> - -Prepends the specified prefix chunk to the beginning of the specified chunk. -If either chunk is non-empty, the result is also a non-empty chunk. - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------- | -| `S` | extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`any`\> | -| `T` | extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`any`\> | - -#### Parameters - -| Name | Type | -| :----- | :--- | -| `that` | `T` | - -#### Returns - -`fn` - -▸ (`self`): [`OrNonEmpty`](Chunk.Chunk.md#ornonempty)\<`S`, `T`, [`Infer`](Chunk.Chunk.md#infer)\<`S`\> \| [`Infer`](Chunk.Chunk.md#infer)\<`T`\>\> - -##### Parameters - -| Name | Type | -| :----- | :--- | -| `self` | `S` | - -##### Returns - -[`OrNonEmpty`](Chunk.Chunk.md#ornonempty)\<`S`, `T`, [`Infer`](Chunk.Chunk.md#infer)\<`S`\> \| [`Infer`](Chunk.Chunk.md#infer)\<`T`\>\> - -**`Example`** - -```ts -import * as Chunk from "effect/Chunk"; - -assert.deepStrictEqual( - Chunk.make(1, 2).pipe(Chunk.prependAll(Chunk.make("a", "b")), Chunk.toArray), - ["a", "b", 1, 2], -); -``` - -**`Since`** - -2.0.0 - -▸ **prependAll**\<`A`, `B`\>(`self`, `that`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A` \| `B`\> - -Prepends the specified prefix chunk to the beginning of the specified chunk. -If either chunk is non-empty, the result is also a non-empty chunk. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `that` | [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`B`\> | - -#### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A` \| `B`\> - -**`Example`** - -```ts -import * as Chunk from "effect/Chunk"; - -assert.deepStrictEqual( - Chunk.make(1, 2).pipe(Chunk.prependAll(Chunk.make("a", "b")), Chunk.toArray), - ["a", "b", 1, 2], -); -``` - -**`Since`** - -2.0.0 - -▸ **prependAll**\<`A`, `B`\>(`self`, `that`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A` \| `B`\> - -Prepends the specified prefix chunk to the beginning of the specified chunk. -If either chunk is non-empty, the result is also a non-empty chunk. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------------------- | -| `self` | [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> | -| `that` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -#### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A` \| `B`\> - -**`Example`** - -```ts -import * as Chunk from "effect/Chunk"; - -assert.deepStrictEqual( - Chunk.make(1, 2).pipe(Chunk.prependAll(Chunk.make("a", "b")), Chunk.toArray), - ["a", "b", 1, 2], -); -``` - -**`Since`** - -2.0.0 - -▸ **prependAll**\<`A`, `B`\>(`self`, `that`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -Prepends the specified prefix chunk to the beginning of the specified chunk. -If either chunk is non-empty, the result is also a non-empty chunk. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `that` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -**`Example`** - -```ts -import * as Chunk from "effect/Chunk"; - -assert.deepStrictEqual( - Chunk.make(1, 2).pipe(Chunk.prependAll(Chunk.make("a", "b")), Chunk.toArray), - ["a", "b", 1, 2], -); -``` - -**`Since`** - -2.0.0 - -## constructors - -### empty - -▸ **empty**\<`A`\>(): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -#### Type parameters - -| Name | Type | -| :--- | :------ | -| `A` | `never` | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### fromIterable - -▸ **fromIterable**\<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Creates a new `Chunk` from an iterable collection of values. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :---------------- | -| `self` | `Iterable`\<`A`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### isChunk - -▸ **isChunk**\<`A`\>(`u`): u is Chunk\ - -Checks if `u` is a `Chunk` - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :--- | :---------------- | -| `u` | `Iterable`\<`A`\> | - -#### Returns - -u is Chunk\ - -**`Since`** - -2.0.0 - -▸ **isChunk**(`u`): u is Chunk\ - -Checks if `u` is a `Chunk` - -#### Parameters - -| Name | Type | -| :--- | :-------- | -| `u` | `unknown` | - -#### Returns - -u is Chunk\ - -**`Since`** - -2.0.0 - ---- - -### make - -▸ **make**\<`As`\>(`...as`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`As`[`number`]\> - -Builds a `NonEmptyChunk` from an non-empty collection of elements. - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------ | -| `As` | extends readonly [`any`, `any`] | - -#### Parameters - -| Name | Type | -| :------ | :--- | -| `...as` | `As` | - -#### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`As`[`number`]\> - -**`Since`** - -2.0.0 - ---- - -### makeBy - -▸ **makeBy**\<`A`\>(`f`): (`n`: `number`) => [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> - -Return a Chunk of length n with element i initialized with f(i). - -**Note**. `n` is normalized to an integer >= 1. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :--- | :--------------------- | -| `f` | (`i`: `number`) => `A` | - -#### Returns - -`fn` - -▸ (`n`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> - -##### Parameters - -| Name | Type | -| :--- | :------- | -| `n` | `number` | - -##### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> - -**`Since`** - -2.0.0 - -▸ **makeBy**\<`A`\>(`n`, `f`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> - -Return a Chunk of length n with element i initialized with f(i). - -**Note**. `n` is normalized to an integer >= 1. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :--- | :--------------------- | -| `n` | `number` | -| `f` | (`i`: `number`) => `A` | - -#### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### of - -▸ **of**\<`A`\>(`a`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> - -Builds a `NonEmptyChunk` from a single element. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :--- | :--- | -| `a` | `A` | - -#### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### range - -▸ **range**(`start`, `end`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`number`\> - -Create a non empty `Chunk` containing a range of integers, including both endpoints. - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `start` | `number` | -| `end` | `number` | - -#### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`number`\> - -**`Since`** - -2.0.0 - -## conversions - -### toArray - -▸ **toArray**\<`A`\>(`self`): `A`[] - -Converts the specified `Chunk` to a `Array`. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -#### Returns - -`A`[] - -**`Since`** - -2.0.0 - ---- - -### toReadonlyArray - -▸ **toReadonlyArray**\<`A`\>(`self`): readonly `A`[] - -Converts the specified `Chunk` to a `ReadonlyArray`. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -#### Returns - -readonly `A`[] - -**`Since`** - -2.0.0 - -## elements - -### chunksOf - -▸ **chunksOf**(`n`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>\> - -Groups elements in chunks of up to `n` elements. - -#### Parameters - -| Name | Type | -| :--- | :------- | -| `n` | `number` | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>\> - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>\> - -**`Since`** - -2.0.0 - -▸ **chunksOf**\<`A`\>(`self`, `n`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>\> - -Groups elements in chunks of up to `n` elements. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `n` | `number` | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>\> - -**`Since`** - -2.0.0 - ---- - -### contains - -▸ **contains**\<`A`\>(`a`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => `boolean` - -Returns a function that checks if a `Chunk` contains a given value using the default `Equivalence`. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :--- | :--- | -| `a` | `A` | - -#### Returns - -`fn` - -▸ (`self`): `boolean` - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -`boolean` - -**`Since`** - -2.0.0 - -▸ **contains**\<`A`\>(`self`, `a`): `boolean` - -Returns a function that checks if a `Chunk` contains a given value using the default `Equivalence`. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `a` | `A` | - -#### Returns - -`boolean` - -**`Since`** - -2.0.0 - ---- - -### containsWith - -▸ **containsWith**\<`A`\>(`isEquivalent`): (`a`: `A`) => (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => `boolean`(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>, `a`: `A`) => `boolean` - -Returns a function that checks if a `Chunk` contains a given value using a provided `isEquivalent` function. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :------------- | :-------------------------------------- | -| `isEquivalent` | (`self`: `A`, `that`: `A`) => `boolean` | - -#### Returns - -`fn` - -▸ (`a`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => `boolean` - -##### Parameters - -| Name | Type | -| :--- | :--- | -| `a` | `A` | - -##### Returns - -`fn` - -▸ (`self`): `boolean` - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -`boolean` - -▸ (`self`, `a`): `boolean` - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `a` | `A` | - -##### Returns - -`boolean` - -**`Since`** - -2.0.0 - ---- - -### dedupe - -▸ **dedupe**\<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Remove duplicates from an array, keeping the first occurrence of an element. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### every - -▸ **every**\<`A`, `B`\>(`refinement`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => self is Chunk\ - -Check if a predicate holds true for every `Chunk` element. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | - -#### Returns - -`fn` - -▸ (`self`): self is Chunk\ - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -self is Chunk\ - -**`Since`** - -2.0.0 - -▸ **every**\<`A`\>(`predicate`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => `boolean` - -Check if a predicate holds true for every `Chunk` element. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`fn` - -▸ (`self`): `boolean` - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -`boolean` - -**`Since`** - -2.0.0 - -▸ **every**\<`A`, `B`\>(`self`, `refinement`): self is Chunk\ - -Check if a predicate holds true for every `Chunk` element. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | - -#### Returns - -self is Chunk\ - -**`Since`** - -2.0.0 - -▸ **every**\<`A`\>(`self`, `predicate`): `boolean` - -Check if a predicate holds true for every `Chunk` element. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`boolean` - -**`Since`** - -2.0.0 - ---- - -### findFirst - -▸ **findFirst**\<`A`, `B`\>(`refinement`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Option`](O.md#option)\<`B`\> - -Returns the first element that satisfies the specified -predicate, or `None` if no such element exists. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Option`](O.md#option)\<`B`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Option`](O.md#option)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **findFirst**\<`B`, `A`\>(`predicate`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>) => [`Option`](O.md#option)\<`B`\> - -Returns the first element that satisfies the specified -predicate, or `None` if no such element exists. - -#### Type parameters - -| Name | Type | -| :--- | :--- | -| `B` | `B` | -| `A` | `B` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Option`](O.md#option)\<`B`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -##### Returns - -[`Option`](O.md#option)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **findFirst**\<`A`, `B`\>(`self`, `refinement`): [`Option`](O.md#option)\<`B`\> - -Returns the first element that satisfies the specified -predicate, or `None` if no such element exists. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | - -#### Returns - -[`Option`](O.md#option)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **findFirst**\<`A`\>(`self`, `predicate`): [`Option`](O.md#option)\<`A`\> - -Returns the first element that satisfies the specified -predicate, or `None` if no such element exists. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -[`Option`](O.md#option)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### findFirstIndex - -▸ **findFirstIndex**\<`A`\>(`predicate`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Option`](O.md#option)\<`number`\> - -Return the first index for which a predicate holds. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Option`](O.md#option)\<`number`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Option`](O.md#option)\<`number`\> - -**`Since`** - -2.0.0 - -▸ **findFirstIndex**\<`A`\>(`self`, `predicate`): [`Option`](O.md#option)\<`number`\> - -Return the first index for which a predicate holds. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -[`Option`](O.md#option)\<`number`\> - -**`Since`** - -2.0.0 - ---- - -### findLast - -▸ **findLast**\<`A`, `B`\>(`refinement`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Option`](O.md#option)\<`B`\> - -Find the last element for which a predicate holds. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Option`](O.md#option)\<`B`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Option`](O.md#option)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **findLast**\<`B`, `A`\>(`predicate`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>) => [`Option`](O.md#option)\<`B`\> - -Find the last element for which a predicate holds. - -#### Type parameters - -| Name | Type | -| :--- | :--- | -| `B` | `B` | -| `A` | `B` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Option`](O.md#option)\<`B`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -##### Returns - -[`Option`](O.md#option)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **findLast**\<`A`, `B`\>(`self`, `refinement`): [`Option`](O.md#option)\<`B`\> - -Find the last element for which a predicate holds. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | - -#### Returns - -[`Option`](O.md#option)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **findLast**\<`A`\>(`self`, `predicate`): [`Option`](O.md#option)\<`A`\> - -Find the last element for which a predicate holds. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -[`Option`](O.md#option)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### findLastIndex - -▸ **findLastIndex**\<`A`\>(`predicate`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Option`](O.md#option)\<`number`\> - -Return the last index for which a predicate holds. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Option`](O.md#option)\<`number`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Option`](O.md#option)\<`number`\> - -**`Since`** - -2.0.0 - -▸ **findLastIndex**\<`A`\>(`self`, `predicate`): [`Option`](O.md#option)\<`number`\> - -Return the last index for which a predicate holds. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -[`Option`](O.md#option)\<`number`\> - -**`Since`** - -2.0.0 - ---- - -### get - -▸ **get**(`index`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Option`](O.md#option)\<`A`\> - -This function provides a safe way to read a value at a particular index from a `Chunk`. - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `index` | `number` | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [`Option`](O.md#option)\<`A`\> - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Option`](O.md#option)\<`A`\> - -**`Since`** - -2.0.0 - -▸ **get**\<`A`\>(`self`, `index`): [`Option`](O.md#option)\<`A`\> - -This function provides a safe way to read a value at a particular index from a `Chunk`. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :------ | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `index` | `number` | - -#### Returns - -[`Option`](O.md#option)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### head - -▸ **head**\<`A`\>(`self`): [`Option`](O.md#option)\<`A`\> - -Returns the first element of this chunk if it exists. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -#### Returns - -[`Option`](O.md#option)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### headNonEmpty - -▸ **headNonEmpty**\<`A`\>(`self`): `A` - -Returns the first element of this non empty chunk. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------------------- | -| `self` | [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> | - -#### Returns - -`A` - -**`Since`** - -2.0.0 - ---- - -### intersection - -▸ **intersection**\<`A`\>(`that`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` & `B`\> - -Creates a Chunk of unique values that are included in all given Chunks. - -The order and references of result values are determined by the Chunk. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `that` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -#### Returns - -`fn` - -▸ \<`B`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` & `B`\> - -##### Type parameters - -| Name | -| :--- | -| `B` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` & `B`\> - -**`Since`** - -2.0.0 - -▸ **intersection**\<`A`, `B`\>(`self`, `that`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` & `B`\> - -Creates a Chunk of unique values that are included in all given Chunks. - -The order and references of result values are determined by the Chunk. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `that` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` & `B`\> - -**`Since`** - -2.0.0 - ---- - -### isEmpty - -▸ **isEmpty**\<`A`\>(`self`): `boolean` - -Determines if the chunk is empty. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -#### Returns - -`boolean` - -**`Since`** - -2.0.0 - ---- - -### isNonEmpty - -▸ **isNonEmpty**\<`A`\>(`self`): self is NonEmptyChunk\ - -Determines if the chunk is not empty. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -#### Returns - -self is NonEmptyChunk\ - -**`Since`** - -2.0.0 - ---- - -### last - -▸ **last**\<`A`\>(`self`): [`Option`](O.md#option)\<`A`\> - -Returns the last element of this chunk if it exists. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -#### Returns - -[`Option`](O.md#option)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### reverse - -▸ **reverse**\<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### size - -▸ **size**\<`A`\>(`self`): `number` - -Retireves the size of the chunk - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -#### Returns - -`number` - -**`Since`** - -2.0.0 - ---- - -### some - -▸ **some**\<`B`, `A`\>(`predicate`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>) => self is NonEmptyChunk\ - -Check if a predicate holds true for some `Chunk` element. - -#### Type parameters - -| Name | Type | -| :--- | :--- | -| `B` | `B` | -| `A` | `B` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`fn` - -▸ (`self`): self is NonEmptyChunk\ - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -##### Returns - -self is NonEmptyChunk\ - -**`Since`** - -2.0.0 - -▸ **some**\<`A`\>(`self`, `predicate`): self is NonEmptyChunk\ - -Check if a predicate holds true for some `Chunk` element. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -self is NonEmptyChunk\ - -**`Since`** - -2.0.0 - ---- - -### tail - -▸ **tail**\<`A`\>(`self`): [`Option`](O.md#option)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>\> - -Returns every elements after the first. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -#### Returns - -[`Option`](O.md#option)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>\> - -**`Since`** - -2.0.0 - ---- - -### tailNonEmpty - -▸ **tailNonEmpty**\<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Returns every elements after the first. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------------------- | -| `self` | [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### takeRight - -▸ **takeRight**(`n`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Takes the last `n` elements. - -#### Parameters - -| Name | Type | -| :--- | :------- | -| `n` | `number` | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - -▸ **takeRight**\<`A`\>(`self`, `n`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Takes the last `n` elements. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `n` | `number` | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### takeWhile - -▸ **takeWhile**\<`A`, `B`\>(`refinement`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -Takes all elements so long as the predicate returns true. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **takeWhile**\<`B`, `A`\>(`predicate`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -Takes all elements so long as the predicate returns true. - -#### Type parameters - -| Name | Type | -| :--- | :--- | -| `B` | `B` | -| `A` | `B` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **takeWhile**\<`A`, `B`\>(`self`, `refinement`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -Takes all elements so long as the predicate returns true. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **takeWhile**\<`A`\>(`self`, `predicate`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Takes all elements so long as the predicate returns true. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### union - -▸ **union**\<`A`\>(`that`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -Creates a Chunks of unique values, in order, from all given Chunks. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `that` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -#### Returns - -`fn` - -▸ \<`B`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -##### Type parameters - -| Name | -| :--- | -| `B` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -**`Since`** - -2.0.0 - -▸ **union**\<`A`, `B`\>(`self`, `that`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -Creates a Chunks of unique values, in order, from all given Chunks. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `that` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A` \| `B`\> - -**`Since`** - -2.0.0 - ---- - -### unzip - -▸ **unzip**\<`A`, `B`\>(`self`): [[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>, [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>] - -Takes a `Chunk` of pairs and return two corresponding `Chunk`s. - -Note: The function is reverse of `zip`. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :--------------------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\ | - -#### Returns - -[[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>, [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>] - -**`Since`** - -2.0.0 - -## equivalence - -### getEquivalence - -▸ **getEquivalence**\<`A`\>(`isEquivalent`): `Equivalence`\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>\> - -Compares the two chunks of equal length using the specified function - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :------------- | :------------------- | -| `isEquivalent` | `Equivalence`\<`A`\> | - -#### Returns - -`Equivalence`\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>\> - -**`Since`** - -2.0.0 - -## filtering - -### compact - -▸ **compact**\<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Filter out optional values - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :-------------------------------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`Option`](O.md#option)\<`A`\>\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### dedupeAdjacent - -▸ **dedupeAdjacent**\<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Deduplicates adjacent elements that are identical. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### filter - -▸ **filter**\<`A`, `B`\>(`refinement`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -Returns a filtered and mapped subset of the elements. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **filter**\<`B`, `A`\>(`predicate`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -Returns a filtered and mapped subset of the elements. - -#### Type parameters - -| Name | Type | -| :--- | :--- | -| `B` | `B` | -| `A` | `B` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **filter**\<`A`, `B`\>(`self`, `refinement`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -Returns a filtered and mapped subset of the elements. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **filter**\<`A`\>(`self`, `predicate`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Returns a filtered and mapped subset of the elements. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### filterMap - -▸ **filterMap**\<`A`, `B`\>(`f`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -Returns a filtered and mapped subset of the elements. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :--- | :---------------------------------------------------------- | -| `f` | (`a`: `A`, `i`: `number`) => [`Option`](O.md#option)\<`B`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **filterMap**\<`A`, `B`\>(`self`, `f`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -Returns a filtered and mapped subset of the elements. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :---------------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `f` | (`a`: `A`, `i`: `number`) => [`Option`](O.md#option)\<`B`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -**`Since`** - -2.0.0 - ---- - -### filterMapWhile - -▸ **filterMapWhile**\<`A`, `B`\>(`f`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -Transforms all elements of the chunk for as long as the specified function returns some value - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :--- | :------------------------------------------- | -| `f` | (`a`: `A`) => [`Option`](O.md#option)\<`B`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **filterMapWhile**\<`A`, `B`\>(`self`, `f`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -Transforms all elements of the chunk for as long as the specified function returns some value - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `f` | (`a`: `A`) => [`Option`](O.md#option)\<`B`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -**`Since`** - -2.0.0 - ---- - -### partition - -▸ **partition**\<`C`, `B`, `A`\>(`refinement`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`C`\>) => [excluded: Chunk\\>, satisfying: Chunk\] - -Separate elements based on a predicate that also exposes the index of the element. - -#### Type parameters - -| Name | Type | -| :--- | :--- | -| `C` | `C` | -| `B` | `B` | -| `A` | `C` | - -#### Parameters - -| Name | Type | -| :----------- | :---------------------------------- | -| `refinement` | (`a`: `A`, `i`: `number`) => a is B | - -#### Returns - -`fn` - -▸ (`self`): [excluded: Chunk\\>, satisfying: Chunk\] - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`C`\> | - -##### Returns - -[excluded: Chunk\\>, satisfying: Chunk\] - -**`Since`** - -2.0.0 - -▸ **partition**\<`B`, `A`\>(`predicate`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>) => [excluded: Chunk\, satisfying: Chunk\] - -Separate elements based on a predicate that also exposes the index of the element. - -#### Type parameters - -| Name | Type | -| :--- | :--- | -| `B` | `B` | -| `A` | `B` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------- | -| `predicate` | (`a`: `A`, `i`: `number`) => `boolean` | - -#### Returns - -`fn` - -▸ (`self`): [excluded: Chunk\, satisfying: Chunk\] - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -##### Returns - -[excluded: Chunk\, satisfying: Chunk\] - -**`Since`** - -2.0.0 - -▸ **partition**\<`A`, `B`\>(`self`, `refinement`): [excluded: Chunk\\>, satisfying: Chunk\] - -Separate elements based on a predicate that also exposes the index of the element. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----------- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `refinement` | (`a`: `A`, `i`: `number`) => a is B | - -#### Returns - -[excluded: Chunk\\>, satisfying: Chunk\] - -**`Since`** - -2.0.0 - -▸ **partition**\<`A`\>(`self`, `predicate`): [excluded: Chunk\, satisfying: Chunk\] - -Separate elements based on a predicate that also exposes the index of the element. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :---------- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `predicate` | (`a`: `A`, `i`: `number`) => `boolean` | - -#### Returns - -[excluded: Chunk\, satisfying: Chunk\] - -**`Since`** - -2.0.0 - ---- - -### partitionMap - -▸ **partitionMap**\<`A`, `B`, `C`\>(`f`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [left: Chunk\, right: Chunk\] - -Partitions the elements of this chunk into two chunks using f. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | - -#### Parameters - -| Name | Type | -| :--- | :------------------------------------------------ | -| `f` | (`a`: `A`) => [`Either`](E.md#either)\<`B`, `C`\> | - -#### Returns - -`fn` - -▸ (`self`): [left: Chunk\, right: Chunk\] - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[left: Chunk\, right: Chunk\] - -**`Since`** - -2.0.0 - -▸ **partitionMap**\<`A`, `B`, `C`\>(`self`, `f`): [left: Chunk\, right: Chunk\] - -Partitions the elements of this chunk into two chunks using f. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------ | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `f` | (`a`: `A`) => [`Either`](E.md#either)\<`B`, `C`\> | - -#### Returns - -[left: Chunk\, right: Chunk\] - -**`Since`** - -2.0.0 - ---- - -### separate - -▸ **separate**\<`A`, `B`\>(`self`): [[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>, [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>] - -Partitions the elements of this chunk into two chunks. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`Either`](E.md#either)\<`A`, `B`\>\> | - -#### Returns - -[[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>, [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>] - -**`Since`** - -2.0.0 - -## folding - -### join - -▸ **join**(`sep`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`string`\>) => `string` - -Joins the elements together with "sep" in the middle. - -#### Parameters - -| Name | Type | -| :---- | :------- | -| `sep` | `string` | - -#### Returns - -`fn` - -▸ (`self`): `string` - -##### Parameters - -| Name | Type | -| :----- | :---------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`string`\> | - -##### Returns - -`string` - -**`Since`** - -2.0.0 - -▸ **join**(`self`, `sep`): `string` - -Joins the elements together with "sep" in the middle. - -#### Parameters - -| Name | Type | -| :----- | :---------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`string`\> | -| `sep` | `string` | - -#### Returns - -`string` - -**`Since`** - -2.0.0 - ---- - -### mapAccum - -▸ **mapAccum**\<`S`, `A`, `B`\>(`s`, `f`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`S`, [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>] - -Statefully maps over the chunk, producing new elements of type `B`. - -#### Type parameters - -| Name | -| :--- | -| `S` | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :--- | :------------------------------------------ | -| `s` | `S` | -| `f` | (`s`: `S`, `a`: `A`) => readonly [`S`, `B`] | - -#### Returns - -`fn` - -▸ (`self`): [`S`, [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>] - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`S`, [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>] - -**`Since`** - -2.0.0 - -▸ **mapAccum**\<`S`, `A`, `B`\>(`self`, `s`, `f`): [`S`, [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>] - -Statefully maps over the chunk, producing new elements of type `B`. - -#### Type parameters - -| Name | -| :--- | -| `S` | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `s` | `S` | -| `f` | (`s`: `S`, `a`: `A`) => readonly [`S`, `B`] | - -#### Returns - -[`S`, [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>] - -**`Since`** - -2.0.0 - ---- - -### reduce - -▸ **reduce**\<`B`, `A`\>(`b`, `f`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => `B` - -#### Type parameters - -| Name | -| :--- | -| `B` | -| `A` | - -#### Parameters - -| Name | Type | -| :--- | :----------------------------------------- | -| `b` | `B` | -| `f` | (`b`: `B`, `a`: `A`, `i`: `number`) => `B` | - -#### Returns - -`fn` - -▸ (`self`): `B` - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -`B` - -**`Since`** - -2.0.0 - -▸ **reduce**\<`A`, `B`\>(`self`, `b`, `f`): `B` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `b` | `B` | -| `f` | (`b`: `B`, `a`: `A`, `i`: `number`) => `B` | - -#### Returns - -`B` - -**`Since`** - -2.0.0 - ---- - -### reduceRight - -▸ **reduceRight**\<`B`, `A`\>(`b`, `f`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => `B` - -#### Type parameters - -| Name | -| :--- | -| `B` | -| `A` | - -#### Parameters - -| Name | Type | -| :--- | :----------------------------------------- | -| `b` | `B` | -| `f` | (`b`: `B`, `a`: `A`, `i`: `number`) => `B` | - -#### Returns - -`fn` - -▸ (`self`): `B` - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -`B` - -**`Since`** - -2.0.0 - -▸ **reduceRight**\<`A`, `B`\>(`self`, `b`, `f`): `B` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `b` | `B` | -| `f` | (`b`: `B`, `a`: `A`, `i`: `number`) => `B` | - -#### Returns - -`B` - -**`Since`** - -2.0.0 - -## mapping - -### map - -▸ **map**\<`S`, `B`\>(`f`): (`self`: `S`) => [`With`](Chunk.Chunk.md#with)\<`S`, `B`\> - -Transforms the elements of a chunk using the specified mapping function. -If the input chunk is non-empty, the resulting chunk will also be non-empty. - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------- | -| `S` | extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`any`\> | -| `B` | `B` | - -#### Parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------ | -| `f` | (`a`: [`Infer`](Chunk.Chunk.md#infer)\<`S`\>, `i`: `number`) => `B` | - -#### Returns - -`fn` - -▸ (`self`): [`With`](Chunk.Chunk.md#with)\<`S`, `B`\> - -##### Parameters - -| Name | Type | -| :----- | :--- | -| `self` | `S` | - -##### Returns - -[`With`](Chunk.Chunk.md#with)\<`S`, `B`\> - -**`Example`** - -```ts -import * as Chunk from "effect/Chunk"; - -assert.deepStrictEqual( - Chunk.map(Chunk.make(1, 2), (n) => n + 1), - Chunk.make(2, 3), -); -``` - -**`Since`** - -2.0.0 - -▸ **map**\<`A`, `B`\>(`self`, `f`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`B`\> - -Transforms the elements of a chunk using the specified mapping function. -If the input chunk is non-empty, the resulting chunk will also be non-empty. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------------------- | -| `self` | [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> | -| `f` | (`a`: `A`, `i`: `number`) => `B` | - -#### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`B`\> - -**`Example`** - -```ts -import * as Chunk from "effect/Chunk"; - -assert.deepStrictEqual( - Chunk.map(Chunk.make(1, 2), (n) => n + 1), - Chunk.make(2, 3), -); -``` - -**`Since`** - -2.0.0 - -▸ **map**\<`A`, `B`\>(`self`, `f`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -Transforms the elements of a chunk using the specified mapping function. -If the input chunk is non-empty, the resulting chunk will also be non-empty. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `f` | (`a`: `A`, `i`: `number`) => `B` | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -**`Example`** - -```ts -import * as Chunk from "effect/Chunk"; - -assert.deepStrictEqual( - Chunk.map(Chunk.make(1, 2), (n) => n + 1), - Chunk.make(2, 3), -); -``` - -**`Since`** - -2.0.0 - -## sequencing - -### flatMap - -▸ **flatMap**\<`S`, `T`\>(`f`): (`self`: `S`) => [`AndNonEmpty`](Chunk.Chunk.md#andnonempty)\<`S`, `T`, [`Infer`](Chunk.Chunk.md#infer)\<`T`\>\> - -Applies a function to each element in a chunk and returns a new chunk containing the concatenated mapped elements. - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------- | -| `S` | extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`any`\> | -| `T` | extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`any`\> | - -#### Parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------ | -| `f` | (`a`: [`Infer`](Chunk.Chunk.md#infer)\<`S`\>, `i`: `number`) => `T` | - -#### Returns - -`fn` - -▸ (`self`): [`AndNonEmpty`](Chunk.Chunk.md#andnonempty)\<`S`, `T`, [`Infer`](Chunk.Chunk.md#infer)\<`T`\>\> - -##### Parameters - -| Name | Type | -| :----- | :--- | -| `self` | `S` | - -##### Returns - -[`AndNonEmpty`](Chunk.Chunk.md#andnonempty)\<`S`, `T`, [`Infer`](Chunk.Chunk.md#infer)\<`T`\>\> - -**`Since`** - -2.0.0 - -▸ **flatMap**\<`A`, `B`\>(`self`, `f`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`B`\> - -Applies a function to each element in a chunk and returns a new chunk containing the concatenated mapped elements. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------------------------------------------------ | -| `self` | [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> | -| `f` | (`a`: `A`, `i`: `number`) => [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`B`\> | - -#### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`B`\> - -**`Since`** - -2.0.0 - -▸ **flatMap**\<`A`, `B`\>(`self`, `f`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -Applies a function to each element in a chunk and returns a new chunk containing the concatenated mapped elements. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :---------------------------------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `f` | (`a`: `A`, `i`: `number`) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> - -**`Since`** - -2.0.0 - ---- - -### flatten - -▸ **flatten**\<`S`\>(`self`): [`Flatten`](Chunk.Chunk.md#flatten)\<`S`\> - -Flattens a chunk of chunks into a single chunk by concatenating all chunks. - -#### Type parameters - -| Name | Type | -| :--- | :------------------------------------------------------------------------------------------------------ | -| `S` | extends [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`any`\>\> | - -#### Parameters - -| Name | Type | -| :----- | :--- | -| `self` | `S` | - -#### Returns - -[`Flatten`](Chunk.Chunk.md#flatten)\<`S`\> - -**`Since`** - -2.0.0 - -## sorting - -### sort - -▸ **sort**\<`B`\>(`O`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Sort the elements of a Chunk in increasing order, creating a new Chunk. - -#### Type parameters - -| Name | -| :--- | -| `B` | - -#### Parameters - -| Name | Type | -| :--- | :------------------------------------------- | -| `O` | [`Order`](../interfaces/Ord.Order.md)\<`B`\> | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - -▸ **sort**\<`A`, `B`\>(`self`, `O`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Sort the elements of a Chunk in increasing order, creating a new Chunk. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `O` | [`Order`](../interfaces/Ord.Order.md)\<`B`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### sortWith - -▸ **sortWith**\<`A`, `B`\>(`f`, `order`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :------ | :------------------------------------------- | -| `f` | (`a`: `A`) => `B` | -| `order` | [`Order`](../interfaces/Ord.Order.md)\<`B`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - -▸ **sortWith**\<`A`, `B`\>(`self`, `f`, `order`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :------ | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `f` | (`a`: `A`) => `B` | -| `order` | [`Order`](../interfaces/Ord.Order.md)\<`B`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - -## splitting - -### split - -▸ **split**(`n`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>\> - -Splits this chunk into `n` equally sized chunks. - -#### Parameters - -| Name | Type | -| :--- | :------- | -| `n` | `number` | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>\> - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>\> - -**`Since`** - -2.0.0 - -▸ **split**\<`A`\>(`self`, `n`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>\> - -Splits this chunk into `n` equally sized chunks. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `n` | `number` | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>\> - -**`Since`** - -2.0.0 - ---- - -### splitAt - -▸ **splitAt**(`n`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [beforeIndex: Chunk\, fromIndex: Chunk\] - -Returns two splits of this chunk at the specified index. - -#### Parameters - -| Name | Type | -| :--- | :------- | -| `n` | `number` | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [beforeIndex: Chunk\, fromIndex: Chunk\] - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[beforeIndex: Chunk\, fromIndex: Chunk\] - -**`Since`** - -2.0.0 - -▸ **splitAt**\<`A`\>(`self`, `n`): [beforeIndex: Chunk\, fromIndex: Chunk\] - -Returns two splits of this chunk at the specified index. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `n` | `number` | - -#### Returns - -[beforeIndex: Chunk\, fromIndex: Chunk\] - -**`Since`** - -2.0.0 - ---- - -### splitNonEmptyAt - -▸ **splitNonEmptyAt**(`n`): \(`self`: [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\>) => [beforeIndex: NonEmptyChunk\, fromIndex: Chunk\] - -Splits a `NonEmptyChunk` into two segments, with the first segment containing a maximum of `n` elements. -The value of `n` must be `>= 1`. - -#### Parameters - -| Name | Type | -| :--- | :------- | -| `n` | `number` | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [beforeIndex: NonEmptyChunk\, fromIndex: Chunk\] - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :------------------------------------------------------------- | -| `self` | [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> | - -##### Returns - -[beforeIndex: NonEmptyChunk\, fromIndex: Chunk\] - -**`Since`** - -2.0.0 - -▸ **splitNonEmptyAt**\<`A`\>(`self`, `n`): [beforeIndex: NonEmptyChunk\, fromIndex: Chunk\] - -Splits a `NonEmptyChunk` into two segments, with the first segment containing a maximum of `n` elements. -The value of `n` must be `>= 1`. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------------------- | -| `self` | [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> | -| `n` | `number` | - -#### Returns - -[beforeIndex: NonEmptyChunk\, fromIndex: Chunk\] - -**`Since`** - -2.0.0 - ---- - -### splitWhere - -▸ **splitWhere**\<`B`, `A`\>(`predicate`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\>) => [beforeMatch: Chunk\, fromMatch: Chunk\] - -Splits this chunk on the first element that matches this predicate. -Returns a tuple containing two chunks: the first one is before the match, and the second one is from the match onward. - -#### Type parameters - -| Name | Type | -| :--- | :--- | -| `B` | `B` | -| `A` | `B` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`fn` - -▸ (`self`): [beforeMatch: Chunk\, fromMatch: Chunk\] - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -##### Returns - -[beforeMatch: Chunk\, fromMatch: Chunk\] - -**`Since`** - -2.0.0 - -▸ **splitWhere**\<`A`\>(`self`, `predicate`): [beforeMatch: Chunk\, fromMatch: Chunk\] - -Splits this chunk on the first element that matches this predicate. -Returns a tuple containing two chunks: the first one is before the match, and the second one is from the match onward. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -[beforeMatch: Chunk\, fromMatch: Chunk\] - -**`Since`** - -2.0.0 - -## symbol - -### TypeId - -Ƭ **TypeId**: typeof `TypeId` - -**`Since`** - -2.0.0 - -## unsafe - -### unsafeFromArray - -▸ **unsafeFromArray**\<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -Wraps an array into a chunk without copying, unsafe on mutable arrays - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :------------- | -| `self` | readonly `A`[] | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### unsafeFromNonEmptyArray - -▸ **unsafeFromNonEmptyArray**\<`A`\>(`self`): [`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> - -Wraps an array into a chunk without copying, unsafe on mutable arrays - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :------------------ | -| `self` | readonly [`A`, `A`] | - -#### Returns - -[`NonEmptyChunk`](../interfaces/Chunk.NonEmptyChunk.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### unsafeGet - -▸ **unsafeGet**(`index`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => `A` - -Gets an element unsafely, will throw on out of bounds - -#### Parameters - -| Name | Type | -| :------ | :------- | -| `index` | `number` | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): `A` - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -`A` - -**`Since`** - -2.0.0 - -▸ **unsafeGet**\<`A`\>(`self`, `index`): `A` - -Gets an element unsafely, will throw on out of bounds - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :------ | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `index` | `number` | - -#### Returns - -`A` - -**`Since`** - -2.0.0 - ---- - -### unsafeHead - -▸ **unsafeHead**\<`A`\>(`self`): `A` - -Returns the first element of this chunk. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -#### Returns - -`A` - -**`Since`** - -2.0.0 - ---- - -### unsafeLast - -▸ **unsafeLast**\<`A`\>(`self`): `A` - -Returns the last element of this chunk. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -#### Returns - -`A` - -**`Since`** - -2.0.0 - -## zipping - -### zip - -▸ **zip**\<`B`\>(`that`): \(`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`A`, `B`]\> - -Zips this chunk pointwise with the specified chunk. - -#### Type parameters - -| Name | -| :--- | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `that` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -#### Returns - -`fn` - -▸ \<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`A`, `B`]\> - -##### Type parameters - -| Name | -| :--- | -| `A` | - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`A`, `B`]\> - -**`Since`** - -2.0.0 - -▸ **zip**\<`A`, `B`\>(`self`, `that`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`A`, `B`]\> - -Zips this chunk pointwise with the specified chunk. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `that` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<[`A`, `B`]\> - -**`Since`** - -2.0.0 - ---- - -### zipWith - -▸ **zipWith**\<`A`, `B`, `C`\>(`that`, `f`): (`self`: [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\>) => [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`C`\> - -Zips this chunk pointwise with the specified chunk using the specified combiner. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `that` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | -| `f` | (`a`: `A`, `b`: `B`) => `C` | - -#### Returns - -`fn` - -▸ (`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`C`\> - -##### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | - -##### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`C`\> - -**`Since`** - -2.0.0 - -▸ **zipWith**\<`A`, `B`, `C`\>(`self`, `that`, `f`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`C`\> - -Zips this chunk pointwise with the specified chunk using the specified combiner. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | - -#### Parameters - -| Name | Type | -| :----- | :----------------------------------------------- | -| `self` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> | -| `that` | [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`B`\> | -| `f` | (`a`: `A`, `b`: `B`) => `C` | - -#### Returns - -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`C`\> - -**`Since`** - -2.0.0 diff --git a/packages/tools/docs/modules/E.md b/packages/tools/docs/modules/E.md index 48276e642..b89e13b26 100644 --- a/packages/tools/docs/modules/E.md +++ b/packages/tools/docs/modules/E.md @@ -571,10 +571,10 @@ If the predicate fails, set the left value with the result of the provided funct #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `filter` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | -| `orLeftWith` | (`a`: `X`) => `E2` | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `filter` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | +| `orLeftWith` | (`a`: `X`) => `E2` | #### Returns @@ -642,10 +642,10 @@ If the predicate fails, set the left value with the result of the provided funct #### Parameters -| Name | Type | -| :----------- | :------------------------------------------------- | -| `filter` | [`Predicate`](../interfaces/P.Predicate.md)\<`X`\> | -| `orLeftWith` | (`a`: `Y`) => `E2` | +| Name | Type | +| :----------- | :------------------------------------------------ | +| `filter` | [`Predicate`](../interfaces/.Predicate.md)\<`X`\> | +| `orLeftWith` | (`a`: `Y`) => `E2` | #### Returns @@ -714,11 +714,11 @@ If the predicate fails, set the left value with the result of the provided funct #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | [`Either`](E.md#either)\<`E`, `A`\> | -| `filter` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | -| `orLeftWith` | (`a`: `X`) => `E2` | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `self` | [`Either`](E.md#either)\<`E`, `A`\> | +| `filter` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | +| `orLeftWith` | (`a`: `X`) => `E2` | #### Returns @@ -769,11 +769,11 @@ If the predicate fails, set the left value with the result of the provided funct #### Parameters -| Name | Type | -| :----------- | :------------------------------------------------- | -| `self` | [`Either`](E.md#either)\<`E`, `A`\> | -| `filter` | [`Predicate`](../interfaces/P.Predicate.md)\<`X`\> | -| `orLeftWith` | (`a`: `Y`) => `E2` | +| Name | Type | +| :----------- | :------------------------------------------------ | +| `self` | [`Either`](E.md#either)\<`E`, `A`\> | +| `filter` | [`Predicate`](../interfaces/.Predicate.md)\<`X`\> | +| `orLeftWith` | (`a`: `Y`) => `E2` | #### Returns diff --git a/packages/tools/docs/modules/Helper.Debug.md b/packages/tools/docs/modules/Helper.Debug.md new file mode 100644 index 000000000..8fc5cdfef --- /dev/null +++ b/packages/tools/docs/modules/Helper.Debug.md @@ -0,0 +1,44 @@ +[@eslint-react/tools](../README.md) / [Helper](Helper.md) / Debug + +# Namespace: Debug + +[Helper](Helper.md).Debug + +## Table of contents + +### Type Aliases + +- [Pretty](Helper.Debug.md#pretty) +- [Remap](Helper.Debug.md#remap) + +## Type Aliases + +### Pretty + +Ƭ **Pretty**\<`T`\>: \{ [P in keyof T]: T[P] } & {} + +**`Since`** + +0.0.1 + +#### Type parameters + +| Name | +| :--- | +| `T` | + +--- + +### Remap + +Ƭ **Remap**\<`T`\>: \{ [P in keyof T]: T[P] } + +**`Since`** + +0.0.1 + +#### Type parameters + +| Name | +| :--- | +| `T` | diff --git a/packages/tools/docs/modules/Helper.Record.md b/packages/tools/docs/modules/Helper.Record.md new file mode 100644 index 000000000..b55055ad9 --- /dev/null +++ b/packages/tools/docs/modules/Helper.Record.md @@ -0,0 +1,226 @@ +[@eslint-react/tools](../README.md) / [Helper](Helper.md) / Record + +# Namespace: Record + +[Helper](Helper.md).Record + +## Table of contents + +### Type Aliases + +- [DeepWriteable](Helper.Record.md#deepwriteable) +- [FromEntries](Helper.Record.md#fromentries) +- [FromEntriesWithReadOnly](Helper.Record.md#fromentrieswithreadonly) +- [LooseRecord](Helper.Record.md#looserecord) + +### Functions + +- [entries](Helper.Record.md#entries) +- [fromEntries](Helper.Record.md#fromentries-1) +- [fromEntriesWithReadOnly](Helper.Record.md#fromentrieswithreadonly-1) +- [keys](Helper.Record.md#keys) +- [values](Helper.Record.md#values) + +## Type Aliases + +### DeepWriteable + +Ƭ **DeepWriteable**\<`T`\>: \{ -readonly [P in keyof T]: DeepWriteable\ } + +#### Type parameters + +| Name | +| :--- | +| `T` | + +--- + +### FromEntries + +Ƭ **FromEntries**\<`T`\>: `T` extends [infer Key, `unknown`][] ? \{ [K in Cast\]: Extract\, [K, unknown]\>[1] } : \{ [key in string]: unknown } + +#### Type parameters + +| Name | +| :--- | +| `T` | + +--- + +### FromEntriesWithReadOnly + +Ƭ **FromEntriesWithReadOnly**\<`T`\>: [`FromEntries`](Helper.Record.md#fromentries)\<[`DeepWriteable`](Helper.Record.md#deepwriteable)\<`T`\>\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +--- + +### LooseRecord + +Ƭ **LooseRecord**\<`T`\>: `Record`\<`PropertyKey`, `T`\> + +A record with loose keys. + +**`Since`** + +0.4.0 + +#### Type parameters + +| Name | Description | +| :--- | :---------------------- | +| `T` | The type of the values. | + +## Functions + +### entries + +▸ **entries**\<`T`\>(`value`): \{ [K in string \| number \| symbol]-?: [K, T[K]] }[keyof `T`][] + +type-safe version of Object.entries + +#### Type parameters + +| Name | Type | +| :--- | :----------------------------------------------------------------- | +| `T` | extends [`LooseRecord`](Helper.Record.md#looserecord)\<`unknown`\> | + +#### Parameters + +| Name | Type | Description | +| :------ | :--- | :--------------------------------- | +| `value` | `T` | The value to get the entries from. | + +#### Returns + +\{ [K in string \| number \| symbol]-?: [K, T[K]] }[keyof `T`][] + +The entries of the value. + +**`Since`** + +0.4.0 + +--- + +### fromEntries + +▸ **fromEntries**\<`T`\>(`entries`): [`FromEntries`](Helper.Record.md#fromentries)\<`T`\> + +type-safe version of Object.fromEntries + +#### Type parameters + +| Name | Type | +| :--- | :----------------------------------- | +| `T` | extends [`PropertyKey`, `unknown`][] | + +#### Parameters + +| Name | Type | Description | +| :-------- | :--- | :------------------------------------- | +| `entries` | `T` | The entries to create the object from. | + +#### Returns + +[`FromEntries`](Helper.Record.md#fromentries)\<`T`\> + +The object created from the entries. + +**`Since`** + +0.4.0 + +--- + +### fromEntriesWithReadOnly + +▸ **fromEntriesWithReadOnly**\<`T`\>(`entries`): [`FromEntries`](Helper.Record.md#fromentries)\<[`DeepWriteable`](Helper.Record.md#deepwriteable)\<`T`\>\> + +type-safe version of Object.fromEntries + +#### Type parameters + +| Name | Type | +| :--- | :----------------------------------- | +| `T` | extends [`PropertyKey`, `unknown`][] | + +#### Parameters + +| Name | Type | Description | +| :-------- | :--- | :------------------------------------- | +| `entries` | `T` | The entries to create the object from. | + +#### Returns + +[`FromEntries`](Helper.Record.md#fromentries)\<[`DeepWriteable`](Helper.Record.md#deepwriteable)\<`T`\>\> + +The object created from the entries. + +**`Since`** + +0.4.0 + +--- + +### keys + +▸ **keys**\<`T`\>(`value`): keyof `T`[] + +type-safe version of Object.keys + +#### Type parameters + +| Name | Type | +| :--- | :----------------------------------------------------------------- | +| `T` | extends [`LooseRecord`](Helper.Record.md#looserecord)\<`unknown`\> | + +#### Parameters + +| Name | Type | Description | +| :------ | :--- | :------------------------------ | +| `value` | `T` | The value to get the keys from. | + +#### Returns + +keyof `T`[] + +The keys of the value. + +**`Since`** + +0.4.0 + +--- + +### values + +▸ **values**\<`T`\>(`value`): `T`[keyof `T`][] + +type-safe version of Object.values + +#### Type parameters + +| Name | Type | +| :--- | :----------------------------------------------------------------- | +| `T` | extends [`LooseRecord`](Helper.Record.md#looserecord)\<`unknown`\> | + +#### Parameters + +| Name | Type | Description | +| :------ | :--- | :-------------------------------- | +| `value` | `T` | The value to get the values from. | + +#### Returns + +`T`[keyof `T`][] + +The values of the value. + +**`Since`** + +0.4.0 diff --git a/packages/tools/docs/modules/Helper.Union.md b/packages/tools/docs/modules/Helper.Union.md new file mode 100644 index 000000000..aeb6252ed --- /dev/null +++ b/packages/tools/docs/modules/Helper.Union.md @@ -0,0 +1,62 @@ +[@eslint-react/tools](../README.md) / [Helper](Helper.md) / Union + +# Namespace: Union + +[Helper](Helper.md).Union + +## Table of contents + +### Type Aliases + +- [UnionFromTuple](Helper.Union.md#unionfromtuple) +- [UnionToIntersection](Helper.Union.md#uniontointersection) + +## Type Aliases + +### UnionFromTuple + +Ƭ **UnionFromTuple**\<`T`\>: `T` extends infer U[] ? `U` : `never` + +**`Since`** + +0.0.1 + +**`Example`** + +```ts +type Result = UnionFromTuple<["foo", "bar", 1]>; +// Result = 'foo' | 'bar' | 1 +``` + +#### Type parameters + +| Name | Description | +| :--- | :----------------------------- | +| `T` | The type to get the union from | + +--- + +### UnionToIntersection + +Ƭ **UnionToIntersection**\<`U`\>: `U` extends `unknown` ? (`k`: `U`) => `void` : `never` extends (`k`: infer I) => `void` ? `I` : `never` + +**`Since`** + +0.0.1 + +**`Template`** + +The type to get the intersection from + +**`Example`** + +```ts +type Result = IntersectionFromTuple<["foo", "bar", 1]>; +// Result = 'foo' & 'bar' & 1 +``` + +#### Type parameters + +| Name | +| :--- | +| `U` | diff --git a/packages/tools/docs/modules/Helper.md b/packages/tools/docs/modules/Helper.md new file mode 100644 index 000000000..a889b1e2b --- /dev/null +++ b/packages/tools/docs/modules/Helper.md @@ -0,0 +1,190 @@ +[@eslint-react/tools](../README.md) / Helper + +# Namespace: Helper + +## Table of contents + +### Namespaces + +- [Debug](Helper.Debug.md) +- [Record](Helper.Record.md) +- [Union](Helper.Union.md) + +### Type Aliases + +- [Narrow](Helper.md#narrow) + +### Functions + +- [asConst](Helper.md#asconst) +- [constant](Helper.md#constant) +- [id](Helper.md#id) +- [narrow](Helper.md#narrow-1) +- [noop](Helper.md#noop) + +## Type Aliases + +### Narrow + +Ƭ **Narrow**\<`TType`\>: \{ [K in keyof TType]: Narrow\ } \| `TType` extends [] ? [] : `never` \| `TType` extends `Function` ? `TType` : `never` \| `TType` extends `bigint` \| `boolean` \| `number` \| `string` ? `TType` : `never` + +Infers embedded primitive type of any type + +**`Since`** + +0.0.1 + +**`Param`** + +Type to infer + +**`Example`** + +```ts +type Result = Narrow<["foo", "bar", 1]>; +``` + +**`See`** + +https://twitter.com/hd_nvim/status/1578567206190780417 + +#### Type parameters + +| Name | +| :------ | +| `TType` | + +## Functions + +### asConst + +▸ **asConst**\<`T`\>(`a`): `T` + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | Description | +| :--- | :--- | :------------------ | +| `a` | `T` | The value to infer. | + +#### Returns + +`T` + +**`Since`** + +0.0.1 + +--- + +### constant + +▸ **constant**\<`T`\>(`a`): () => `T` + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :--- | :--- | +| `a` | `T` | + +#### Returns + +`fn` + +▸ (): `T` + +##### Returns + +`T` + +**`Since`** + +0.0.1 + +--- + +### id + +▸ **id**\<`T`\>(`a`): `T` + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Parameters + +| Name | Type | +| :--- | :--- | +| `a` | `T` | + +#### Returns + +`T` + +**`Since`** + +0.0.1 + +--- + +### narrow + +▸ **narrow**\<`TType`\>(`a`): [`Narrow`](Helper.md#narrow)\<`TType`\> + +Infers embedded primitive type of any type +Same as `as const` but without setting the object as readonly and without needing the user to use it. + +#### Type parameters + +| Name | +| :------ | +| `TType` | + +#### Parameters + +| Name | Type | Description | +| :--- | :-------------------------------------- | :------------- | +| `a` | [`Narrow`](Helper.md#narrow)\<`TType`\> | Value to infer | + +#### Returns + +[`Narrow`](Helper.md#narrow)\<`TType`\> + +Value with embedded type inferred + +**`Since`** + +0.0.1 + +**`Example`** + +```ts +const result = narrow(["foo", "bar", 1]); +``` + +--- + +### noop + +▸ **noop**(): `void` + +#### Returns + +`void` + +**`Since`** + +0.0.1 diff --git a/packages/tools/docs/modules/List.md b/packages/tools/docs/modules/List.md index c9bb9f834..4ecaf1d90 100644 --- a/packages/tools/docs/modules/List.md +++ b/packages/tools/docs/modules/List.md @@ -176,9 +176,9 @@ Filters a list using the specified predicate. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -213,9 +213,9 @@ Filters a list using the specified predicate. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -250,10 +250,10 @@ Filters a list using the specified predicate. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | [`List`](List.md#list)\<`A`\> | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `self` | [`List`](List.md#list)\<`A`\> | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -275,10 +275,10 @@ Filters a list using the specified predicate. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | [`List`](List.md#list)\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `self` | [`List`](List.md#list)\<`A`\> | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -446,9 +446,9 @@ all elements that did satisfy the specified predicate. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -485,9 +485,9 @@ all elements that did satisfy the specified predicate. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -524,10 +524,10 @@ all elements that did satisfy the specified predicate. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | [`List`](List.md#list)\<`A`\> | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `self` | [`List`](List.md#list)\<`A`\> | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -551,10 +551,10 @@ all elements that did satisfy the specified predicate. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | [`List`](List.md#list)\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `self` | [`List`](List.md#list)\<`A`\> | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -1512,7 +1512,7 @@ Converts the specified `List` to an `Array`. ### toChunk -▸ **toChunk**\<`A`\>(`self`): [`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> +▸ **toChunk**\<`A`\>(`self`): `Chunk`\<`A`\> Converts the specified `List` to a `Chunk`. @@ -1530,7 +1530,7 @@ Converts the specified `List` to a `Chunk`. #### Returns -[`Chunk`](../interfaces/Chunk.Chunk-1.md)\<`A`\> +`Chunk`\<`A`\> **`Since`** @@ -1553,9 +1553,9 @@ Check if a predicate holds true for every `List` element. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -1589,9 +1589,9 @@ Check if a predicate holds true for every `List` element. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -1626,10 +1626,10 @@ Check if a predicate holds true for every `List` element. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | [`List`](List.md#list)\<`A`\> | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `self` | [`List`](List.md#list)\<`A`\> | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -1651,10 +1651,10 @@ Check if a predicate holds true for every `List` element. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | [`List`](List.md#list)\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `self` | [`List`](List.md#list)\<`A`\> | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -1682,9 +1682,9 @@ predicate, or `None` if no such element exists. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -1720,9 +1720,9 @@ predicate, or `None` if no such element exists. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -1758,10 +1758,10 @@ predicate, or `None` if no such element exists. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | [`List`](List.md#list)\<`A`\> | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `self` | [`List`](List.md#list)\<`A`\> | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -1784,10 +1784,10 @@ predicate, or `None` if no such element exists. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | [`List`](List.md#list)\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `self` | [`List`](List.md#list)\<`A`\> | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -1842,9 +1842,9 @@ Check if a predicate holds true for some `List` element. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns @@ -1878,10 +1878,10 @@ Check if a predicate holds true for some `List` element. #### Parameters -| Name | Type | -| :---------- | :------------------------------------------------- | -| `self` | [`List`](List.md#list)\<`A`\> | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | +| Name | Type | +| :---------- | :------------------------------------------------ | +| `self` | [`List`](List.md#list)\<`A`\> | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | #### Returns diff --git a/packages/tools/docs/modules/M.Pattern.md b/packages/tools/docs/modules/M.Pattern.md deleted file mode 100644 index 573f5ea3a..000000000 --- a/packages/tools/docs/modules/M.Pattern.md +++ /dev/null @@ -1,806 +0,0 @@ -[@eslint-react/tools](../README.md) / [M](M.md) / Pattern - -# Namespace: Pattern - -[M](M.md).Pattern - -## Table of contents - -### Interfaces - -- [unstable\_Fn](../interfaces/M.Pattern.unstable_Fn.md) - -### Type Aliases - -- [Pattern](M.Pattern.md#pattern) -- [infer](M.Pattern.md#infer) -- [matcher](M.Pattern.md#matcher) -- [narrow](M.Pattern.md#narrow) -- [unstable\_Matchable](M.Pattern.md#unstable_matchable) -- [unstable\_Matcher](M.Pattern.md#unstable_matcher) - -### Variables - -- [\_](M.Pattern.md#_) -- [any](M.Pattern.md#any) -- [bigint](M.Pattern.md#bigint) -- [boolean](M.Pattern.md#boolean) -- [matcher](M.Pattern.md#matcher-1) -- [nullish](M.Pattern.md#nullish) -- [number](M.Pattern.md#number) -- [string](M.Pattern.md#string) -- [symbol](M.Pattern.md#symbol) - -### Functions - -- [array](M.Pattern.md#array) -- [instanceOf](M.Pattern.md#instanceof) -- [intersection](M.Pattern.md#intersection) -- [map](M.Pattern.md#map) -- [not](M.Pattern.md#not) -- [optional](M.Pattern.md#optional) -- [select](M.Pattern.md#select) -- [set](M.Pattern.md#set) -- [shape](M.Pattern.md#shape) -- [union](M.Pattern.md#union) -- [when](M.Pattern.md#when) - -## Type Aliases - -### Pattern - -Ƭ **Pattern**\<`a`\>: `unknown` extends `a` ? `UnknownPattern` : `KnownPattern`\<`a`\> - -`Pattern` is the generic type for patterns matching a value of type `a`. A pattern can be any (nested) javascript value. - -They can also be wildcards, like `P._`, `P.string`, `P.number`, -or other matchers, like `P.when(predicate)`, `P.not(pattern)`, etc. - -[Read the documentation for `P.Pattern` on GitHub](https://github.com/gvergnaud/ts-pattern#patterns) - -**`Example`** - -```ts -const pattern: P.Pattern = { name: P.string }; -``` - -#### Type parameters - -| Name | -| :--- | -| `a` | - ---- - -### infer - -Ƭ **infer**\<`pattern`\>: `InvertPattern`\<`pattern`, `unknown`\> - -`P.infer` will return the type of the value -matched by this pattern. - -[Read the documentation for `P.infer` on GitHub](https://github.com/gvergnaud/ts-pattern#pinfer) - -**`Example`** - -```ts -const userPattern = { name: P.string }; -type User = P.infer; -``` - -#### Type parameters - -| Name | Type | -| :-------- | :------------------------------------------------- | -| `pattern` | extends [`Pattern`](M.Pattern.md#pattern)\<`any`\> | - ---- - -### matcher - -Ƭ **matcher**: typeof [`matcher`](M.Pattern.md#matcher-1) - ---- - -### narrow - -Ƭ **narrow**\<`input`, `pattern`\>: `ExtractPreciseValue`\<`input`, `InvertPattern`\<`pattern`, `input`\>\> - -`P.narrow` will narrow the input type to only keep -the set of values that are compatible with the provided pattern type. - -[Read the documentation for `P.narrow` on GitHub](https://github.com/gvergnaud/ts-pattern#pnarrow) - -**`Example`** - -```ts -type Input = ["a" | "b" | "c", "a" | "b" | "c"]; -const Pattern = ["a", P.union("a", "b")] as const; - -type Narrowed = P.narrow; -// ^? ['a', 'a' | 'b'] -``` - -#### Type parameters - -| Name | Type | -| :-------- | :------------------------------------------------- | -| `input` | `input` | -| `pattern` | extends [`Pattern`](M.Pattern.md#pattern)\<`any`\> | - ---- - -### unstable\_Matchable - -Ƭ **unstable\_Matchable**\<`narrowedOrFn`, `input`, `pattern`\>: `CustomP`\<`input`, `pattern`, `narrowedOrFn`\> - -A `Matchable` is an object implementing -the Matcher Protocol. It must have a `[P.matcher]: P.Matcher` -key, which defines how this object should be matched by TS-Pattern. - -Note that this api is unstable. - -**`Example`** - -```ts -class Some implements P.unstable_Matchable { - [P.matcher](): P.unstable_Matcher>; -} -``` - -#### Type parameters - -| Name | Type | -| :------------- | :------------- | -| `narrowedOrFn` | `narrowedOrFn` | -| `input` | `unknown` | -| `pattern` | `never` | - ---- - -### unstable\_Matcher - -Ƭ **unstable\_Matcher**\<`narrowedOrFn`, `input`, `pattern`\>: `ReturnType`\<`CustomP`\<`input`, `pattern`, `narrowedOrFn`\>[[`matcher`](M.Pattern.md#matcher-1)]\> - -A `Matcher` is an object with `match` function, which -defines how this object should be matched by TS-Pattern. - -Note that this api is unstable. - -**`Example`** - -```ts -class Some implements P.unstable_Matchable { - [P.matcher](): P.unstable_Matcher>; -} -``` - -#### Type parameters - -| Name | Type | -| :------------- | :------------- | -| `narrowedOrFn` | `narrowedOrFn` | -| `input` | `unknown` | -| `pattern` | `never` | - -## Variables - -### \_ - -• `Const` **\_**: `AnyPattern` - -`P._` is a wildcard pattern, matching **any value**. -It's an alias to `P.any`. - -[Read the documentation for `P._` on GitHub](https://github.com/gvergnaud/ts-pattern#p_-wildcard) - -**`Example`** - -```ts -match(value) - .with(P._, () => "will always match"); -``` - ---- - -### any - -• `Const` **any**: `AnyPattern` - -`P.any` is a wildcard pattern, matching **any value**. - -[Read the documentation for `P.any` on GitHub](https://github.com/gvergnaud/ts-pattern#p_-wildcard) - -**`Example`** - -```ts -match(value) - .with(P.any, () => "will always match"); -``` - ---- - -### bigint - -• `Const` **bigint**: `BigIntPattern` - -`P.bigint` is a wildcard pattern, matching any **bigint**. - -[Read the documentation for `P.bigint` on GitHub](https://github.com/gvergnaud/ts-pattern#number-wildcard) - -**`Example`** - -```ts -.with(P.bigint, () => 'will match on bigints') -``` - ---- - -### boolean - -• `Const` **boolean**: `BooleanPattern` - -`P.boolean` is a wildcard pattern, matching any **boolean**. - -[Read the documentation for `P.boolean` on GitHub](https://github.com/gvergnaud/ts-pattern#boolean-wildcard) - -**`Example`** - -```ts -.with(P.boolean, () => 'will match on booleans') -``` - ---- - -### matcher - -• `Const` **matcher**: unique `symbol` - ---- - -### nullish - -• `Const` **nullish**: `NullishPattern` - -`P.nullish` is a wildcard pattern, matching **null** or **undefined**. - -[Read the documentation for `P.nullish` on GitHub](https://github.com/gvergnaud/ts-pattern#nullish-wildcard) - -**`Example`** - -```ts -.with(P.nullish, () => 'will match on null or undefined') -``` - ---- - -### number - -• `Const` **number**: `NumberPattern` - -`P.number` is a wildcard pattern, matching any **number**. - -[Read the documentation for `P.number` on GitHub](https://github.com/gvergnaud/ts-pattern#pnumber-wildcard) - -**`Example`** - -```ts -match(value) - .with(P.number, () => "will match on numbers"); -``` - ---- - -### string - -• `Const` **string**: `StringPattern` - -`P.string` is a wildcard pattern, matching any **string**. - -[Read the documentation for `P.string` on GitHub](https://github.com/gvergnaud/ts-pattern#pstring-wildcard) - -**`Example`** - -```ts -match(value) - .with(P.string, () => "will match on strings"); -``` - ---- - -### symbol - -• `Const` **symbol**: `SymbolPattern` - -`P.symbol` is a wildcard pattern, matching any **symbol**. - -[Read the documentation for `P.symbol` on GitHub](https://github.com/gvergnaud/ts-pattern#symbol-wildcard) - -**`Example`** - -```ts -.with(P.symbol, () => 'will match on symbols') -``` - -## Functions - -### array - -▸ **array**\<`input`\>(): `ArrayChainable`\<`ArrayP`\<`input`, `unknown`\>\> - -`P.array(subpattern)` takes a sub pattern and returns a pattern, which matches -arrays if all their elements match the sub pattern. - -[Read the documentation for `P.array` on GitHub](https://github.com/gvergnaud/ts-pattern#parray-patterns) - -#### Type parameters - -| Name | -| :------ | -| `input` | - -#### Returns - -`ArrayChainable`\<`ArrayP`\<`input`, `unknown`\>\> - -**`Example`** - -```ts -match(value) - .with({ users: P.array({ name: P.string }) }, () => "will match { name: string }[]"); -``` - -▸ **array**\<`input`, `pattern`\>(`pattern`): `ArrayChainable`\<`ArrayP`\<`input`, `pattern`\>\> - -#### Type parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | `input` | -| `pattern` | extends `undefined` \| `null` \| `string` \| `number` \| `bigint` \| `boolean` \| `symbol` \| readonly [] \| readonly [`unknown`, `unknown`] \| readonly [`unknown`, `unknown`] \| \{ `[k: string]`: `unknown`; } \| `UnknownMatcher` \| readonly [`UnknownPattern`, `UnknownPattern`] \| readonly [`UnknownPattern`, `UnknownPattern`] \| `PatternMatcher`\<`WithDefault`\<`UnwrapArray`\<`input`\>, `unknown`\>\> \| \{ readonly [k in string \| number \| symbol]?: Pattern\, unknown\>, readonly any[] \| Primitives \| Map\ \| Set\\>\>\>[k]\> } | - -#### Parameters - -| Name | Type | -| :-------- | :-------- | -| `pattern` | `pattern` | - -#### Returns - -`ArrayChainable`\<`ArrayP`\<`input`, `pattern`\>\> - ---- - -### instanceOf - -▸ **instanceOf**\<`T`\>(`classConstructor`): `Chainable`\<`GuardP`\<`unknown`, `InstanceType`\<`T`\>\>\> - -`P.instanceOf(SomeClass)` is a pattern matching instances of a given class. - -[Read the documentation for `P.instanceOf` on GitHub](https://github.com/gvergnaud/ts-pattern#pinstanceof-patterns) - -#### Type parameters - -| Name | Type | -| :--- | :----------------------- | -| `T` | extends `AnyConstructor` | - -#### Parameters - -| Name | Type | -| :----------------- | :--- | -| `classConstructor` | `T` | - -#### Returns - -`Chainable`\<`GuardP`\<`unknown`, `InstanceType`\<`T`\>\>\> - -**`Example`** - -```ts -.with(P.instanceOf(SomeClass), () => 'will match on SomeClass instances') -``` - ---- - -### intersection - -▸ **intersection**\<`input`, `patterns`\>(`...patterns`): `Chainable`\<`AndP`\<`input`, `patterns`\>\> - -`P.intersection(...patterns)` returns a pattern which matches -only if **every** patterns provided in parameter match the input. - -[Read the documentation for `P.intersection` on GitHub](https://github.com/gvergnaud/ts-pattern#pintersection-patterns) - -#### Type parameters - -| Name | Type | -| :--------- | :------------------------------------------------------------------------------------------------------------ | -| `input` | `input` | -| `patterns` | extends readonly [[`Pattern`](M.Pattern.md#pattern)\<`input`\>, [`Pattern`](M.Pattern.md#pattern)\<`input`\>] | - -#### Parameters - -| Name | Type | -| :------------ | :--------- | -| `...patterns` | `patterns` | - -#### Returns - -`Chainable`\<`AndP`\<`input`, `patterns`\>\> - -**`Example`** - -```ts -match(value) - .with( - { - user: P.intersection( - { firstname: P.string }, - { lastname: P.string }, - { age: P.when(age => age > 21) }, - ), - }, - ({ user }) => "will match { firstname: string, lastname: string, age: number } if age > 21", - ); -``` - ---- - -### map - -▸ **map**\<`input`\>(): `Chainable`\<`MapP`\<`input`, `unknown`, `unknown`\>\> - -`P.set(subpattern)` takes a sub pattern and returns a pattern that matches -sets if all their elements match the sub pattern. - -[Read `P.set` documentation on GitHub](https://github.com/gvergnaud/ts-pattern#pset-patterns) - -#### Type parameters - -| Name | -| :------ | -| `input` | - -#### Returns - -`Chainable`\<`MapP`\<`input`, `unknown`, `unknown`\>\> - -**`Example`** - -```ts -match(value) - .with({ users: P.set(P.string) }, () => "will match Set"); -``` - -▸ **map**\<`input`, `pkey`, `pvalue`\>(`patternKey`, `patternValue`): `Chainable`\<`MapP`\<`input`, `pkey`, `pvalue`\>\> - -#### Type parameters - -| Name | Type | -| :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | `input` | -| `pkey` | extends `undefined` \| `null` \| `string` \| `number` \| `bigint` \| `boolean` \| `symbol` \| readonly [] \| readonly [`unknown`, `unknown`] \| readonly [`unknown`, `unknown`] \| \{ `[k: string]`: `unknown`; } \| `UnknownMatcher` \| readonly [`UnknownPattern`, `UnknownPattern`] \| readonly [`UnknownPattern`, `UnknownPattern`] \| `PatternMatcher`\<`WithDefault`\<`UnwrapMapKey`\<`input`\>, `unknown`\>\> \| \{ readonly [k in string \| number \| symbol]?: Pattern\, unknown\>, readonly any[] \| Primitives \| Map\ \| Set\\>\>\>[k]\> } | -| `pvalue` | extends `undefined` \| `null` \| `string` \| `number` \| `bigint` \| `boolean` \| `symbol` \| readonly [] \| readonly [`unknown`, `unknown`] \| readonly [`unknown`, `unknown`] \| \{ `[k: string]`: `unknown`; } \| `UnknownMatcher` \| readonly [`UnknownPattern`, `UnknownPattern`] \| readonly [`UnknownPattern`, `UnknownPattern`] \| `PatternMatcher`\<`WithDefault`\<`UnwrapMapValue`\<`input`\>, `unknown`\>\> \| \{ readonly [k in string \| number \| symbol]?: Pattern\, unknown\>, readonly any[] \| Primitives \| Map\ \| Set\\>\>\>[k]\> } | - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `patternKey` | `pkey` | -| `patternValue` | `pvalue` | - -#### Returns - -`Chainable`\<`MapP`\<`input`, `pkey`, `pvalue`\>\> - ---- - -### not - -▸ **not**\<`input`, `pattern`\>(`pattern`): `Chainable`\<`NotP`\<`input`, `pattern`\>\> - -`P.not(pattern)` returns a pattern which matches if the sub pattern -doesn't match. - -[Read the documentation for `P.not` on GitHub](https://github.com/gvergnaud/ts-pattern#pnot-patterns) - -#### Type parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | `input` | -| `pattern` | extends `undefined` \| `null` \| `string` \| `number` \| `bigint` \| `boolean` \| `symbol` \| readonly [] \| readonly [`unknown`, `unknown`] \| readonly [`unknown`, `unknown`] \| \{ `[k: string]`: `unknown`; } \| `UnknownMatcher` \| readonly [`UnknownPattern`, `UnknownPattern`] \| readonly [`UnknownPattern`, `UnknownPattern`] \| `PatternMatcher`\<`input`\> \| \{ readonly [k in string \| number \| symbol]?: Pattern\ \| Set\\>\>\>[k]\> } | - -#### Parameters - -| Name | Type | -| :-------- | :-------- | -| `pattern` | `pattern` | - -#### Returns - -`Chainable`\<`NotP`\<`input`, `pattern`\>\> - -**`Example`** - -```ts -match<{ a: string | number }>(value) - .with({ a: P.not(P.string) }, (x) => "will match { a: number }"); -``` - ---- - -### optional - -▸ **optional**\<`input`, `pattern`\>(`pattern`): `Chainable`\<`OptionalP`\<`input`, `pattern`\>, `"optional"`\> - -`P.optional(subpattern)` takes a sub pattern and returns a pattern which matches if the -key is undefined or if it is defined and the sub pattern matches its value. - -[Read the documentation for `P.optional` on GitHub](https://github.com/gvergnaud/ts-pattern#poptional-patterns) - -#### Type parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | `input` | -| `pattern` | extends `undefined` \| `null` \| `string` \| `number` \| `bigint` \| `boolean` \| `symbol` \| readonly [] \| readonly [`unknown`, `unknown`] \| readonly [`unknown`, `unknown`] \| \{ `[k: string]`: `unknown`; } \| `UnknownMatcher` \| `PatternMatcher`\<`input`\> \| \{ readonly [k in string \| number \| symbol]?: Pattern\ \| Set\\>\>\>[k]\> } \| readonly [`UnknownPattern`, `UnknownPattern`] \| readonly [`UnknownPattern`, `UnknownPattern`] | - -#### Parameters - -| Name | Type | -| :-------- | :-------- | -| `pattern` | `pattern` | - -#### Returns - -`Chainable`\<`OptionalP`\<`input`, `pattern`\>, `"optional"`\> - -**`Example`** - -```ts -match(value) - .with({ greeting: P.optional("Hello") }, () => 'will match { greeting?: "Hello" }'); -``` - ---- - -### select - -▸ **select**(): `Chainable`\<`AnonymousSelectP`, `"select"` \| `"or"` \| `"and"`\> - -`P.select()` is a pattern which will always match, -and will inject the selected piece of input in the handler function. - -[Read the documentation for `P.select` on GitHub](https://github.com/gvergnaud/ts-pattern#pselect-patterns) - -#### Returns - -`Chainable`\<`AnonymousSelectP`, `"select"` \| `"or"` \| `"and"`\> - -**`Example`** - -```ts -match<{ age: number }>(value) - .with({ age: P.select() }, (age) => "age: number"); -``` - -▸ **select**\<`input`, `patternOrKey`\>(`patternOrKey`): `patternOrKey` extends `string` ? `Chainable`\<`SelectP`\<`patternOrKey`, `"select"` \| `"or"` \| `"and"`\>\> : `Chainable`\<`SelectP`\<`symbols.anonymousSelectKey`, `input`, `patternOrKey`\>, `"select"` \| `"or"` \| `"and"`\> - -#### Type parameters - -| Name | Type | -| :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | `input` | -| `patternOrKey` | extends `undefined` \| `null` \| `string` \| `number` \| `bigint` \| `boolean` \| `symbol` \| readonly [] \| readonly [`unknown`, `unknown`] \| readonly [`unknown`, `unknown`] \| \{ `[k: string]`: `unknown`; } \| `UnknownMatcher` \| readonly [`UnknownPattern`, `UnknownPattern`] \| readonly [`UnknownPattern`, `UnknownPattern`] \| `PatternMatcher`\<`input`\> \| \{ readonly [k in string \| number \| symbol]?: Pattern\ \| Set\\>\>\>[k]\> } | - -#### Parameters - -| Name | Type | -| :------------- | :------------- | -| `patternOrKey` | `patternOrKey` | - -#### Returns - -`patternOrKey` extends `string` ? `Chainable`\<`SelectP`\<`patternOrKey`, `"select"` \| `"or"` \| `"and"`\>\> : `Chainable`\<`SelectP`\<`symbols.anonymousSelectKey`, `input`, `patternOrKey`\>, `"select"` \| `"or"` \| `"and"`\> - -▸ **select**\<`input`, `pattern`, `k`\>(`key`, `pattern`): `Chainable`\<`SelectP`\<`k`, `input`, `pattern`\>, `"select"` \| `"or"` \| `"and"`\> - -#### Type parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | `input` | -| `pattern` | extends `undefined` \| `null` \| `string` \| `number` \| `bigint` \| `boolean` \| `symbol` \| readonly [] \| readonly [`unknown`, `unknown`] \| readonly [`unknown`, `unknown`] \| \{ `[k: string]`: `unknown`; } \| `UnknownMatcher` \| readonly [`UnknownPattern`, `UnknownPattern`] \| readonly [`UnknownPattern`, `UnknownPattern`] \| `PatternMatcher`\<`input`\> \| \{ readonly [k in string \| number \| symbol]?: Pattern\ \| Set\\>\>\>[k]\> } | -| `k` | extends `string` | - -#### Parameters - -| Name | Type | -| :-------- | :-------- | -| `key` | `k` | -| `pattern` | `pattern` | - -#### Returns - -`Chainable`\<`SelectP`\<`k`, `input`, `pattern`\>, `"select"` \| `"or"` \| `"and"`\> - ---- - -### set - -▸ **set**\<`input`\>(): `Chainable`\<`SetP`\<`input`, `unknown`\>\> - -`P.set(subpattern)` takes a sub pattern and returns a pattern that matches -sets if all their elements match the sub pattern. - -[Read `P.set` documentation on GitHub](https://github.com/gvergnaud/ts-pattern#pset-patterns) - -#### Type parameters - -| Name | -| :------ | -| `input` | - -#### Returns - -`Chainable`\<`SetP`\<`input`, `unknown`\>\> - -**`Example`** - -```ts -match(value) - .with({ users: P.set(P.string) }, () => "will match Set"); -``` - -▸ **set**\<`input`, `pattern`\>(`pattern`): `Chainable`\<`SetP`\<`input`, `pattern`\>\> - -#### Type parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | `input` | -| `pattern` | extends `undefined` \| `null` \| `string` \| `number` \| `bigint` \| `boolean` \| `symbol` \| readonly [] \| readonly [`unknown`, `unknown`] \| readonly [`unknown`, `unknown`] \| \{ `[k: string]`: `unknown`; } \| `UnknownMatcher` \| readonly [`UnknownPattern`, `UnknownPattern`] \| readonly [`UnknownPattern`, `UnknownPattern`] \| `PatternMatcher`\<`WithDefault`\<`UnwrapSet`\<`input`\>, `unknown`\>\> \| \{ readonly [k in string \| number \| symbol]?: Pattern\, unknown\>, readonly any[] \| Primitives \| Map\ \| Set\\>\>\>[k]\> } | - -#### Parameters - -| Name | Type | -| :-------- | :-------- | -| `pattern` | `pattern` | - -#### Returns - -`Chainable`\<`SetP`\<`input`, `pattern`\>\> - ---- - -### shape - -▸ **shape**\<`input`, `pattern`\>(`pattern`): `Chainable`\<`GuardP`\<`input`, `InvertPattern`\<`pattern`, `input`\>\>\> - -`P.shape(somePattern)` lets you call methods like `.optional()`, `.and`, `.or` and `.select()` -On structural patterns, like objects and arrays. - -[Read the documentation for `P.shape` on GitHub](https://github.com/gvergnaud/ts-pattern#pshape-patterns) - -#### Type parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | `input` | -| `pattern` | extends `undefined` \| `null` \| `string` \| `number` \| `bigint` \| `boolean` \| `symbol` \| readonly [] \| readonly [`unknown`, `unknown`] \| readonly [`unknown`, `unknown`] \| \{ `[k: string]`: `unknown`; } \| `UnknownMatcher` \| readonly [`UnknownPattern`, `UnknownPattern`] \| readonly [`UnknownPattern`, `UnknownPattern`] \| `PatternMatcher`\<`input`\> \| \{ readonly [k in string \| number \| symbol]?: Pattern\ \| Set\\>\>\>[k]\> } | - -#### Parameters - -| Name | Type | -| :-------- | :-------- | -| `pattern` | `pattern` | - -#### Returns - -`Chainable`\<`GuardP`\<`input`, `InvertPattern`\<`pattern`, `input`\>\>\> - -**`Example`** - -```ts -.with( - { - state: P.shape({ status: "success" }).optional().select() - }, - (state) => 'match the success state, or undefined.' - ) -``` - ---- - -### union - -▸ **union**\<`input`, `patterns`\>(`...patterns`): `Chainable`\<`OrP`\<`input`, `patterns`\>\> - -`P.union(...patterns)` returns a pattern which matches -if **at least one** of the patterns provided in parameter match the input. - -[Read the documentation for `P.union` on GitHub](https://github.com/gvergnaud/ts-pattern#punion-patterns) - -#### Type parameters - -| Name | Type | -| :--------- | :------------------------------------------------------------------------------------------------------------ | -| `input` | `input` | -| `patterns` | extends readonly [[`Pattern`](M.Pattern.md#pattern)\<`input`\>, [`Pattern`](M.Pattern.md#pattern)\<`input`\>] | - -#### Parameters - -| Name | Type | -| :------------ | :--------- | -| `...patterns` | `patterns` | - -#### Returns - -`Chainable`\<`OrP`\<`input`, `patterns`\>\> - -**`Example`** - -```ts -match(value) - .with( - { type: P.union("a", "b", "c") }, - ({ type }) => 'will match { type: "a" | "b" | "c" }', - ); -``` - ---- - -### when - -▸ **when**\<`input`, `predicate`\>(`predicate`): `GuardP`\<`input`, `predicate` extends (`value`: `any`) => value is infer narrowed ? `narrowed` : `never`\> - -`P.when((value) => boolean)` returns a pattern which matches -if the predicate returns true for the current input. - -[Read the documentation for `P.when` on GitHub](https://github.com/gvergnaud/ts-pattern#pwhen-patterns) - -#### Type parameters - -| Name | Type | -| :---------- | :-------------------------------------- | -| `input` | `input` | -| `predicate` | extends (`value`: `input`) => `unknown` | - -#### Parameters - -| Name | Type | -| :---------- | :---------- | -| `predicate` | `predicate` | - -#### Returns - -`GuardP`\<`input`, `predicate` extends (`value`: `any`) => value is infer narrowed ? `narrowed` : `never`\> - -**`Example`** - -```ts -match<{ age: number }>(value) - .with({ age: P.when(age => age > 21) }, (x) => "will match if value.age > 21"); -``` - -▸ **when**\<`input`, `narrowed`, `excluded`\>(`predicate`): `GuardExcludeP`\<`input`, `narrowed`, `excluded`\> - -#### Type parameters - -| Name | -| :--------- | -| `input` | -| `narrowed` | -| `excluded` | - -#### Parameters - -| Name | Type | -| :---------- | :-------------------------------------- | -| `predicate` | (`input`: `input`) => input is narrowed | - -#### Returns - -`GuardExcludeP`\<`input`, `narrowed`, `excluded`\> diff --git a/packages/tools/docs/modules/M.md b/packages/tools/docs/modules/M.md deleted file mode 100644 index 978efa466..000000000 --- a/packages/tools/docs/modules/M.md +++ /dev/null @@ -1,150 +0,0 @@ -[@eslint-react/tools](../README.md) / M - -# Namespace: M - -## Table of contents - -### References - -- [P](M.md#p) - -### Namespaces - -- [Pattern](M.Pattern.md) - -### Functions - -- [isMatching](M.md#ismatching) -- [match](M.md#match) - -## References - -### P - -Renames and re-exports [Pattern](M.Pattern.md) - -## Functions - -### isMatching - -▸ **isMatching**\<`p`\>(`pattern`): (`value`: `unknown`) => value is infer\ - -`isMatching` takes pattern and returns a **type guard** function, cheching if a value matches this pattern. - -[Read documentation for `isMatching` on GitHub](https://github.com/gvergnaud/ts-pattern#ismatching) - -#### Type parameters - -| Name | Type | -| :--- | :----------------------- | -| `p` | extends `UnknownPattern` | - -#### Parameters - -| Name | Type | -| :-------- | :--- | -| `pattern` | `p` | - -#### Returns - -`fn` - -▸ (`value`): value is infer\ - -##### Parameters - -| Name | Type | -| :------ | :-------- | -| `value` | `unknown` | - -##### Returns - -value is infer\ - -**`Example`** - -```ts -const hasName = isMatching({ name: P.string }); - -declare let input: unknown; - -if (hasName(input)) { - // `input` inferred as { name: string } - return input.name; -} -``` - -▸ **isMatching**\<`p`\>(`pattern`, `value`): value is InvertPattern\ - -`isMatching` takes pattern and a value and checks if the value matches this pattern. - -[Read documentation for `isMatching` on GitHub](https://github.com/gvergnaud/ts-pattern#ismatching) - -#### Type parameters - -| Name | Type | -| :--- | :----------------------- | -| `p` | extends `UnknownPattern` | - -#### Parameters - -| Name | Type | -| :-------- | :-------- | -| `pattern` | `p` | -| `value` | `unknown` | - -#### Returns - -value is InvertPattern\ - -**`Example`** - -```ts -declare let input: unknown; - -if (isMatching({ name: P.string }, input)) { - // `input` inferred as { name: string } - return input.name; -} -``` - ---- - -### match - -▸ **match**\<`input`, `output`\>(`value`): `Match`\<`input`, `output`\> - -`match` creates a **pattern matching expression**. - -- Use `.with(pattern, handler)` to pattern match on the input. -- Use `.exhaustive()` or `.otherwise(() => defaultValue)` to end the expression and get the result. - -[Read the documentation for `match` on GitHub](https://github.com/gvergnaud/ts-pattern#match) - -#### Type parameters - -| Name | Type | -| :------- | :------------- | -| `input` | `input` | -| `output` | typeof `unset` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `value` | `input` | - -#### Returns - -`Match`\<`input`, `output`\> - -**`Example`** - -```ts -declare let input: "A" | "B"; - -return match(input) - .with("A", () => "It's an A!") - .with("B", () => "It's a B!") - .exhaustive(); -``` diff --git a/packages/tools/docs/modules/O.md b/packages/tools/docs/modules/O.md index 1bd9af078..6d060da18 100644 --- a/packages/tools/docs/modules/O.md +++ b/packages/tools/docs/modules/O.md @@ -106,9 +106,9 @@ Check if a value in an `Option` type meets a certain predicate. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -156,9 +156,9 @@ Check if a value in an `Option` type meets a certain predicate. #### Parameters -| Name | Type | Description | -| :---------- | :------------------------------------------------- | :---------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | The condition to check. | +| Name | Type | Description | +| :---------- | :------------------------------------------------ | :---------------------- | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | The condition to check. | #### Returns @@ -206,10 +206,10 @@ Check if a value in an `Option` type meets a certain predicate. #### Parameters -| Name | Type | Description | -| :----------- | :-------------------------------------------------------- | :--------------------- | -| `self` | [`Option`](O.md#option)\<`A`\> | The `Option` to check. | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | - | +| Name | Type | Description | +| :----------- | :------------------------------------------------------- | :--------------------- | +| `self` | [`Option`](O.md#option)\<`A`\> | The `Option` to check. | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | - | #### Returns @@ -244,10 +244,10 @@ Check if a value in an `Option` type meets a certain predicate. #### Parameters -| Name | Type | Description | -| :---------- | :------------------------------------------------- | :---------------------- | -| `self` | [`Option`](O.md#option)\<`A`\> | The `Option` to check. | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | The condition to check. | +| Name | Type | Description | +| :---------- | :------------------------------------------------ | :---------------------- | +| `self` | [`Option`](O.md#option)\<`A`\> | The `Option` to check. | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | The condition to check. | #### Returns @@ -1647,9 +1647,9 @@ If you need to change the type of the `Option` in addition to filtering, see `fi #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -1706,9 +1706,9 @@ If you need to change the type of the `Option` in addition to filtering, see `fi #### Parameters -| Name | Type | Description | -| :---------- | :------------------------------------------------- | :--------------------------------------------------- | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | A predicate function to apply to the `Option` value. | +| Name | Type | Description | +| :---------- | :------------------------------------------------ | :--------------------------------------------------- | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | A predicate function to apply to the `Option` value. | #### Returns @@ -1765,10 +1765,10 @@ If you need to change the type of the `Option` in addition to filtering, see `fi #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `self` | [`Option`](O.md#option)\<`A`\> | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `self` | [`Option`](O.md#option)\<`A`\> | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -1812,10 +1812,10 @@ If you need to change the type of the `Option` in addition to filtering, see `fi #### Parameters -| Name | Type | Description | -| :---------- | :------------------------------------------------- | :--------------------------------------------------- | -| `self` | [`Option`](O.md#option)\<`A`\> | - | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | A predicate function to apply to the `Option` value. | +| Name | Type | Description | +| :---------- | :------------------------------------------------ | :--------------------------------------------------- | +| `self` | [`Option`](O.md#option)\<`A`\> | - | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | A predicate function to apply to the `Option` value. | #### Returns @@ -2478,9 +2478,9 @@ if the predicate returns `false`. #### Parameters -| Name | Type | -| :----------- | :-------------------------------------------------------- | -| `refinement` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | +| Name | Type | +| :----------- | :------------------------------------------------------- | +| `refinement` | [`Refinement`](../interfaces/.Refinement.md)\<`A`, `B`\> | #### Returns @@ -2527,9 +2527,9 @@ if the predicate returns `false`. #### Parameters -| Name | Type | Description | -| :---------- | :------------------------------------------------- | :------------------------------------------------------------------------------ | -| `predicate` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | A `Predicate` function that takes in a value of type `A` and returns a boolean. | +| Name | Type | Description | +| :---------- | :------------------------------------------------ | :------------------------------------------------------------------------------ | +| `predicate` | [`Predicate`](../interfaces/.Predicate.md)\<`A`\> | A `Predicate` function that takes in a value of type `A` and returns a boolean. | #### Returns diff --git a/packages/tools/docs/modules/P.md b/packages/tools/docs/modules/P.md deleted file mode 100644 index 95b88427f..000000000 --- a/packages/tools/docs/modules/P.md +++ /dev/null @@ -1,1948 +0,0 @@ -[@eslint-react/tools](../README.md) / P - -# Namespace: P - -## Table of contents - -### Interfaces - -- [Predicate](../interfaces/P.Predicate.md) -- [PredicateTypeLambda](../interfaces/P.PredicateTypeLambda.md) -- [Refinement](../interfaces/P.Refinement.md) - -### Functions - -- [all](P.md#all) -- [and](P.md#and) -- [compose](P.md#compose) -- [eqv](P.md#eqv) -- [every](P.md#every) -- [hasProperty](P.md#hasproperty) -- [implies](P.md#implies) -- [isBigInt](P.md#isbigint) -- [isBoolean](P.md#isboolean) -- [isDate](P.md#isdate) -- [isError](P.md#iserror) -- [isFunction](P.md#isfunction) -- [isIterable](P.md#isiterable) -- [isNever](P.md#isnever) -- [isNotNull](P.md#isnotnull) -- [isNotNullable](P.md#isnotnullable) -- [isNotUndefined](P.md#isnotundefined) -- [isNull](P.md#isnull) -- [isNullable](P.md#isnullable) -- [isNumber](P.md#isnumber) -- [isObject](P.md#isobject) -- [isPromise](P.md#ispromise) -- [isReadonlyRecord](P.md#isreadonlyrecord) -- [isRecord](P.md#isrecord) -- [isString](P.md#isstring) -- [isSymbol](P.md#issymbol) -- [isTagged](P.md#istagged) -- [isUint8Array](P.md#isuint8array) -- [isUndefined](P.md#isundefined) -- [isUnknown](P.md#isunknown) -- [mapInput](P.md#mapinput) -- [nand](P.md#nand) -- [nor](P.md#nor) -- [not](P.md#not) -- [or](P.md#or) -- [product](P.md#product) -- [productMany](P.md#productmany) -- [some](P.md#some) -- [struct](P.md#struct) -- [tuple](P.md#tuple) -- [xor](P.md#xor) - -## Other - -### compose - -▸ **compose**\<`A`, `B`, `C`\>(`bc`): (`ab`: [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\>) => [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `C`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | - -#### Parameters - -| Name | Type | -| :--- | :-------------------------------------------------------- | -| `bc` | [`Refinement`](../interfaces/P.Refinement.md)\<`B`, `C`\> | - -#### Returns - -`fn` - -▸ (`ab`): [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `C`\> - -##### Parameters - -| Name | Type | -| :--- | :-------------------------------------------------------- | -| `ab` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | - -##### Returns - -[`Refinement`](../interfaces/P.Refinement.md)\<`A`, `C`\> - -**`Since`** - -2.0.0 - -▸ **compose**\<`A`, `B`, `C`\>(`ab`, `bc`): [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `C`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | - -#### Parameters - -| Name | Type | -| :--- | :-------------------------------------------------------- | -| `ab` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | -| `bc` | [`Refinement`](../interfaces/P.Refinement.md)\<`B`, `C`\> | - -#### Returns - -[`Refinement`](../interfaces/P.Refinement.md)\<`A`, `C`\> - -**`Since`** - -2.0.0 - ---- - -### struct - -▸ **struct**\<`R`\>(`fields`): [`Predicate`](../interfaces/P.Predicate.md)\<\{ readonly [K in string \| number \| symbol]: [R[K]] extends [Predicate\] ? A : never }\> - -#### Type parameters - -| Name | Type | -| :--- | :--------------------------------------------------------------------------------- | -| `R` | extends `Record`\<`string`, [`Predicate`](../interfaces/P.Predicate.md)\<`any`\>\> | - -#### Parameters - -| Name | Type | -| :------- | :--- | -| `fields` | `R` | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<\{ readonly [K in string \| number \| symbol]: [R[K]] extends [Predicate\] ? A : never }\> - -**`Since`** - -2.0.0 - ---- - -### tuple - -▸ **tuple**\<`T`\>(`...elements`): [`Predicate`](../interfaces/P.Predicate.md)\<`Readonly`\<\{ [I in string \| number \| symbol]: [T[I]] extends [Predicate\] ? A : never }\>\> - -Similar to `Promise.all` but operates on `Predicate`s. - -``` -[Predicate, Predicate, ...] -> Predicate<[A, B, ...]> -``` - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------------------------------- | -| `T` | extends readonly [`Predicate`](../interfaces/P.Predicate.md)\<`any`\>[] | - -#### Parameters - -| Name | Type | -| :------------ | :--- | -| `...elements` | `T` | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`Readonly`\<\{ [I in string \| number \| symbol]: [T[I]] extends [Predicate\] ? A : never }\>\> - -**`Since`** - -2.0.0 - -## combinators - -### and - -▸ **and**\<`A`, `C`\>(`that`): \(`self`: [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\>) => [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B` & `C`\> - -Combines two predicates into a new predicate that returns `true` if both of the predicates returns `true`. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `C` | - -#### Parameters - -| Name | Type | Description | -| :----- | :-------------------------------------------------------- | :----------- | -| `that` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `C`\> | A predicate. | - -#### Returns - -`fn` - -▸ \<`B`\>(`self`): [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B` & `C`\> - -##### Type parameters - -| Name | -| :--- | -| `B` | - -##### Parameters - -| Name | Type | -| :----- | :-------------------------------------------------------- | -| `self` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | - -##### Returns - -[`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B` & `C`\> - -**`Example`** - -```ts -import * as P from "effect/Predicate"; - -const minLength = (n: number) => (s: string) => s.length >= n; -const maxLength = (n: number) => (s: string) => s.length <= n; - -const length = (n: number) => P.and(minLength(n), maxLength(n)); - -assert.deepStrictEqual(length(2)("aa"), true); -assert.deepStrictEqual(length(2)("a"), false); -assert.deepStrictEqual(length(2)("aaa"), false); -``` - -**`Since`** - -2.0.0 - -▸ **and**\<`A`, `B`, `C`\>(`self`, `that`): [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B` & `C`\> - -Combines two predicates into a new predicate that returns `true` if both of the predicates returns `true`. - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | -| `C` | - -#### Parameters - -| Name | Type | Description | -| :----- | :-------------------------------------------------------- | :----------- | -| `self` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B`\> | A predicate. | -| `that` | [`Refinement`](../interfaces/P.Refinement.md)\<`A`, `C`\> | A predicate. | - -#### Returns - -[`Refinement`](../interfaces/P.Refinement.md)\<`A`, `B` & `C`\> - -**`Example`** - -```ts -import * as P from "effect/Predicate"; - -const minLength = (n: number) => (s: string) => s.length >= n; -const maxLength = (n: number) => (s: string) => s.length <= n; - -const length = (n: number) => P.and(minLength(n), maxLength(n)); - -assert.deepStrictEqual(length(2)("aa"), true); -assert.deepStrictEqual(length(2)("a"), false); -assert.deepStrictEqual(length(2)("aaa"), false); -``` - -**`Since`** - -2.0.0 - -▸ **and**\<`A`\>(`that`): (`self`: [`Predicate`](../interfaces/P.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -Combines two predicates into a new predicate that returns `true` if both of the predicates returns `true`. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | Description | -| :----- | :------------------------------------------------- | :----------- | -| `that` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | A predicate. | - -#### Returns - -`fn` - -▸ (`self`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -##### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -##### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Example`** - -```ts -import * as P from "effect/Predicate"; - -const minLength = (n: number) => (s: string) => s.length >= n; -const maxLength = (n: number) => (s: string) => s.length <= n; - -const length = (n: number) => P.and(minLength(n), maxLength(n)); - -assert.deepStrictEqual(length(2)("aa"), true); -assert.deepStrictEqual(length(2)("a"), false); -assert.deepStrictEqual(length(2)("aaa"), false); -``` - -**`Since`** - -2.0.0 - -▸ **and**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -Combines two predicates into a new predicate that returns `true` if both of the predicates returns `true`. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | Description | -| :----- | :------------------------------------------------- | :----------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | A predicate. | -| `that` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | A predicate. | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Example`** - -```ts -import * as P from "effect/Predicate"; - -const minLength = (n: number) => (s: string) => s.length >= n; -const maxLength = (n: number) => (s: string) => s.length <= n; - -const length = (n: number) => P.and(minLength(n), maxLength(n)); - -assert.deepStrictEqual(length(2)("aa"), true); -assert.deepStrictEqual(length(2)("a"), false); -assert.deepStrictEqual(length(2)("aaa"), false); -``` - -**`Since`** - -2.0.0 - ---- - -### eqv - -▸ **eqv**\<`A`\>(`that`): (`self`: [`Predicate`](../interfaces/P.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `that` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -##### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -##### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Since`** - -2.0.0 - -▸ **eqv**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | -| `that` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### implies - -▸ **implies**\<`A`\>(`that`): (`self`: [`Predicate`](../interfaces/P.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `that` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -##### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -##### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Since`** - -2.0.0 - -▸ **implies**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | -| `that` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### mapInput - -▸ **mapInput**\<`B`, `A`\>(`f`): (`self`: [`Predicate`](../interfaces/P.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/P.Predicate.md)\<`B`\> - -Given a `Predicate` returns a `Predicate` - -#### Type parameters - -| Name | -| :--- | -| `B` | -| `A` | - -#### Parameters - -| Name | Type | Description | -| :--- | :---------------- | :---------------------------------- | -| `f` | (`b`: `B`) => `A` | a function to transform `B` to `A`. | - -#### Returns - -`fn` - -▸ (`self`): [`Predicate`](../interfaces/P.Predicate.md)\<`B`\> - -##### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -##### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`B`\> - -**`Example`** - -```ts -import * as P from "effect/Predicate"; -import * as N from "effect/Number"; - -const minLength3 = P.mapInput(N.greaterThan(2), (s: string) => s.length); - -assert.deepStrictEqual(minLength3("a"), false); -assert.deepStrictEqual(minLength3("aa"), false); -assert.deepStrictEqual(minLength3("aaa"), true); -assert.deepStrictEqual(minLength3("aaaa"), true); -``` - -**`Since`** - -2.0.0 - -▸ **mapInput**\<`A`, `B`\>(`self`, `f`): [`Predicate`](../interfaces/P.Predicate.md)\<`B`\> - -Given a `Predicate` returns a `Predicate` - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | Description | -| :----- | :------------------------------------------------- | :------------------------------------------------------ | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | the `Predicate` to be transformed to `Predicate`. | -| `f` | (`b`: `B`) => `A` | a function to transform `B` to `A`. | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`B`\> - -**`Example`** - -```ts -import * as P from "effect/Predicate"; -import * as N from "effect/Number"; - -const minLength3 = P.mapInput(N.greaterThan(2), (s: string) => s.length); - -assert.deepStrictEqual(minLength3("a"), false); -assert.deepStrictEqual(minLength3("aa"), false); -assert.deepStrictEqual(minLength3("aaa"), true); -assert.deepStrictEqual(minLength3("aaaa"), true); -``` - -**`Since`** - -2.0.0 - ---- - -### nand - -▸ **nand**\<`A`\>(`that`): (`self`: [`Predicate`](../interfaces/P.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `that` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -##### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -##### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Since`** - -2.0.0 - -▸ **nand**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | -| `that` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### nor - -▸ **nor**\<`A`\>(`that`): (`self`: [`Predicate`](../interfaces/P.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `that` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -##### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -##### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Since`** - -2.0.0 - -▸ **nor**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | -| `that` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### not - -▸ **not**\<`A`\>(`self`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -Negates the result of a given predicate. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | Description | -| :----- | :------------------------------------------------- | :----------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | A predicate. | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Example`** - -```ts -import * as P from "effect/Predicate"; -import * as N from "effect/Number"; - -const isPositive = P.not(N.lessThan(0)); - -assert.deepStrictEqual(isPositive(-1), false); -assert.deepStrictEqual(isPositive(0), true); -assert.deepStrictEqual(isPositive(1), true); -``` - -**`Since`** - -2.0.0 - ---- - -### or - -▸ **or**\<`A`\>(`that`): (`self`: [`Predicate`](../interfaces/P.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -Combines two predicates into a new predicate that returns `true` if at least one of the predicates returns `true`. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | Description | -| :----- | :------------------------------------------------- | :----------- | -| `that` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | A predicate. | - -#### Returns - -`fn` - -▸ (`self`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -##### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -##### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Example`** - -```ts -import * as P from "effect/Predicate"; -import * as N from "effect/Number"; - -const nonZero = P.or(N.lessThan(0), N.greaterThan(0)); - -assert.deepStrictEqual(nonZero(-1), true); -assert.deepStrictEqual(nonZero(0), false); -assert.deepStrictEqual(nonZero(1), true); -``` - -**`Since`** - -2.0.0 - -▸ **or**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -Combines two predicates into a new predicate that returns `true` if at least one of the predicates returns `true`. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | Description | -| :----- | :------------------------------------------------- | :----------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | A predicate. | -| `that` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | A predicate. | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Example`** - -```ts -import * as P from "effect/Predicate"; -import * as N from "effect/Number"; - -const nonZero = P.or(N.lessThan(0), N.greaterThan(0)); - -assert.deepStrictEqual(nonZero(-1), true); -assert.deepStrictEqual(nonZero(0), false); -assert.deepStrictEqual(nonZero(1), true); -``` - -**`Since`** - -2.0.0 - ---- - -### xor - -▸ **xor**\<`A`\>(`that`): (`self`: [`Predicate`](../interfaces/P.Predicate.md)\<`A`\>) => [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `that` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -`fn` - -▸ (`self`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -##### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -##### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Since`** - -2.0.0 - -▸ **xor**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | -| `that` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Since`** - -2.0.0 - -## combining - -### all - -▸ **all**\<`A`\>(`collection`): [`Predicate`](../interfaces/P.Predicate.md)\ - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----------- | :--------------------------------------------------------------- | -| `collection` | `Iterable`\<[`Predicate`](../interfaces/P.Predicate.md)\<`A`\>\> | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\ - -**`Since`** - -2.0.0 - ---- - -### product - -▸ **product**\<`A`, `B`\>(`self`, `that`): [`Predicate`](../interfaces/P.Predicate.md)\ - -#### Type parameters - -| Name | -| :--- | -| `A` | -| `B` | - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | -| `that` | [`Predicate`](../interfaces/P.Predicate.md)\<`B`\> | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\ - -**`Since`** - -2.0.0 - ---- - -### productMany - -▸ **productMany**\<`A`\>(`self`, `collection`): [`Predicate`](../interfaces/P.Predicate.md)\ - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----------- | :--------------------------------------------------------------- | -| `self` | [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> | -| `collection` | `Iterable`\<[`Predicate`](../interfaces/P.Predicate.md)\<`A`\>\> | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\ - -**`Since`** - -2.0.0 - -## elements - -### every - -▸ **every**\<`A`\>(`collection`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----------- | :--------------------------------------------------------------- | -| `collection` | `Iterable`\<[`Predicate`](../interfaces/P.Predicate.md)\<`A`\>\> | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Since`** - -2.0.0 - ---- - -### some - -▸ **some**\<`A`\>(`collection`): [`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | -| :----------- | :--------------------------------------------------------------- | -| `collection` | `Iterable`\<[`Predicate`](../interfaces/P.Predicate.md)\<`A`\>\> | - -#### Returns - -[`Predicate`](../interfaces/P.Predicate.md)\<`A`\> - -**`Since`** - -2.0.0 - -## guards - -### hasProperty - -▸ **hasProperty**\<`P`\>(`property`): (`self`: `unknown`) => self is \{ [K in PropertyKey]: unknown } - -Checks whether a value is an `object` containing a specified property key. - -#### Type parameters - -| Name | Type | -| :--- | :-------------------- | -| `P` | extends `PropertyKey` | - -#### Parameters - -| Name | Type | Description | -| :--------- | :--- | :------------------------------------ | -| `property` | `P` | The field to check within the object. | - -#### Returns - -`fn` - -▸ (`self`): self is \{ [K in PropertyKey]: unknown } - -##### Parameters - -| Name | Type | -| :----- | :-------- | -| `self` | `unknown` | - -##### Returns - -self is \{ [K in PropertyKey]: unknown } - -**`Since`** - -2.0.0 - -▸ **hasProperty**\<`P`\>(`self`, `property`): self is \{ [K in PropertyKey]: unknown } - -Checks whether a value is an `object` containing a specified property key. - -#### Type parameters - -| Name | Type | -| :--- | :-------------------- | -| `P` | extends `PropertyKey` | - -#### Parameters - -| Name | Type | Description | -| :--------- | :-------- | :------------------------------------ | -| `self` | `unknown` | The value to examine. | -| `property` | `P` | The field to check within the object. | - -#### Returns - -self is \{ [K in PropertyKey]: unknown } - -**`Since`** - -2.0.0 - ---- - -### isBigInt - -▸ **isBigInt**(`input`): input is bigint - -Tests if a value is a `bigint`. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is bigint - -**`Example`** - -```ts -import { isBigInt } from "effect/Predicate"; - -assert.deepStrictEqual(isBigInt(1n), true); - -assert.deepStrictEqual(isBigInt(1), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isBoolean - -▸ **isBoolean**(`input`): input is boolean - -Tests if a value is a `boolean`. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is boolean - -**`Example`** - -```ts -import { isBoolean } from "effect/Predicate"; - -assert.deepStrictEqual(isBoolean(true), true); - -assert.deepStrictEqual(isBoolean("true"), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isDate - -▸ **isDate**(`input`): input is Date - -A guard that succeeds when the input is a `Date`. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is Date - -**`Example`** - -```ts -import { isDate } from "effect/Predicate"; - -assert.deepStrictEqual(isDate(new Date()), true); - -assert.deepStrictEqual(isDate(null), false); -assert.deepStrictEqual(isDate({}), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isError - -▸ **isError**(`input`): input is Error - -A guard that succeeds when the input is an `Error`. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is Error - -**`Example`** - -```ts -import { isError } from "effect/Predicate"; - -assert.deepStrictEqual(isError(new Error()), true); - -assert.deepStrictEqual(isError(null), false); -assert.deepStrictEqual(isError({}), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isFunction - -▸ **isFunction**(`input`): input is Function - -Tests if a value is a `function`. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is Function - -**`Example`** - -```ts -import { isFunction } from "effect/Predicate"; - -assert.deepStrictEqual(isFunction(isFunction), true); - -assert.deepStrictEqual(isFunction("function"), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isIterable - -▸ **isIterable**(`input`): input is Iterable\ - -A guard that succeeds when the input is an `Iterable`. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is Iterable\ - -**`Example`** - -```ts -import { isIterable } from "effect/Predicate"; - -assert.deepStrictEqual(isIterable([]), true); -assert.deepStrictEqual(isIterable(new Set()), true); - -assert.deepStrictEqual(isIterable(null), false); -assert.deepStrictEqual(isIterable({}), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isNever - -▸ **isNever**(`input`): input is never - -A guard that always fails. - -#### Parameters - -| Name | Type | -| :------ | :-------- | -| `input` | `unknown` | - -#### Returns - -input is never - -**`Example`** - -```ts -import { isNever } from "effect/Predicate"; - -assert.deepStrictEqual(isNever(null), false); -assert.deepStrictEqual(isNever(undefined), false); -assert.deepStrictEqual(isNever({}), false); -assert.deepStrictEqual(isNever([]), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isNotNull - -▸ **isNotNull**\<`A`\>(`input`): input is Exclude\ - -Tests if a value is not `undefined`. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | Description | -| :------ | :--- | :----------------- | -| `input` | `A` | The value to test. | - -#### Returns - -input is Exclude\ - -**`Example`** - -```ts -import { isNotNull } from "effect/Predicate"; - -assert.deepStrictEqual(isNotNull(undefined), true); -assert.deepStrictEqual(isNotNull("null"), true); - -assert.deepStrictEqual(isNotNull(null), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isNotNullable - -▸ **isNotNullable**\<`A`\>(`input`): input is NonNullable\ - -A guard that succeeds when the input is not `null` or `undefined`. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | Description | -| :------ | :--- | :----------------- | -| `input` | `A` | The value to test. | - -#### Returns - -input is NonNullable\ - -**`Example`** - -```ts -import { isNotNullable } from "effect/Predicate"; - -assert.deepStrictEqual(isNotNullable({}), true); -assert.deepStrictEqual(isNotNullable([]), true); - -assert.deepStrictEqual(isNotNullable(null), false); -assert.deepStrictEqual(isNotNullable(undefined), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isNotUndefined - -▸ **isNotUndefined**\<`A`\>(`input`): input is Exclude\ - -Tests if a value is not `undefined`. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | Description | -| :------ | :--- | :----------------- | -| `input` | `A` | The value to test. | - -#### Returns - -input is Exclude\ - -**`Example`** - -```ts -import { isNotUndefined } from "effect/Predicate"; - -assert.deepStrictEqual(isNotUndefined(null), true); -assert.deepStrictEqual(isNotUndefined("undefined"), true); - -assert.deepStrictEqual(isNotUndefined(undefined), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isNull - -▸ **isNull**(`input`): input is null - -Tests if a value is `undefined`. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is null - -**`Example`** - -```ts -import { isNull } from "effect/Predicate"; - -assert.deepStrictEqual(isNull(null), true); - -assert.deepStrictEqual(isNull(undefined), false); -assert.deepStrictEqual(isNull("null"), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isNullable - -▸ **isNullable**\<`A`\>(`input`): input is Extract\ - -A guard that succeeds when the input is `null` or `undefined`. - -#### Type parameters - -| Name | -| :--- | -| `A` | - -#### Parameters - -| Name | Type | Description | -| :------ | :--- | :----------------- | -| `input` | `A` | The value to test. | - -#### Returns - -input is Extract\ - -**`Example`** - -```ts -import { isNullable } from "effect/Predicate"; - -assert.deepStrictEqual(isNullable(null), true); -assert.deepStrictEqual(isNullable(undefined), true); - -assert.deepStrictEqual(isNullable({}), false); -assert.deepStrictEqual(isNullable([]), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isNumber - -▸ **isNumber**(`input`): input is number - -Tests if a value is a `number`. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is number - -**`Example`** - -```ts -import { isNumber } from "effect/Predicate"; - -assert.deepStrictEqual(isNumber(2), true); - -assert.deepStrictEqual(isNumber("2"), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isObject - -▸ **isObject**(`input`): input is object - -Tests if a value is an `object`. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is object - -**`Example`** - -```ts -import { isObject } from "effect/Predicate"; - -assert.deepStrictEqual(isObject({}), true); -assert.deepStrictEqual(isObject([]), true); - -assert.deepStrictEqual(isObject(null), false); -assert.deepStrictEqual(isObject(undefined), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isPromise - -▸ **isPromise**(`input`): input is Promise\ - -A guard that succeeds when the input is a Promise. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is Promise\ - -**`Example`** - -```ts -import { isPromise } from "effect/Predicate"; - -assert.deepStrictEqual(isPromise({}), false); -assert.deepStrictEqual(isPromise(Promise.resolve("hello")), true); -``` - -**`Since`** - -2.0.0 - ---- - -### isReadonlyRecord - -▸ **isReadonlyRecord**(`input`): input is Object - -A guard that succeeds when the input is a readonly record. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is Object - -**`Example`** - -```ts -import { isReadonlyRecord } from "effect/Predicate"; - -assert.deepStrictEqual(isReadonlyRecord({}), true); -assert.deepStrictEqual(isReadonlyRecord({ a: 1 }), true); - -assert.deepStrictEqual(isReadonlyRecord([]), false); -assert.deepStrictEqual(isReadonlyRecord([1, 2, 3]), false); -assert.deepStrictEqual(isReadonlyRecord(null), false); -assert.deepStrictEqual(isReadonlyRecord(undefined), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isRecord - -▸ **isRecord**(`input`): input is Object - -A guard that succeeds when the input is a record. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is Object - -**`Example`** - -```ts -import { isRecord } from "effect/Predicate"; - -assert.deepStrictEqual(isRecord({}), true); -assert.deepStrictEqual(isRecord({ a: 1 }), true); - -assert.deepStrictEqual(isRecord([]), false); -assert.deepStrictEqual(isRecord([1, 2, 3]), false); -assert.deepStrictEqual(isRecord(null), false); -assert.deepStrictEqual(isRecord(undefined), false); -assert.deepStrictEqual(isRecord(() => null), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isString - -▸ **isString**(`input`): input is string - -Tests if a value is a `string`. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is string - -**`Example`** - -```ts -import { isString } from "effect/Predicate"; - -assert.deepStrictEqual(isString("a"), true); - -assert.deepStrictEqual(isString(1), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isSymbol - -▸ **isSymbol**(`input`): input is symbol - -Tests if a value is a `symbol`. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is symbol - -**`Example`** - -```ts -import { isSymbol } from "effect/Predicate"; - -assert.deepStrictEqual(isSymbol(Symbol.for("a")), true); - -assert.deepStrictEqual(isSymbol("a"), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isTagged - -▸ **isTagged**\<`K`\>(`tag`): (`self`: `unknown`) => self is Object - -Tests if a value is an `object` with a property `_tag` that matches the given tag. - -#### Type parameters - -| Name | Type | -| :--- | :--------------- | -| `K` | extends `string` | - -#### Parameters - -| Name | Type | Description | -| :---- | :--- | :------------------- | -| `tag` | `K` | The tag to test for. | - -#### Returns - -`fn` - -▸ (`self`): self is Object - -##### Parameters - -| Name | Type | -| :----- | :-------- | -| `self` | `unknown` | - -##### Returns - -self is Object - -**`Example`** - -```ts -import { isTagged } from "effect/Predicate"; - -assert.deepStrictEqual(isTagged(1, "a"), false); -assert.deepStrictEqual(isTagged(null, "a"), false); -assert.deepStrictEqual(isTagged({}, "a"), false); -assert.deepStrictEqual(isTagged({ a: "a" }, "a"), false); -assert.deepStrictEqual(isTagged({ _tag: "a" }, "a"), true); -assert.deepStrictEqual(isTagged("a")({ _tag: "a" }), true); -``` - -**`Since`** - -2.0.0 - -▸ **isTagged**\<`K`\>(`self`, `tag`): self is Object - -Tests if a value is an `object` with a property `_tag` that matches the given tag. - -#### Type parameters - -| Name | Type | -| :--- | :--------------- | -| `K` | extends `string` | - -#### Parameters - -| Name | Type | Description | -| :----- | :-------- | :------------------- | -| `self` | `unknown` | - | -| `tag` | `K` | The tag to test for. | - -#### Returns - -self is Object - -**`Example`** - -```ts -import { isTagged } from "effect/Predicate"; - -assert.deepStrictEqual(isTagged(1, "a"), false); -assert.deepStrictEqual(isTagged(null, "a"), false); -assert.deepStrictEqual(isTagged({}, "a"), false); -assert.deepStrictEqual(isTagged({ a: "a" }, "a"), false); -assert.deepStrictEqual(isTagged({ _tag: "a" }, "a"), true); -assert.deepStrictEqual(isTagged("a")({ _tag: "a" }), true); -``` - -**`Since`** - -2.0.0 - ---- - -### isUint8Array - -▸ **isUint8Array**(`input`): input is Uint8Array - -A guard that succeeds when the input is a `Uint8Array`. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is Uint8Array - -**`Example`** - -```ts -import { isUint8Array } from "effect/Predicate"; - -assert.deepStrictEqual(isUint8Array(new Uint8Array()), true); - -assert.deepStrictEqual(isUint8Array(null), false); -assert.deepStrictEqual(isUint8Array({}), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isUndefined - -▸ **isUndefined**(`input`): input is undefined - -Tests if a value is `undefined`. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :----------------- | -| `input` | `unknown` | The value to test. | - -#### Returns - -input is undefined - -**`Example`** - -```ts -import { isUndefined } from "effect/Predicate"; - -assert.deepStrictEqual(isUndefined(undefined), true); - -assert.deepStrictEqual(isUndefined(null), false); -assert.deepStrictEqual(isUndefined("undefined"), false); -``` - -**`Since`** - -2.0.0 - ---- - -### isUnknown - -▸ **isUnknown**(`input`): input is unknown - -A guard that always succeeds. - -#### Parameters - -| Name | Type | -| :------ | :-------- | -| `input` | `unknown` | - -#### Returns - -input is unknown - -**`Example`** - -```ts -import { isUnknown } from "effect/Predicate"; - -assert.deepStrictEqual(isUnknown(null), true); -assert.deepStrictEqual(isUnknown(undefined), true); - -assert.deepStrictEqual(isUnknown({}), true); -assert.deepStrictEqual(isUnknown([]), true); -``` - -**`Since`** - -2.0.0 diff --git a/packages/tools/package.json b/packages/tools/package.json index a180778a2..8f900356c 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -42,7 +42,6 @@ "publish": "pnpm run build && pnpm run lint:publish" }, "dependencies": { - "effect": "2.0.0-next.60", - "ts-pattern": "5.0.6" + "effect": "2.0.0-next.60" } } diff --git a/packages/tools/src/array.ts b/packages/tools/src/array.ts deleted file mode 100644 index 846b75004..000000000 --- a/packages/tools/src/array.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Returns the element type of an array. - * @since 0.4.0 - * @template T type of the array elements. - * @param arr The array to get the element type from. - * @returns The element type of the array. - */ -export type ArrayElement = A extends readonly (infer T)[] ? T : never; - -/** - * Returns a new array with unique values based on the given function. - * @since 0.0.1 - * @template T type of the array elements. - * @param arr The array to filter. - * @param fn The function to get the value to compare. - * @returns new array with unique values. - */ -export function uniqueBy(arr: readonly T[], fn: (x: T) => unknown): T[] { - return arr.filter((x, i, a) => a.findIndex((y) => fn(x) === fn(y)) === i); -} diff --git a/packages/tools/src/function.ts b/packages/tools/src/function.ts deleted file mode 100644 index 837dcaa24..000000000 --- a/packages/tools/src/function.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @since 0.0.1 - */ -// eslint-disable-next-line @typescript-eslint/no-empty-function -export const noop = () => {}; - -/** - * @since 0.0.1 - * @param a The value to return. - */ -export const identity = (a: T) => a; diff --git a/packages/tools/src/guard.ts b/packages/tools/src/guard.ts deleted file mode 100644 index 609d969b8..000000000 --- a/packages/tools/src/guard.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @since 0.9.0 - */ -export type Guard = (x: unknown) => x is T; - -/** - * @since 0.9.0 - */ -export type KeyGuard = Guard; - -/** - * @since 0.9.0 - */ -export type GuardReturnType = T extends Guard ? U : never; - -/** - * @since 0.9.0 - */ -export type GuardRecord = Record; - -/** - * @since 0.9.0 - */ -export type LazyGuardRecord = Record Guard>; diff --git a/packages/tools/src/helper.ts b/packages/tools/src/helper.ts index 060801b92..f83441e8e 100644 --- a/packages/tools/src/helper.ts +++ b/packages/tools/src/helper.ts @@ -1,30 +1,177 @@ -/** - * @since 0.9.0 - */ -export type Assume = T extends U ? T : never; - -/** - * @since 0.4.0 - */ -export type Cast = X extends Y ? X : Y; - -/** - * @since 0.9.0 - */ -export type Defined = T extends undefined ? never : T; - -/** - * @since 0.0.1 - */ -export type Remap = { - [P in keyof T]: T[P]; -}; - -/** - * @since 0.0.1 - */ -export type Pretty = - & { - [P in keyof T]: T[P]; +export namespace Helper { + /** + * @param a + * @since 0.0.1 + */ + export const id = (a: T) => a; + + /** + * @since 0.0.1 + */ + // eslint-disable-next-line @typescript-eslint/no-empty-function + export const noop = () => {}; + + /** + * @param a + * @since 0.0.1 + */ + export const constant = (a: T) => () => a; + /** + * @param a The value to infer. + * @since 0.0.1 + */ + export const asConst = (a: T) => a; + + /* eslint-disable functional/prefer-immutable-types */ + /** + * Infers embedded primitive type of any type + * @since 0.0.1 + * @param T Type to infer + * @returns Embedded type of {@link TType} + * @example + * type Result = Narrow<['foo', 'bar', 1]> + * @see https://twitter.com/hd_nvim/status/1578567206190780417 + */ + export type Narrow = + | { [K in keyof TType]: Narrow } + | (TType extends [] ? [] : never) + | (TType extends Function ? TType : never) + | (TType extends bigint | boolean | number | string ? TType : never); + + /** + * Infers embedded primitive type of any type + * Same as `as const` but without setting the object as readonly and without needing the user to use it. + * @since 0.0.1 + * @param a Value to infer + * @returns Value with embedded type inferred + * @example + * const result = narrow(['foo', 'bar', 1]) + */ + export const narrow = (a: Narrow) => a; + + export namespace Debug { + /** + * @since 0.0.1 + */ + export type Remap = { + [P in keyof T]: T[P]; + }; + + /** + * @since 0.0.1 + */ + export type Pretty = + & { + [P in keyof T]: T[P]; + } + & {}; + } + + export namespace Union { + /** + * @since 0.0.1 + * @template T The type to get the union from + * @example + * type Result = UnionFromTuple<['foo', 'bar', 1]> + * // Result = 'foo' | 'bar' | 1 + */ + export type UnionFromTuple = T extends (infer U)[] ? U : never; + + /** + * @since 0.0.1 + * @template T The type to get the intersection from + * @example + * type Result = IntersectionFromTuple<['foo', 'bar', 1]> + * // Result = 'foo' & 'bar' & 1 + */ + export type UnionToIntersection = ( + U extends unknown ? (k: U) => void : never + ) extends (k: infer I) => void + // dprint-ignore + ? I + : never; + } + + export namespace Record { + /** + * @since 0.4.0 + */ + type Cast = X extends Y ? X : Y; + + /** + * Returns the element type of an array. + * @since 0.4.0 + * @template T type of the array elements. + * @param arr The array to get the element type from. + * @returns The element type of the array. + */ + type ArrayElement = A extends readonly (infer T)[] ? T : never; + + /** + * A record with loose keys. + * @template T The type of the values. + * @since 0.4.0 + */ + export type LooseRecord = Record; + + export type DeepWriteable = { -readonly [P in keyof T]: DeepWriteable }; + + export type FromEntries = T extends [infer Key, unknown][] + ? { [K in Cast]: Extract, [K, unknown]>[1] } + : { [key in string]: unknown }; + + export type FromEntriesWithReadOnly = FromEntries>; + + // fromEntries(obj: T): FromEntriesWithReadOnly + + /* eslint-disable @susisu/safe-typescript/no-type-assertion */ + /** + * type-safe version of Object.fromEntries + * @param entries The entries to create the object from. + * @returns The object created from the entries. + * @since 0.4.0 + */ + export const fromEntries = (entries: T) => { + return Object.fromEntries(entries) as FromEntries; + }; + + /** + * type-safe version of Object.fromEntries + * @param entries The entries to create the object from. + * @returns The object created from the entries. + * @since 0.4.0 + */ + export const fromEntriesWithReadOnly = (entries: T) => { + return Object.fromEntries(entries) as FromEntriesWithReadOnly; + }; + + /** + * type-safe version of Object.entries + * @param value The value to get the entries from. + * @returns The entries of the value. + * @since 0.4.0 + */ + export const entries = >(value: T) => { + return Object.entries(value) as { + [K in keyof T]-?: [K, T[K]]; + }[keyof T][]; + }; + + /** + * type-safe version of Object.keys + * @param value The value to get the keys from. + * @returns The keys of the value. + * @since 0.4.0 + */ + export const keys = >(value: T) => Object.keys(value) as (keyof T)[]; + + /** + * type-safe version of Object.values + * @param value The value to get the values from. + * @returns The values of the value. + * @since 0.4.0 + */ + export const values = >(value: T) => Object.values(value) as T[keyof T][]; + /* eslint-enable @susisu/safe-typescript/no-type-assertion */ } - & {}; +} diff --git a/packages/tools/src/index.ts b/packages/tools/src/index.ts index e14388132..1cba93e7f 100644 --- a/packages/tools/src/index.ts +++ b/packages/tools/src/index.ts @@ -1,10 +1,2 @@ -export * from "./array"; -export * from "./effect"; -export * from "./function"; -export * from "./guard"; export * from "./helper"; -export * from "./match"; -export * from "./narrow"; -export * from "./predicate"; -export * from "./record"; -export * from "./union"; +export * from "./std"; diff --git a/packages/tools/src/match.ts b/packages/tools/src/match.ts deleted file mode 100644 index 610bb8304..000000000 --- a/packages/tools/src/match.ts +++ /dev/null @@ -1 +0,0 @@ -export * as M from "ts-pattern"; diff --git a/packages/tools/src/narrow.ts b/packages/tools/src/narrow.ts deleted file mode 100644 index f9909ee59..000000000 --- a/packages/tools/src/narrow.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* eslint-disable functional/prefer-immutable-types */ -/** - * Infers embedded primitive type of any type - * @since 0.0.1 - * @param T Type to infer - * @returns Embedded type of {@link TType} - * @example - * type Result = Narrow<['foo', 'bar', 1]> - * @see https://twitter.com/hd_nvim/status/1578567206190780417 - */ -export type Narrow = - | { [K in keyof TType]: Narrow } - | (TType extends [] ? [] : never) - | (TType extends Function ? TType : never) - | (TType extends bigint | boolean | number | string ? TType : never); - -/** - * Infers embedded primitive type of any type - * Same as `as const` but without setting the object as readonly and without needing the user to use it. - * @since 0.0.1 - * @param a Value to infer - * @returns Value with embedded type inferred - * @example - * const result = narrow(['foo', 'bar', 1]) - */ -export const narrow = (a: Narrow) => a; - -/** - * @param a The value to infer. - * @since 0.0.1 - */ -export const asConst = (a: T) => a; diff --git a/packages/tools/src/predicate.ts b/packages/tools/src/predicate.ts deleted file mode 100644 index 319e4eef0..000000000 --- a/packages/tools/src/predicate.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { P } from "./effect"; -import type { Guard, GuardRecord, GuardReturnType, KeyGuard, LazyGuardRecord } from "./guard"; - -/** - * @since 0.9.0 - * @param guards The guards to check. - * @returns A guard that checks if given value is the kind of union. - */ -export const isKindOfUnion = - // dprint-ignore - (...guards: T) => - (x: unknown): x is GuardReturnType => - guards.some((g) => g(x)); - -/** - * @since 0.9.0 - * @param isK The guard for the key. - * @param isV The guard for the value. - * @returns A guard that checks if given value is the kind of record. - */ -export const isKindOfRecord = - // dprint-ignore - (isK: K, isV: V) => - (x: unknown): x is Record, GuardReturnType> => - P.isObject(x) && - Object.entries(x).every(([k, v]) => isK(k) ? isV(v) : true); - -/** - * @since 0.9.0 - * @param guards The guards to check. - * @returns A guard that checks if given value is the kind of object. - */ -export const isKindOfObject = - // dprint-ignore - (guards: T) => - (x: unknown): x is { [key in keyof T]: GuardReturnType } => - P.isObject(x) && - // eslint-disable-next-line security/detect-object-injection - Object.entries(x).every(([key, value]) => guards[key]?.(value)); - -/** - * @since 0.9.0 - */ -export const isKindObjectLazy = - // dprint-ignore - (guards: T) => - (x: unknown): x is { [key in keyof T]: GuardReturnType> } => - P.isObject(x) && - // eslint-disable-next-line security/detect-object-injection - Object.entries(x).every(([key, value]) => guards[key]?.()(value)); - -/** - * @since 0.9.0 - * @param guard The guard to check. - * @returns A guard that checks if given value is the kind of array. - */ -export const isKindOfArray = - // dprint-ignore - (guard: T) => - (x: unknown): x is T[] => - Array.isArray(x) && x.every((y) => guard(y)); - -/** - * @since 0.9.0 - * @param guards The guards to check. - * @returns A guard that checks if given value is the kind of tuple. - */ -export const isKindOfTuple = - // dprint-ignore - (guards: T) => - (x: unknown): x is { [key in keyof T]: GuardReturnType } => - Array.isArray(x) && - x.length === guards.length && - // eslint-disable-next-line security/detect-object-injection - x.every((y, i) => guards[i]?.(y)); - -/** - * @since 0.9.0 - */ -export const isKindOfOptional = - // dprint-ignore - (guard: Guard) => - (x: unknown): x is T | undefined => - x === undefined || guard(x); diff --git a/packages/tools/src/record.ts b/packages/tools/src/record.ts deleted file mode 100644 index 69bde1b78..000000000 --- a/packages/tools/src/record.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* eslint-disable @susisu/safe-typescript/no-type-assertion */ -import type { ArrayElement } from "./array"; -import type { Cast, Pretty } from "./helper"; - -/** - * @since 0.3.4 - */ -export type FieldDiff = Omit | Omit; - -/** - * @since 0.3.4 - */ -export type Combine = Pretty< - { - [K in keyof (T1 | T2)]: T1[K] | T2[K]; - } & Partial ->; - -/** - * A record with loose keys. - * @template T The type of the values. - * @since 0.4.0 - */ -export type LooseRecord = Record; - -export type DeepWriteable = { -readonly [P in keyof T]: DeepWriteable }; - -export type FromEntries = T extends [infer Key, unknown][] - ? { [K in Cast]: Extract, [K, unknown]>[1] } - : { [key in string]: unknown }; - -export type FromEntriesWithReadOnly = FromEntries>; - -// fromEntries(obj: T): FromEntriesWithReadOnly - -/** - * type-safe version of Object.fromEntries - * @param entries The entries to create the object from. - * @returns The object created from the entries. - * @since 0.4.0 - */ -export const fromEntries = (entries: T) => { - return Object.fromEntries(entries) as FromEntries; -}; - -/** - * type-safe version of Object.fromEntries - * @param entries The entries to create the object from. - * @returns The object created from the entries. - * @since 0.4.0 - */ -export const fromEntriesWithReadOnly = (entries: T) => { - return Object.fromEntries(entries) as FromEntriesWithReadOnly; -}; - -/** - * type-safe version of Object.entries - * @param value The value to get the entries from. - * @returns The entries of the value. - * @since 0.4.0 - */ -export const entries = >(value: T) => { - return Object.entries(value) as { - [K in keyof T]-?: [K, T[K]]; - }[keyof T][]; -}; - -/** - * type-safe version of Object.keys - * @param value The value to get the keys from. - * @returns The keys of the value. - * @since 0.4.0 - */ -export const keys = >(value: T) => Object.keys(value) as (keyof T)[]; - -/** - * type-safe version of Object.values - * @param value The value to get the values from. - * @returns The values of the value. - * @since 0.4.0 - */ -export const values = >(value: T) => Object.values(value) as T[keyof T][]; diff --git a/packages/tools/src/effect.ts b/packages/tools/src/std.ts similarity index 86% rename from packages/tools/src/effect.ts rename to packages/tools/src/std.ts index abc7c127c..c8ce1e0a4 100644 --- a/packages/tools/src/effect.ts +++ b/packages/tools/src/std.ts @@ -1,4 +1,3 @@ -export * as Chunk from "effect/Chunk"; export * as Data from "effect/Data"; export * as E from "effect/Either"; export * as Equal from "effect/Equal"; @@ -8,7 +7,7 @@ export * as MutList from "effect/MutableList"; export * as MutRef from "effect/MutableRef"; export * as O from "effect/Option"; export * as Ord from "effect/Order"; -export * as P from "effect/Predicate"; +export * as _ from "effect/Predicate"; export * as Array from "effect/ReadonlyArray"; export * as Record from "effect/ReadonlyRecord"; export * as Ref from "effect/Ref"; diff --git a/packages/tools/src/union.ts b/packages/tools/src/union.ts deleted file mode 100644 index d079bf009..000000000 --- a/packages/tools/src/union.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @since 0.0.1 - * @template T The type to get the union from - * @example - * type Result = UnionFromTuple<['foo', 'bar', 1]> - * // Result = 'foo' | 'bar' | 1 - */ -export type UnionFromTuple = T extends (infer U)[] ? U : never; - -/** - * @since 0.0.1 - * @template T The type to get the intersection from - * @example - * type Result = IntersectionFromTuple<['foo', 'bar', 1]> - * // Result = 'foo' & 'bar' & 1 - */ -export type UnionToIntersection = ( - U extends unknown ? (k: U) => void : never -) extends (k: infer I) => void - // dprint-ignore - ? I - : never; diff --git a/packages/types/package.json b/packages/types/package.json index a1cb8f459..72c3bac67 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -43,8 +43,7 @@ }, "dependencies": { "@eslint-react/tools": "workspace:*", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/utils": "6.14.0", - "string-ts": "1.3.3" + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/utils": "6.15.0" } } diff --git a/packages/utils/docs/classes/CaseValidator.md b/packages/utils/docs/classes/CaseValidator.md deleted file mode 100644 index 0d6e735f0..000000000 --- a/packages/utils/docs/classes/CaseValidator.md +++ /dev/null @@ -1,88 +0,0 @@ -[@eslint-react/shared](../README.md) / CaseValidator - -# Class: CaseValidator - -## Table of contents - -### Constructors - -- [constructor](CaseValidator.md#constructor) - -### Properties - -- [#expression](CaseValidator.md##expression) -- [#ignorePatterns](CaseValidator.md##ignorepatterns) -- [#recommendationBuilder](CaseValidator.md##recommendationbuilder) - -### Methods - -- [getRecommendedName](CaseValidator.md#getrecommendedname) -- [validate](CaseValidator.md#validate) - -## Constructors - -### constructor - -• **new CaseValidator**(`expression`, `ignorePatterns`, `recommendationBuilder?`): [`CaseValidator`](CaseValidator.md) - -#### Parameters - -| Name | Type | -| :---------------------- | :---------------------- | -| `expression` | `RegExp` | -| `ignorePatterns` | `RegExp`[] | -| `recommendationBuilder` | `RecommendationBuilder` | - -#### Returns - -[`CaseValidator`](CaseValidator.md) - -## Properties - -### #expression - -• `Private` `Readonly` **#expression**: `RegExp` - ---- - -### #ignorePatterns - -• `Private` `Readonly` **#ignorePatterns**: `RegExp`[] - ---- - -### #recommendationBuilder - -• `Private` `Readonly` **#recommendationBuilder**: `RecommendationBuilder` - -## Methods - -### getRecommendedName - -▸ **getRecommendedName**(`name`): `string` - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `name` | `string` | - -#### Returns - -`string` - ---- - -### validate - -▸ **validate**(`name`): `boolean` - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `name` | `string` | - -#### Returns - -`boolean` diff --git a/packages/utils/src/case-convert.ts b/packages/utils/src/case-convert.ts deleted file mode 100644 index aa85785ba..000000000 --- a/packages/utils/src/case-convert.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { camelCase, constantCase, kebabCase, pascalCase, snakeCase } from "string-ts"; - -const converters = { - CONSTANT_CASE: constantCase, - PascalCase: pascalCase, - camelCase, - "kebab-case": kebabCase, - snake_case: snakeCase, -} as const; - -// eslint-disable-next-line security/detect-object-injection -export const getCaseConverter = (rule: keyof typeof converters) => converters[rule]; diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts deleted file mode 100644 index b5704cad3..000000000 --- a/packages/utils/src/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./case-convert"; -export * from "./case-validator"; -export * from "./create-rule"; -export * from "./merge-configs"; -export * from "./uid"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8a489ba45..ab0704b47 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,12 +5,12 @@ settings: excludeLinksFromLockfile: false overrides: - '@typescript-eslint/parser': '>=6.14.0' - '@typescript-eslint/scope-manager': 6.14.0 - '@typescript-eslint/type-utils': 6.14.0 - '@typescript-eslint/types': 6.14.0 - '@typescript-eslint/utils': 6.14.0 - '@typescript-eslint/eslint-plugin': 6.14.0 + '@typescript-eslint/parser': '>=6.15.0' + '@typescript-eslint/scope-manager': 6.15.0 + '@typescript-eslint/type-utils': 6.15.0 + '@typescript-eslint/types': 6.15.0 + '@typescript-eslint/utils': 6.15.0 + '@typescript-eslint/eslint-plugin': 6.15.0 eslint: '>=8.56.0' effect: 2.0.0-next.60 next: 14.0.4 @@ -52,8 +52,8 @@ importers: specifier: 11.1.5 version: 11.1.5(rollup@4.9.1)(typescript@5.3.3) '@swc/core': - specifier: 1.3.100 - version: 1.3.100 + specifier: 1.3.101 + version: 1.3.101 '@tsconfig/node20': specifier: 20.1.2 version: 20.1.2 @@ -61,17 +61,17 @@ importers: specifier: 2.0.2 version: 2.0.2 '@types/node': - specifier: 20.10.4 - version: 20.10.4 + specifier: 20.10.5 + version: 20.10.5 '@typescript-eslint/eslint-plugin': - specifier: 6.14.0 - version: 6.14.0(@typescript-eslint/parser@6.14.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: '>=6.14.0' - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: '>=6.15.0' + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/rule-tester': - specifier: 6.14.0 - version: 6.14.0(@eslint/eslintrc@2.1.4)(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(@eslint/eslintrc@2.1.4)(eslint@8.56.0)(typescript@5.3.3) '@vitest/ui': specifier: 1.0.4 version: 1.0.4(vitest@1.0.4) @@ -88,8 +88,8 @@ importers: specifier: 1.5.1 version: 1.5.1 dprint: - specifier: 0.43.2 - version: 0.43.2 + specifier: 0.44.0 + version: 0.44.0 effect: specifier: 2.0.0-next.60 version: 2.0.0-next.60 @@ -97,8 +97,8 @@ importers: specifier: '>=8.56.0' version: 8.56.0 eslint-config-with-tsconfig: - specifier: 2.9.170 - version: 2.9.170(@susisu/eslint-plugin-safe-typescript@0.5.2)(eslint@8.56.0)(tailwindcss@3.3.6)(typescript@5.3.3) + specifier: 2.9.200 + version: 2.9.200(@susisu/eslint-plugin-safe-typescript@0.5.2)(eslint@8.56.0)(tailwindcss@3.3.6)(typescript@5.3.3) eslint-plugin-eslint-plugin: specifier: 5.2.1 version: 5.2.1(eslint@8.56.0) @@ -115,8 +115,8 @@ importers: specifier: 7.1.0 version: 7.1.0(eslint@8.56.0)(typescript@5.3.3) eslint-plugin-vitest: - specifier: 0.3.17 - version: 0.3.17(@typescript-eslint/eslint-plugin@6.14.0)(eslint@8.56.0)(typescript@5.3.3)(vitest@1.0.4) + specifier: 0.3.18 + version: 0.3.18(@typescript-eslint/eslint-plugin@6.15.0)(eslint@8.56.0)(typescript@5.3.3)(vitest@1.0.4) fast-equals: specifier: 5.0.1 version: 5.0.1 @@ -124,8 +124,8 @@ importers: specifier: 8.0.3 version: 8.0.3 knip: - specifier: 3.8.1 - version: 3.8.1(@types/node@20.10.4)(typescript@5.3.3) + specifier: 3.8.2 + version: 3.8.2(@types/node@20.10.5)(typescript@5.3.3) markdownlint: specifier: 0.32.1 version: 0.32.1 @@ -143,7 +143,7 @@ importers: version: 6.1.0(rollup@4.9.1)(typescript@5.3.3) rollup-plugin-swc3: specifier: 0.11.0 - version: 0.11.0(@swc/core@1.3.100)(rollup@4.9.1) + version: 0.11.0(@swc/core@1.3.101)(rollup@4.9.1) rollup-plugin-visualizer: specifier: 5.11.0 version: 5.11.0(rollup@4.9.1) @@ -185,7 +185,7 @@ importers: version: 5.3.3 vitest: specifier: 1.0.4 - version: 1.0.4(@types/node@20.10.4)(@vitest/ui@1.0.4) + version: 1.0.4(@types/node@20.10.5)(@vitest/ui@1.0.4) examples/with-flat-config: dependencies: @@ -212,11 +212,11 @@ importers: specifier: 18.2.17 version: 18.2.17 '@typescript-eslint/eslint-plugin': - specifier: 6.14.0 - version: 6.14.0(@typescript-eslint/parser@6.14.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: '>=6.14.0' - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: '>=6.15.0' + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@vitejs/plugin-react': specifier: 4.2.1 version: 4.2.1(vite@5.0.10) @@ -234,7 +234,7 @@ importers: version: 5.3.3 vite: specifier: 5.0.10 - version: 5.0.10(@types/node@20.10.4) + version: 5.0.10(@types/node@20.10.5) examples/with-legacy-config: dependencies: @@ -261,11 +261,11 @@ importers: specifier: 18.2.17 version: 18.2.17 '@typescript-eslint/eslint-plugin': - specifier: 6.14.0 - version: 6.14.0(@typescript-eslint/parser@6.14.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: '>=6.14.0' - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: '>=6.15.0' + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@vitejs/plugin-react': specifier: 4.2.1 version: 4.2.1(vite@5.0.10) @@ -283,13 +283,10 @@ importers: version: 5.3.3 vite: specifier: 5.0.10 - version: 5.0.10(@types/node@20.10.4) + version: 5.0.10(@types/node@20.10.5) packages/ast: dependencies: - '@eslint-community/eslint-utils': - specifier: 4.4.0 - version: 4.4.0(eslint@8.56.0) '@eslint-react/shared': specifier: workspace:* version: link:../shared @@ -300,14 +297,14 @@ importers: specifier: workspace:* version: link:../types '@typescript-eslint/scope-manager': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/types': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) rambda: specifier: 8.6.0 version: 8.6.0 @@ -320,6 +317,9 @@ importers: '@eslint-react/ast': specifier: workspace:* version: link:../ast + '@eslint-react/eslint-utils': + specifier: workspace:* + version: link:../eslint-utils '@eslint-react/jsx': specifier: workspace:* version: link:../jsx @@ -332,21 +332,21 @@ importers: '@eslint-react/types': specifier: workspace:* version: link:../types - '@eslint-react/utils': - specifier: workspace:* - version: link:../utils '@typescript-eslint/scope-manager': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/type-utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/types': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) + short-unique-id: + specifier: 5.0.3 + version: 5.0.3 packages/eslint-plugin: dependencies: @@ -375,26 +375,23 @@ importers: specifier: workspace:* version: link:../types '@typescript-eslint/parser': - specifier: '>=6.14.0' - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: '>=6.15.0' + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/scope-manager': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/type-utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/types': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: specifier: '>=8.56.0' version: 8.56.0 - string-ts: - specifier: 1.3.3 - version: 1.3.3 typescript: specifier: '>=5.3.3' version: 5.3.3 @@ -407,6 +404,9 @@ importers: '@eslint-react/core': specifier: workspace:* version: link:../core + '@eslint-react/eslint-utils': + specifier: workspace:* + version: link:../eslint-utils '@eslint-react/jsx': specifier: workspace:* version: link:../jsx @@ -419,42 +419,27 @@ importers: '@eslint-react/types': specifier: workspace:* version: link:../types - '@eslint-react/utils': - specifier: workspace:* - version: link:../utils '@typescript-eslint/parser': - specifier: '>=6.14.0' - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: '>=6.15.0' + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/scope-manager': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/type-utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/types': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) - dedent: - specifier: 1.5.1 - version: 1.5.1 - effect: - specifier: 2.0.0-next.60 - version: 2.0.0-next.60 + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: specifier: '>=8.56.0' version: 8.56.0 - rambda: - specifier: 8.6.0 - version: 8.6.0 string-ts: specifier: 1.3.3 version: 1.3.3 - ts-api-utils: - specifier: 1.0.3 - version: 1.0.3(typescript@5.3.3) typescript: specifier: '>=5.3.3' version: 5.3.3 @@ -467,6 +452,9 @@ importers: '@eslint-react/core': specifier: workspace:* version: link:../core + '@eslint-react/eslint-utils': + specifier: workspace:* + version: link:../eslint-utils '@eslint-react/jsx': specifier: workspace:* version: link:../jsx @@ -479,36 +467,24 @@ importers: '@eslint-react/types': specifier: workspace:* version: link:../types - '@eslint-react/utils': - specifier: workspace:* - version: link:../utils '@typescript-eslint/parser': - specifier: '>=6.14.0' - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: '>=6.15.0' + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/scope-manager': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/type-utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/types': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) - dedent: - specifier: 1.5.1 - version: 1.5.1 - effect: - specifier: 2.0.0-next.60 - version: 2.0.0-next.60 + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: specifier: '>=8.56.0' version: 8.56.0 - rambda: - specifier: 8.6.0 - version: 8.6.0 string-ts: specifier: 1.3.3 version: 1.3.3 @@ -527,54 +503,45 @@ importers: '@eslint-react/core': specifier: workspace:* version: link:../core + '@eslint-react/eslint-utils': + specifier: workspace:* + version: link:../eslint-utils '@eslint-react/jsx': specifier: workspace:* version: link:../jsx '@eslint-react/shared': specifier: workspace:* version: link:../shared + '@eslint-react/third-party': + specifier: workspace:* + version: link:../third-party '@eslint-react/tools': specifier: workspace:* version: link:../tools '@eslint-react/types': specifier: workspace:* version: link:../types - '@eslint-react/utils': - specifier: workspace:* - version: link:../utils '@typescript-eslint/parser': - specifier: '>=6.14.0' - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: '>=6.15.0' + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/scope-manager': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/type-utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/types': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) - dedent: - specifier: 1.5.1 - version: 1.5.1 - effect: - specifier: 2.0.0-next.60 - version: 2.0.0-next.60 + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: specifier: '>=8.56.0' version: 8.56.0 - rambda: - specifier: 8.6.0 - version: 8.6.0 string-ts: specifier: 1.3.3 version: 1.3.3 - ts-api-utils: - specifier: 1.0.3 - version: 1.0.3(typescript@5.3.3) typescript: specifier: '>=5.3.3' version: 5.3.3 @@ -587,6 +554,9 @@ importers: '@eslint-react/core': specifier: workspace:* version: link:../core + '@eslint-react/eslint-utils': + specifier: workspace:* + version: link:../eslint-utils '@eslint-react/jsx': specifier: workspace:* version: link:../jsx @@ -599,42 +569,27 @@ importers: '@eslint-react/types': specifier: workspace:* version: link:../types - '@eslint-react/utils': - specifier: workspace:* - version: link:../utils '@typescript-eslint/parser': - specifier: '>=6.14.0' - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: '>=6.15.0' + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/scope-manager': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/type-utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/types': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) - dedent: - specifier: 1.5.1 - version: 1.5.1 - effect: - specifier: 2.0.0-next.60 - version: 2.0.0-next.60 + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: specifier: '>=8.56.0' version: 8.56.0 - rambda: - specifier: 8.6.0 - version: 8.6.0 string-ts: specifier: 1.3.3 version: 1.3.3 - ts-api-utils: - specifier: 1.0.3 - version: 1.0.3(typescript@5.3.3) typescript: specifier: '>=5.3.3' version: 5.3.3 @@ -647,6 +602,9 @@ importers: '@eslint-react/core': specifier: workspace:* version: link:../core + '@eslint-react/eslint-utils': + specifier: workspace:* + version: link:../eslint-utils '@eslint-react/jsx': specifier: workspace:* version: link:../jsx @@ -659,46 +617,43 @@ importers: '@eslint-react/types': specifier: workspace:* version: link:../types - '@eslint-react/utils': - specifier: workspace:* - version: link:../utils '@typescript-eslint/parser': - specifier: '>=6.14.0' - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: '>=6.15.0' + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/scope-manager': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/type-utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/types': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) - dedent: - specifier: 1.5.1 - version: 1.5.1 - effect: - specifier: 2.0.0-next.60 - version: 2.0.0-next.60 + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: specifier: '>=8.56.0' version: 8.56.0 - rambda: - specifier: 8.6.0 - version: 8.6.0 string-ts: specifier: 1.3.3 version: 1.3.3 - ts-api-utils: - specifier: 1.0.3 - version: 1.0.3(typescript@5.3.3) typescript: specifier: '>=5.3.3' version: 5.3.3 + packages/eslint-utils: + dependencies: + '@eslint-react/shared': + specifier: workspace:* + version: link:../shared + '@typescript-eslint/utils': + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) + deepmerge-ts: + specifier: 5.1.0 + version: 5.1.0 + packages/jsx: dependencies: '@eslint-react/ast': @@ -707,6 +662,9 @@ importers: '@eslint-react/shared': specifier: workspace:* version: link:../shared + '@eslint-react/third-party': + specifier: workspace:* + version: link:../third-party '@eslint-react/tools': specifier: workspace:* version: link:../tools @@ -714,53 +672,48 @@ importers: specifier: workspace:* version: link:../types '@typescript-eslint/scope-manager': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/types': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) micro-memoize: specifier: 4.1.2 version: 4.1.2 packages/shared: dependencies: - '@eslint-react/tools': - specifier: workspace:* - version: link:../tools - '@eslint-react/types': - specifier: workspace:* - version: link:../types + valibot: + specifier: 0.24.1 + version: 0.24.1 + devDependencies: + type-fest: + specifier: 4.8.3 + version: 4.8.3 + + packages/third-party: + dependencies: + '@eslint-community/eslint-utils': + specifier: 4.4.0 + version: 4.4.0(eslint@8.56.0) + '@typescript-eslint/types': + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) - dedent: - specifier: 1.5.1 - version: 1.5.1 - deepmerge-ts: - specifier: 5.1.0 - version: 5.1.0 - short-unique-id: - specifier: 5.0.3 - version: 5.0.3 + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) tslib: specifier: 2.6.2 version: 2.6.2 - valibot: - specifier: 0.24.1 - version: 0.24.1 packages/tools: dependencies: effect: specifier: 2.0.0-next.60 version: 2.0.0-next.60 - ts-pattern: - specifier: 5.0.6 - version: 5.0.6 packages/types: dependencies: @@ -768,44 +721,11 @@ importers: specifier: workspace:* version: link:../tools '@typescript-eslint/types': - specifier: 6.14.0 - version: 6.14.0 + specifier: 6.15.0 + version: 6.15.0 '@typescript-eslint/utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) - string-ts: - specifier: 1.3.3 - version: 1.3.3 - - packages/utils: - dependencies: - '@eslint-react/shared': - specifier: workspace:* - version: link:../shared - '@eslint-react/tools': - specifier: workspace:* - version: link:../tools - '@eslint-react/types': - specifier: workspace:* - version: link:../types - '@typescript-eslint/utils': - specifier: 6.14.0 - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) - dedent: - specifier: 1.5.1 - version: 1.5.1 - deepmerge-ts: - specifier: 5.1.0 - version: 5.1.0 - short-unique-id: - specifier: 5.0.3 - version: 5.0.3 - string-ts: - specifier: 1.3.3 - version: 1.3.3 - tslib: - specifier: 2.6.2 - version: 2.6.2 + specifier: 6.15.0 + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) website: dependencies: @@ -838,8 +758,8 @@ importers: specifier: 3.0.0 version: 3.0.0 '@types/node': - specifier: 20.10.4 - version: 20.10.4 + specifier: 20.10.5 + version: 20.10.5 '@types/react': specifier: 18.2.45 version: 18.2.45 @@ -847,17 +767,17 @@ importers: specifier: 18.2.17 version: 18.2.17 '@typescript-eslint/eslint-plugin': - specifier: 6.14.0 - version: 6.14.0(@typescript-eslint/parser@6.14.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.15.0 + version: 6.15.0(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: '>=6.14.0' - version: 6.14.0(eslint@8.56.0)(typescript@5.3.3) + specifier: '>=6.15.0' + version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) '@vanilla-extract/css': specifier: 1.14.0 version: 1.14.0 '@vanilla-extract/next-plugin': specifier: 2.3.2 - version: 2.3.2(@types/node@20.10.4)(next@14.0.4)(sass@1.69.5)(webpack@5.89.0) + version: 2.3.2(@types/node@20.10.5)(next@14.0.4)(sass@1.69.5)(webpack@5.89.0) autoprefixer: specifier: 10.4.16 version: 10.4.16(postcss@8.4.32) @@ -874,8 +794,8 @@ importers: specifier: 9.1.0 version: 9.1.0(eslint@8.56.0) eslint-config-with-tsconfig: - specifier: 2.9.170 - version: 2.9.170(@susisu/eslint-plugin-safe-typescript@0.5.2)(eslint@8.56.0)(tailwindcss@3.3.6)(typescript@5.3.3) + specifier: 2.9.200 + version: 2.9.200(@susisu/eslint-plugin-safe-typescript@0.5.2)(eslint@8.56.0)(tailwindcss@3.3.6)(typescript@5.3.3) eslint-define-config: specifier: 2.0.0 version: 2.0.0 @@ -1541,56 +1461,56 @@ packages: engines: {node: '>=18'} dev: true - /@dprint/darwin-arm64@0.43.2: - resolution: {integrity: sha512-EPBM3my8L2Wq+UPjfRepKLsZZe30mipvgT6HdpsT8FXqrvVaHcE5BxQdyu0TH/V7GogmeMXOaiAgH9f5IBkdTg==} + /@dprint/darwin-arm64@0.44.0: + resolution: {integrity: sha512-6MlycQuH1rojgssK6D8CzaEC+rTZCfoHh/QHyZJcjJqIoj1KXGTL+UUTvJ+iGuMMJ1gchsyl0UCVDJ5UE/BBdA==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /@dprint/darwin-x64@0.43.2: - resolution: {integrity: sha512-zXabg6PF8g3d0Zc7KS3gj6/w38jO6GqIwHG0fvJh+E1UiSs36xLjLAsyZh7/6wrDu7LfD/g5WOUz1QAfrnO3zQ==} + /@dprint/darwin-x64@0.44.0: + resolution: {integrity: sha512-TKt/qCCVlf2imq1HDSrdpyWFfzySPlSBmaWAg5qADftQWMp2/egQWzqhw92U2x62aoZ0CRcP5BZE8aVIigPELg==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /@dprint/linux-arm64-glibc@0.43.2: - resolution: {integrity: sha512-XV6pXgyT8iKHf/VOB9JVZlU73mTX6vjJ+fLY0c+r9j7Zgjp6kb4JX6mTfeEwTZYBsZUzOmxKj+kno1mfw6dUHg==} + /@dprint/linux-arm64-glibc@0.44.0: + resolution: {integrity: sha512-CgGuIFlytPzGMg7trFUtAJm0U7i3dBsp2OZbH2jHNBNC6vODHv1GgZFq4tQpMNPBiJRK+9eVlwHifWoEaVIRXg==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@dprint/linux-arm64-musl@0.43.2: - resolution: {integrity: sha512-aaWBIOMncDb0YrRmmNKCs7tf6H26VB0izX2bPIbMiOc50hPuCI28lz1lY+zdwdFKG+1aRkKHkLJtpOjgvmEqCw==} + /@dprint/linux-arm64-musl@0.44.0: + resolution: {integrity: sha512-rvs8jDYRqszjoabbycEd32Iob0R6jLjLpnN35e/jOGrguvJj0/TAumWp85O3viB7DVC7qxahgZft0XlhPEHrUQ==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@dprint/linux-x64-glibc@0.43.2: - resolution: {integrity: sha512-OBJlQCvPCQOgSZvQhTVJbF6mD9Bpz3hhecTZNnU/n83bHX1L3cwu/laws0mQPXOxJvBKpYVgN5ceZelIO0ZKWA==} + /@dprint/linux-x64-glibc@0.44.0: + resolution: {integrity: sha512-/3y4FsYcS+W25/o5yYjO0A9800woZ93b+Htlp7aIHdM53G0canw2306SoyvIZ+tNSaVegbSU9i21i4FLhNMN6g==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@dprint/linux-x64-musl@0.43.2: - resolution: {integrity: sha512-WVnivencONHhRVfgbKPf95P3ES8DYowBCk80tROg41BBRdP/WJoPWc5Ocm6mhEGEeIpcHol+xvwKkqZkkMxJcg==} + /@dprint/linux-x64-musl@0.44.0: + resolution: {integrity: sha512-XWclrKFozgNoeFZ4ULuwgUh+6tN7zn2tH8SmY8VwwaBsCX3FjCwk2Qx11rRqMmD9oJmu8KqWexSW6kY3Fxjh/g==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@dprint/win32-x64@0.43.2: - resolution: {integrity: sha512-ZboeX4lGZ+MtFyWV/Z9wxV3Re2zb/t6u79V38aKgCWDuy1SzGdxZcCPjEEY17lxwGpzgD5T0VBVdiBQLIy08CQ==} + /@dprint/win32-x64@0.44.0: + resolution: {integrity: sha512-od8W35aAwC1Ah3Zqw5q4w8aNHfABIiKssURF03IlFljAS5xZ4yt7JDkUwaFeLB/Xsh6Jka4YmbOWDrtEUoXY9Q==} cpu: [x64] os: [win32] requiresBuild: true @@ -2898,22 +2818,22 @@ packages: p-map: 4.0.0 dev: true - /@susisu/eslint-plugin-safe-typescript@0.5.2(@typescript-eslint/parser@6.14.0)(eslint@8.56.0)(typescript@5.3.3): + /@susisu/eslint-plugin-safe-typescript@0.5.2(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3): resolution: {integrity: sha512-/r3tl3sTox6/KW8nrZxgyLa/1QC+J/PUBW+/cqZ+5XVYLVw2Q2dpSjhuVhKY7KRv1o1q54YZ0tuUBA9jHmciag==} peerDependencies: - '@typescript-eslint/parser': '>=6.14.0' + '@typescript-eslint/parser': '>=6.15.0' typescript: '>=5.3.3' dependencies: - '@typescript-eslint/parser': 6.14.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.15.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) typescript: 5.3.3 transitivePeerDependencies: - eslint - supports-color dev: true - /@swc/core-darwin-arm64@1.3.100: - resolution: {integrity: sha512-XVWFsKe6ei+SsDbwmsuRkYck1SXRpO60Hioa4hoLwR8fxbA9eVp6enZtMxzVVMBi8ej5seZ4HZQeAWepbukiBw==} + /@swc/core-darwin-arm64@1.3.101: + resolution: {integrity: sha512-mNFK+uHNPRXSnfTOG34zJOeMl2waM4hF4a2NY7dkMXrPqw9CoJn4MwTXJcyMiSz1/BnNjjTCHF3Yhj0jPxmkzQ==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] @@ -2921,8 +2841,8 @@ packages: dev: true optional: true - /@swc/core-darwin-x64@1.3.100: - resolution: {integrity: sha512-KF/MXrnH1nakm1wbt4XV8FS7kvqD9TGmVxeJ0U4bbvxXMvzeYUurzg3AJUTXYmXDhH/VXOYJE5N5RkwZZPs5iA==} + /@swc/core-darwin-x64@1.3.101: + resolution: {integrity: sha512-B085j8XOx73Fg15KsHvzYWG262bRweGr3JooO1aW5ec5pYbz5Ew9VS5JKYS03w2UBSxf2maWdbPz2UFAxg0whw==} engines: {node: '>=10'} cpu: [x64] os: [darwin] @@ -2930,8 +2850,17 @@ packages: dev: true optional: true - /@swc/core-linux-arm64-gnu@1.3.100: - resolution: {integrity: sha512-p8hikNnAEJrw5vHCtKiFT4hdlQxk1V7vqPmvUDgL/qe2menQDK/i12tbz7/3BEQ4UqUPnvwpmVn2d19RdEMNxw==} + /@swc/core-linux-arm-gnueabihf@1.3.101: + resolution: {integrity: sha512-9xLKRb6zSzRGPqdz52Hy5GuB1lSjmLqa0lST6MTFads3apmx4Vgs8Y5NuGhx/h2I8QM4jXdLbpqQlifpzTlSSw==} + engines: {node: '>=10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@swc/core-linux-arm64-gnu@1.3.101: + resolution: {integrity: sha512-oE+r1lo7g/vs96Weh2R5l971dt+ZLuhaUX+n3BfDdPxNHfObXgKMjO7E+QS5RbGjv/AwiPCxQmbdCp/xN5ICJA==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -2939,8 +2868,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm64-musl@1.3.100: - resolution: {integrity: sha512-BWx/0EeY89WC4q3AaIaBSGfQxkYxIlS3mX19dwy2FWJs/O+fMvF9oLk/CyJPOZzbp+1DjGeeoGFuDYpiNO91JA==} + /@swc/core-linux-arm64-musl@1.3.101: + resolution: {integrity: sha512-OGjYG3H4BMOTnJWJyBIovCez6KiHF30zMIu4+lGJTCrxRI2fAjGLml3PEXj8tC3FMcud7U2WUn6TdG0/te2k6g==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -2948,8 +2877,8 @@ packages: dev: true optional: true - /@swc/core-linux-x64-gnu@1.3.100: - resolution: {integrity: sha512-XUdGu3dxAkjsahLYnm8WijPfKebo+jHgHphDxaW0ovI6sTdmEGFDew7QzKZRlbYL2jRkUuuKuDGvD6lO5frmhA==} + /@swc/core-linux-x64-gnu@1.3.101: + resolution: {integrity: sha512-/kBMcoF12PRO/lwa8Z7w4YyiKDcXQEiLvM+S3G9EvkoKYGgkkz4Q6PSNhF5rwg/E3+Hq5/9D2R+6nrkF287ihg==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -2957,8 +2886,8 @@ packages: dev: true optional: true - /@swc/core-linux-x64-musl@1.3.100: - resolution: {integrity: sha512-PhoXKf+f0OaNW/GCuXjJ0/KfK9EJX7z2gko+7nVnEA0p3aaPtbP6cq1Ubbl6CMoPL+Ci3gZ7nYumDqXNc3CtLQ==} + /@swc/core-linux-x64-musl@1.3.101: + resolution: {integrity: sha512-kDN8lm4Eew0u1p+h1l3JzoeGgZPQ05qDE0czngnjmfpsH2sOZxVj1hdiCwS5lArpy7ktaLu5JdRnx70MkUzhXw==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -2966,8 +2895,8 @@ packages: dev: true optional: true - /@swc/core-win32-arm64-msvc@1.3.100: - resolution: {integrity: sha512-PwLADZN6F9cXn4Jw52FeP/MCLVHm8vwouZZSOoOScDtihjY495SSjdPnlosMaRSR4wJQssGwiD/4MbpgQPqbAw==} + /@swc/core-win32-arm64-msvc@1.3.101: + resolution: {integrity: sha512-9Wn8TTLWwJKw63K/S+jjrZb9yoJfJwCE2RV5vPCCWmlMf3U1AXj5XuWOLUX+Rp2sGKau7wZKsvywhheWm+qndQ==} engines: {node: '>=10'} cpu: [arm64] os: [win32] @@ -2975,8 +2904,8 @@ packages: dev: true optional: true - /@swc/core-win32-ia32-msvc@1.3.100: - resolution: {integrity: sha512-0f6nicKSLlDKlyPRl2JEmkpBV4aeDfRQg6n8mPqgL7bliZIcDahG0ej+HxgNjZfS3e0yjDxsNRa6sAqWU2Z60A==} + /@swc/core-win32-ia32-msvc@1.3.101: + resolution: {integrity: sha512-onO5KvICRVlu2xmr4//V2je9O2XgS1SGKpbX206KmmjcJhXN5EYLSxW9qgg+kgV5mip+sKTHTAu7IkzkAtElYA==} engines: {node: '>=10'} cpu: [ia32] os: [win32] @@ -2984,8 +2913,8 @@ packages: dev: true optional: true - /@swc/core-win32-x64-msvc@1.3.100: - resolution: {integrity: sha512-b7J0rPoMkRTa3XyUGt8PwCaIBuYWsL2DqbirrQKRESzgCvif5iNpqaM6kjIjI/5y5q1Ycv564CB51YDpiS8EtQ==} + /@swc/core-win32-x64-msvc@1.3.101: + resolution: {integrity: sha512-T3GeJtNQV00YmiVw/88/nxJ/H43CJvFnpvBHCVn17xbahiVUOPOduh3rc9LgAkKiNt/aV8vU3OJR+6PhfMR7UQ==} engines: {node: '>=10'} cpu: [x64] os: [win32] @@ -2993,8 +2922,8 @@ packages: dev: true optional: true - /@swc/core@1.3.100: - resolution: {integrity: sha512-7dKgTyxJjlrMwFZYb1auj3Xq0D8ZBe+5oeIgfMlRU05doXZypYJe0LAk0yjj3WdbwYzpF+T1PLxwTWizI0pckw==} + /@swc/core@1.3.101: + resolution: {integrity: sha512-w5aQ9qYsd/IYmXADAnkXPGDMTqkQalIi+kfFf/MHRKTpaOL7DHjMXwPp/n8hJ0qNjRvchzmPtOqtPBiER50d8A==} engines: {node: '>=10'} requiresBuild: true peerDependencies: @@ -3006,15 +2935,16 @@ packages: '@swc/counter': 0.1.2 '@swc/types': 0.1.5 optionalDependencies: - '@swc/core-darwin-arm64': 1.3.100 - '@swc/core-darwin-x64': 1.3.100 - '@swc/core-linux-arm64-gnu': 1.3.100 - '@swc/core-linux-arm64-musl': 1.3.100 - '@swc/core-linux-x64-gnu': 1.3.100 - '@swc/core-linux-x64-musl': 1.3.100 - '@swc/core-win32-arm64-msvc': 1.3.100 - '@swc/core-win32-ia32-msvc': 1.3.100 - '@swc/core-win32-x64-msvc': 1.3.100 + '@swc/core-darwin-arm64': 1.3.101 + '@swc/core-darwin-x64': 1.3.101 + '@swc/core-linux-arm-gnueabihf': 1.3.101 + '@swc/core-linux-arm64-gnu': 1.3.101 + '@swc/core-linux-arm64-musl': 1.3.101 + '@swc/core-linux-x64-gnu': 1.3.101 + '@swc/core-linux-x64-musl': 1.3.101 + '@swc/core-win32-arm64-msvc': 1.3.101 + '@swc/core-win32-ia32-msvc': 1.3.101 + '@swc/core-win32-x64-msvc': 1.3.101 dev: true /@swc/counter@0.1.2: @@ -3107,7 +3037,7 @@ packages: /@types/concat-stream@2.0.3: resolution: {integrity: sha512-3qe4oQAPNwVNwK4C9c8u+VJqv9kez+2MR4qJpoPFfXtgxxif1QbFusvXzK0/Wra2VX07smostI2VMmJNSpZjuQ==} dependencies: - '@types/node': 20.10.4 + '@types/node': 20.10.5 dev: true /@types/d3-scale-chromatic@3.0.3: @@ -3197,8 +3127,8 @@ packages: /@types/ms@0.7.34: resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} - /@types/node@20.10.4: - resolution: {integrity: sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==} + /@types/node@20.10.5: + resolution: {integrity: sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw==} dependencies: undici-types: 5.26.5 dev: true @@ -3257,11 +3187,11 @@ packages: '@types/yargs-parser': 21.0.3 dev: true - /@typescript-eslint/eslint-plugin@6.14.0(@typescript-eslint/parser@6.14.0)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-1ZJBykBCXaSHG94vMMKmiHoL0MhNHKSVlcHVYZNw+BKxufhqQVTOawNpwwI1P5nIFZ/4jLVop0mcY6mJJDFNaw==} + /@typescript-eslint/eslint-plugin@6.15.0(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-j5qoikQqPccq9QoBAupOP+CBu8BaJ8BLjaXSioDISeTZkVO3ig7oSIKh3H+rEpee7xCXtWwSB4KIL5l6hWZzpg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - '@typescript-eslint/parser': '>=6.14.0' + '@typescript-eslint/parser': '>=6.15.0' eslint: '>=8.56.0' typescript: '*' peerDependenciesMeta: @@ -3269,11 +3199,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.14.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/scope-manager': 6.14.0 - '@typescript-eslint/type-utils': 6.14.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.14.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.14.0 + '@typescript-eslint/parser': 6.15.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.15.0 + '@typescript-eslint/type-utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.15.0 debug: 4.3.4 eslint: 8.56.0 graphemer: 1.4.0 @@ -3292,15 +3222,15 @@ packages: peerDependencies: eslint: '>=8.56.0' dependencies: - '@typescript-eslint/utils': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/parser@6.14.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-QjToC14CKacd4Pa7JK4GeB/vHmWFJckec49FR4hmIRf97+KXole0T97xxu9IFiPxVQ1DBWrQ5wreLwAGwWAVQA==} + /@typescript-eslint/parser@6.15.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-MkgKNnsjC6QwcMdlNAel24jjkEO/0hQaMDLqP4S9zq5HBAUJNQB6y+3DwLjX7b3l2b37eNAxMPLwb3/kh8VKdA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: '>=8.56.0' @@ -3309,26 +3239,26 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.14.0 - '@typescript-eslint/types': 6.14.0 - '@typescript-eslint/typescript-estree': 6.14.0(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.14.0 + '@typescript-eslint/scope-manager': 6.15.0 + '@typescript-eslint/types': 6.15.0 + '@typescript-eslint/typescript-estree': 6.15.0(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.15.0 debug: 4.3.4 eslint: 8.56.0 typescript: 5.3.3 transitivePeerDependencies: - supports-color - /@typescript-eslint/rule-tester@6.14.0(@eslint/eslintrc@2.1.4)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-SCxrm68pudpNTUGCqaGxgqNujca+sEjJXA52gH3b0q1DrVBq1VSlxgO9kSmodhbXKVyS7UGlbz3dPDqa65gR2g==} + /@typescript-eslint/rule-tester@6.15.0(@eslint/eslintrc@2.1.4)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-YZgooIskJMpUvmx/8Ih4zbx+fEPIYyWNomk4FTk3RisRCmY+oTWW4G/WTUmkC/0oMlP30f31nX5+ihcnsPJHMw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@eslint/eslintrc': '>=2' eslint: '>=8.56.0' dependencies: '@eslint/eslintrc': 2.1.4 - '@typescript-eslint/typescript-estree': 6.14.0(typescript@5.3.3) - '@typescript-eslint/utils': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.15.0(typescript@5.3.3) + '@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) ajv: 6.12.6 eslint: 8.56.0 lodash.merge: 4.6.2 @@ -3338,15 +3268,15 @@ packages: - typescript dev: true - /@typescript-eslint/scope-manager@6.14.0: - resolution: {integrity: sha512-VT7CFWHbZipPncAZtuALr9y3EuzY1b1t1AEkIq2bTXUPKw+pHoXflGNG5L+Gv6nKul1cz1VH8fz16IThIU0tdg==} + /@typescript-eslint/scope-manager@6.15.0: + resolution: {integrity: sha512-+BdvxYBltqrmgCNu4Li+fGDIkW9n//NrruzG9X1vBzaNK+ExVXPoGB71kneaVw/Jp+4rH/vaMAGC6JfMbHstVg==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.14.0 - '@typescript-eslint/visitor-keys': 6.14.0 + '@typescript-eslint/types': 6.15.0 + '@typescript-eslint/visitor-keys': 6.15.0 - /@typescript-eslint/type-utils@6.14.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-x6OC9Q7HfYKqjnuNu5a7kffIYs3No30isapRBJl1iCHLitD8O0lFbRcVGiOcuyN837fqXzPZ1NS10maQzZMKqw==} + /@typescript-eslint/type-utils@6.15.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-CnmHKTfX6450Bo49hPg2OkIm/D/TVYV7jO1MCfPYGwf6x3GO0VU8YMO5AYMn+u3X05lRRxA4fWCz87GFQV6yVQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: '>=8.56.0' @@ -3355,8 +3285,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.14.0(typescript@5.3.3) - '@typescript-eslint/utils': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.15.0(typescript@5.3.3) + '@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) debug: 4.3.4 eslint: 8.56.0 ts-api-utils: 1.0.3(typescript@5.3.3) @@ -3364,8 +3294,8 @@ packages: transitivePeerDependencies: - supports-color - /@typescript-eslint/types@6.14.0: - resolution: {integrity: sha512-uty9H2K4Xs8E47z3SnXEPRNDfsis8JO27amp2GNCnzGETEW3yTqEIVg5+AI7U276oGF/tw6ZA+UesxeQ104ceA==} + /@typescript-eslint/types@6.15.0: + resolution: {integrity: sha512-yXjbt//E4T/ee8Ia1b5mGlbNj9fB9lJP4jqLbZualwpP2BCQ5is6BcWwxpIsY4XKAhmdv3hrW92GdtJbatC6dQ==} engines: {node: ^16.0.0 || >=18.0.0} /@typescript-eslint/typescript-estree@6.14.0(typescript@5.3.3): @@ -3377,7 +3307,7 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.14.0 + '@typescript-eslint/types': 6.15.0 '@typescript-eslint/visitor-keys': 6.14.0 debug: 4.3.4 globby: 11.1.0 @@ -3387,9 +3317,30 @@ packages: typescript: 5.3.3 transitivePeerDependencies: - supports-color + dev: true + + /@typescript-eslint/typescript-estree@6.15.0(typescript@5.3.3): + resolution: {integrity: sha512-7mVZJN7Hd15OmGuWrp2T9UvqR2Ecg+1j/Bp1jXUEY2GZKV6FXlOIoqVDmLpBiEiq3katvj/2n2mR0SDwtloCew==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 6.15.0 + '@typescript-eslint/visitor-keys': 6.15.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color - /@typescript-eslint/utils@6.14.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-XwRTnbvRr7Ey9a1NT6jqdKX8y/atWG+8fAIu3z73HSP8h06i3r/ClMhmaF/RGWGW1tHJEwij1uEg2GbEmPYvYg==} + /@typescript-eslint/utils@6.15.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-eF82p0Wrrlt8fQSRL0bGXzK5nWPRV2dYQZdajcfzOD9+cQz9O7ugifrJxclB+xVOvWvagXfqS4Es7vpLP4augw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: '>=8.56.0' @@ -3397,9 +3348,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 6.14.0 - '@typescript-eslint/types': 6.14.0 - '@typescript-eslint/typescript-estree': 6.14.0(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.15.0 + '@typescript-eslint/types': 6.15.0 + '@typescript-eslint/typescript-estree': 6.15.0(typescript@5.3.3) eslint: 8.56.0 semver: 7.5.4 transitivePeerDependencies: @@ -3410,7 +3361,15 @@ packages: resolution: {integrity: sha512-fB5cw6GRhJUz03MrROVuj5Zm/Q+XWlVdIsFj+Zb1Hvqouc8t+XP2H5y53QYU/MGtd2dPg6/vJJlhoX3xc2ehfw==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.14.0 + '@typescript-eslint/types': 6.15.0 + eslint-visitor-keys: 3.4.3 + dev: true + + /@typescript-eslint/visitor-keys@6.15.0: + resolution: {integrity: sha512-1zvtdC1a9h5Tb5jU9x3ADNXO9yjP8rXlaoChu0DQX40vf5ACVpYIVIZhIMZ6d5sDXH7vq4dsZBT1fEGj8D2n2w==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.15.0 eslint-visitor-keys: 3.4.3 /@typescript/twoslash@3.1.0: @@ -3466,7 +3425,7 @@ packages: outdent: 0.8.0 dev: true - /@vanilla-extract/integration@6.2.4(@types/node@20.10.4)(sass@1.69.5): + /@vanilla-extract/integration@6.2.4(@types/node@20.10.5)(sass@1.69.5): resolution: {integrity: sha512-+AfymNMVq9sEUe0OJpdCokmPZg4Zi6CqKaW/PnUOfDwEn53ighHOMOBl5hAgxYR8Kiz9NG43Bn00mkjWlFi+ng==} dependencies: '@babel/core': 7.23.6 @@ -3480,8 +3439,8 @@ packages: lodash: 4.17.21 mlly: 1.4.2 outdent: 0.8.0 - vite: 4.5.1(@types/node@20.10.4)(sass@1.69.5) - vite-node: 0.28.5(@types/node@20.10.4)(sass@1.69.5) + vite: 4.5.1(@types/node@20.10.5)(sass@1.69.5) + vite-node: 0.28.5(@types/node@20.10.5)(sass@1.69.5) transitivePeerDependencies: - '@types/node' - less @@ -3493,12 +3452,12 @@ packages: - terser dev: true - /@vanilla-extract/next-plugin@2.3.2(@types/node@20.10.4)(next@14.0.4)(sass@1.69.5)(webpack@5.89.0): + /@vanilla-extract/next-plugin@2.3.2(@types/node@20.10.5)(next@14.0.4)(sass@1.69.5)(webpack@5.89.0): resolution: {integrity: sha512-wBulJAhmr8guYo5YxrfsA1T/TQ3tbMJjNtE6QrVZvs1NTnT9/WAmf4IVrbUvQbH+LBj5LXO8dRzueGPAvepSng==} peerDependencies: next: 14.0.4 dependencies: - '@vanilla-extract/webpack-plugin': 2.3.1(@types/node@20.10.4)(sass@1.69.5)(webpack@5.89.0) + '@vanilla-extract/webpack-plugin': 2.3.1(@types/node@20.10.5)(sass@1.69.5)(webpack@5.89.0) next: 14.0.4(@babel/core@7.23.6)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5) transitivePeerDependencies: - '@types/node' @@ -3516,16 +3475,16 @@ packages: resolution: {integrity: sha512-17kVyLq3ePTKOkveHxXuIJZtGYs+cSoev7BlP+Lf4916qfDhk/HBjvlYDe8egrea7LNPHKwSZJK/bzZC+Q6AwQ==} dev: true - /@vanilla-extract/webpack-plugin@2.3.1(@types/node@20.10.4)(sass@1.69.5)(webpack@5.89.0): + /@vanilla-extract/webpack-plugin@2.3.1(@types/node@20.10.5)(sass@1.69.5)(webpack@5.89.0): resolution: {integrity: sha512-S767iP+S67Uh+BsTe+u60BMbtRqZAxzjK7gYd6a+1hcbMKznYxdQMeP2qs9wr+NhRqZFrNxewo3/ztMnN85TOg==} peerDependencies: webpack: ^4.30.0 || ^5.20.2 dependencies: - '@vanilla-extract/integration': 6.2.4(@types/node@20.10.4)(sass@1.69.5) + '@vanilla-extract/integration': 6.2.4(@types/node@20.10.5)(sass@1.69.5) chalk: 4.1.2 debug: 4.3.4 loader-utils: 2.0.4 - webpack: 5.89.0(@swc/core@1.3.100) + webpack: 5.89.0(@swc/core@1.3.101) transitivePeerDependencies: - '@types/node' - less @@ -3548,7 +3507,7 @@ packages: '@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.23.6) '@types/babel__core': 7.20.5 react-refresh: 0.14.0 - vite: 5.0.10(@types/node@20.10.4) + vite: 5.0.10(@types/node@20.10.5) transitivePeerDependencies: - supports-color dev: true @@ -3595,7 +3554,7 @@ packages: pathe: 1.1.1 picocolors: 1.0.0 sirv: 2.0.3 - vitest: 1.0.4(@types/node@20.10.4)(@vitest/ui@1.0.4) + vitest: 1.0.4(@types/node@20.10.5)(@vitest/ui@1.0.4) dev: true /@vitest/utils@1.0.4: @@ -5076,6 +5035,7 @@ packages: peerDependenciesMeta: babel-plugin-macros: optional: true + dev: true /deep-eql@4.1.3: resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} @@ -5264,18 +5224,18 @@ packages: is-obj: 2.0.0 dev: true - /dprint@0.43.2: - resolution: {integrity: sha512-9p/dmiFSkTl3hEvCfNbc/jwVwZp4JE5Bgm0z148QEXU7v+FA2dv0xQooAagWEnCPAQgxYcQhecTxrLanOsyNoA==} + /dprint@0.44.0: + resolution: {integrity: sha512-35gviJKVxK6x48EMBZq3/oBLDRoBF9nDXTxYbl+T/lgCUaW3dccccZfuvIJ1rvq1pFlHt8wVyw8ZDZA9ALMfhA==} hasBin: true requiresBuild: true optionalDependencies: - '@dprint/darwin-arm64': 0.43.2 - '@dprint/darwin-x64': 0.43.2 - '@dprint/linux-arm64-glibc': 0.43.2 - '@dprint/linux-arm64-musl': 0.43.2 - '@dprint/linux-x64-glibc': 0.43.2 - '@dprint/linux-x64-musl': 0.43.2 - '@dprint/win32-x64': 0.43.2 + '@dprint/darwin-arm64': 0.44.0 + '@dprint/darwin-x64': 0.44.0 + '@dprint/linux-arm64-glibc': 0.44.0 + '@dprint/linux-arm64-musl': 0.44.0 + '@dprint/linux-x64-glibc': 0.44.0 + '@dprint/linux-x64-musl': 0.44.0 + '@dprint/win32-x64': 0.44.0 dev: true /eastasianwidth@0.2.0: @@ -5425,11 +5385,11 @@ packages: dependencies: '@next/eslint-plugin-next': 14.0.4 '@rushstack/eslint-patch': 1.6.1 - '@typescript-eslint/parser': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.14.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-i@2.29.0)(eslint@8.56.0) - eslint-plugin-import: /eslint-plugin-i@2.29.0(@typescript-eslint/parser@6.14.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.15.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-i@2.29.1)(eslint@8.56.0) + eslint-plugin-import: /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.15.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.56.0) eslint-plugin-react: 7.33.2(eslint@8.56.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.56.0) @@ -5448,16 +5408,16 @@ packages: eslint: 8.56.0 dev: true - /eslint-config-rel1cx@0.12.170(@babel/core@7.23.6)(@babel/eslint-parser@7.23.3)(@babel/preset-react@7.23.3)(@susisu/eslint-plugin-safe-typescript@0.5.2)(@typescript-eslint/eslint-plugin@6.14.0)(@typescript-eslint/parser@6.14.0)(eslint-plugin-perfectionist@1.5.1)(eslint-plugin-promise@6.1.1)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react-refresh@0.4.5)(eslint-plugin-regexp@2.1.2)(eslint-plugin-rxjs@5.0.3)(eslint-plugin-security@1.7.1)(eslint-plugin-simple-import-sort@10.0.0)(eslint-plugin-sonarjs@0.23.0)(eslint-plugin-tailwindcss@3.13.0)(eslint-plugin-unicorn@49.0.0)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-BJJFxayHButuGiVotpBZrhpU8aCyyaxDt1tjwvvyW2cRspB5njzDljP6JKl5VUcEKUOwZgnwD0kEX33jGwBMpg==} + /eslint-config-rel1cx@0.12.200(@babel/core@7.23.6)(@babel/eslint-parser@7.23.3)(@babel/preset-react@7.23.3)(@susisu/eslint-plugin-safe-typescript@0.5.2)(@typescript-eslint/eslint-plugin@6.15.0)(@typescript-eslint/parser@6.15.0)(eslint-plugin-perfectionist@1.5.1)(eslint-plugin-promise@6.1.1)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react-refresh@0.4.5)(eslint-plugin-regexp@2.1.2)(eslint-plugin-rxjs@5.0.3)(eslint-plugin-security@1.7.1)(eslint-plugin-simple-import-sort@10.0.0)(eslint-plugin-sonarjs@0.23.0)(eslint-plugin-tailwindcss@3.13.0)(eslint-plugin-unicorn@49.0.0)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-mjPk87SFz7xjYJVCWwn85rMQ+eTBFykrJXH5f63IjfHoAKw3Rr86KB5ERc7hTY0JdfvXqh4RMtZ+EA/2cTM+Tg==} engines: {bun: '>=1.0.7', node: '>=18.15.0'} peerDependencies: '@babel/core': '>=7.23.6' '@babel/eslint-parser': '>=7.23.3' '@babel/preset-react': '>=7.23.3' '@susisu/eslint-plugin-safe-typescript': '>=0.5.2' - '@typescript-eslint/eslint-plugin': 6.14.0 - '@typescript-eslint/parser': '>=6.14.0' + '@typescript-eslint/eslint-plugin': 6.15.0 + '@typescript-eslint/parser': '>=6.15.0' eslint: '>=8.56.0' eslint-plugin-perfectionist: 1.5.1 eslint-plugin-promise: '>=6.1.1' @@ -5475,9 +5435,9 @@ packages: '@babel/core': 7.23.6 '@babel/eslint-parser': 7.23.3(@babel/core@7.23.6)(eslint@8.56.0) '@babel/preset-react': 7.23.3(@babel/core@7.23.6) - '@susisu/eslint-plugin-safe-typescript': 0.5.2(@typescript-eslint/parser@6.14.0)(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/eslint-plugin': 6.14.0(@typescript-eslint/parser@6.14.0)(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/parser': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@susisu/eslint-plugin-safe-typescript': 0.5.2(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 6.15.0(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 eslint-plugin-perfectionist: 1.5.1(eslint@8.56.0)(typescript@5.3.3) eslint-plugin-promise: 6.1.1(eslint@8.56.0) @@ -5503,8 +5463,8 @@ packages: - tiny-invariant - ts-pattern - /eslint-config-with-tsconfig@2.9.170(@susisu/eslint-plugin-safe-typescript@0.5.2)(eslint@8.56.0)(tailwindcss@3.3.6)(typescript@5.3.3): - resolution: {integrity: sha512-EviZLMIIOLJJCdM9kceXqFFfVzxY2kMBfPLU2hleOmDdY0/9Fauo9+CxsDLr17O/irv7CITEhf+MUDPEfapGKA==} + /eslint-config-with-tsconfig@2.9.200(@susisu/eslint-plugin-safe-typescript@0.5.2)(eslint@8.56.0)(tailwindcss@3.3.6)(typescript@5.3.3): + resolution: {integrity: sha512-0RJTgihZymOaz7RO0weSx9inyuMWxDtgZTVfLKWXlm1AboDXDSk1EJI6hFmtDsbkaIp+j6qyDCRCWQwk0DX8bg==} engines: {bun: '>=1.0.3', node: '>=18.16.0'} peerDependencies: eslint: '>=8.56.0' @@ -5514,10 +5474,10 @@ packages: '@babel/eslint-parser': 7.23.3(@babel/core@7.23.6)(eslint@8.56.0) '@babel/preset-react': 7.23.3(@babel/core@7.23.6) '@tsconfig/strictest': 2.0.2 - '@typescript-eslint/eslint-plugin': 6.14.0(@typescript-eslint/parser@6.14.0)(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/parser': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 6.15.0(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 - eslint-config-rel1cx: 0.12.170(@babel/core@7.23.6)(@babel/eslint-parser@7.23.3)(@babel/preset-react@7.23.3)(@susisu/eslint-plugin-safe-typescript@0.5.2)(@typescript-eslint/eslint-plugin@6.14.0)(@typescript-eslint/parser@6.14.0)(eslint-plugin-perfectionist@1.5.1)(eslint-plugin-promise@6.1.1)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react-refresh@0.4.5)(eslint-plugin-regexp@2.1.2)(eslint-plugin-rxjs@5.0.3)(eslint-plugin-security@1.7.1)(eslint-plugin-simple-import-sort@10.0.0)(eslint-plugin-sonarjs@0.23.0)(eslint-plugin-tailwindcss@3.13.0)(eslint-plugin-unicorn@49.0.0)(eslint@8.56.0)(typescript@5.3.3) + eslint-config-rel1cx: 0.12.200(@babel/core@7.23.6)(@babel/eslint-parser@7.23.3)(@babel/preset-react@7.23.3)(@susisu/eslint-plugin-safe-typescript@0.5.2)(@typescript-eslint/eslint-plugin@6.15.0)(@typescript-eslint/parser@6.15.0)(eslint-plugin-perfectionist@1.5.1)(eslint-plugin-promise@6.1.1)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react-refresh@0.4.5)(eslint-plugin-regexp@2.1.2)(eslint-plugin-rxjs@5.0.3)(eslint-plugin-security@1.7.1)(eslint-plugin-simple-import-sort@10.0.0)(eslint-plugin-sonarjs@0.23.0)(eslint-plugin-tailwindcss@3.13.0)(eslint-plugin-unicorn@49.0.0)(eslint@8.56.0)(typescript@5.3.3) eslint-define-config: 2.0.0 eslint-plugin-expect-type: 0.2.3(eslint@8.56.0)(typescript@5.3.3) eslint-plugin-import-access: 2.1.2(eslint@8.56.0)(typescript@5.3.3) @@ -5570,7 +5530,7 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.14.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-i@2.29.0)(eslint@8.56.0): + /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.15.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-i@2.29.1)(eslint@8.56.0): resolution: {integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -5580,8 +5540,8 @@ packages: debug: 4.3.4 enhanced-resolve: 5.15.0 eslint: 8.56.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.14.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) - eslint-plugin-import: /eslint-plugin-i@2.29.0(@typescript-eslint/parser@6.14.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.15.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-plugin-import: /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.15.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) fast-glob: 3.3.2 get-tsconfig: 4.7.2 is-core-module: 2.13.1 @@ -5618,7 +5578,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.14.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.15.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -5639,11 +5599,11 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.15.0(eslint@8.56.0)(typescript@5.3.3) debug: 3.2.7 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.14.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-i@2.29.0)(eslint@8.56.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.15.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-i@2.29.1)(eslint@8.56.0) transitivePeerDependencies: - supports-color dev: true @@ -5666,7 +5626,7 @@ packages: eslint: '>=8.56.0' typescript: '>=5.3.3' dependencies: - '@typescript-eslint/utils': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 fs-extra: 10.1.0 typescript: 5.3.3 @@ -5694,7 +5654,7 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/utils': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) deepmerge-ts: 5.1.0 escape-string-regexp: 4.0.0 eslint: 8.56.0 @@ -5706,21 +5666,20 @@ packages: - supports-color dev: true - /eslint-plugin-i@2.29.0(@typescript-eslint/parser@6.14.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): - resolution: {integrity: sha512-slGeTS3GQzx9267wLJnNYNO8X9EHGsc75AKIAFvnvMYEcTJKotPKL1Ru5PIGVHIVet+2DsugePWp8Oxpx8G22w==} + /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.15.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): + resolution: {integrity: sha512-ORizX37MelIWLbMyqI7hi8VJMf7A0CskMmYkB+lkCX3aF4pkGV7kwx5bSEb4qx7Yce2rAf9s34HqDRPjGRZPNQ==} engines: {node: '>=12'} peerDependencies: eslint: '>=8.56.0' dependencies: - debug: 3.2.7 - doctrine: 2.1.0 + debug: 4.3.4 + doctrine: 3.0.0 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.14.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.15.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) get-tsconfig: 4.7.2 is-glob: 4.0.3 minimatch: 3.1.2 - resolve: 1.22.8 semver: 7.5.4 transitivePeerDependencies: - '@typescript-eslint/parser' @@ -5732,7 +5691,7 @@ packages: /eslint-plugin-import-access@2.1.2(eslint@8.56.0)(typescript@5.3.3): resolution: {integrity: sha512-pSkOemuqFUdn/AfPx2WpeVQmErRqXOH8utfbzfjk69F+F1Ax7seFXJP9u3T9D/Jk/a2s0Q0RRjgplKFq+4ybfg==} dependencies: - '@typescript-eslint/utils': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) tsutils: 3.21.0(typescript@5.3.3) transitivePeerDependencies: - eslint @@ -5821,8 +5780,8 @@ packages: peerDependencies: eslint: '>=8.56.0' dependencies: - '@typescript-eslint/types': 6.14.0 - '@typescript-eslint/utils': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/types': 6.15.0 + '@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 is-core-module: 2.13.1 json5: 2.2.3 @@ -5961,10 +5920,10 @@ packages: eslint: '>=8.56.0' typescript: '>=5.3.3' dependencies: - '@typescript-eslint/eslint-plugin': 6.14.0(@typescript-eslint/parser@6.14.0)(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/parser': 6.14.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/type-utils': 6.14.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 6.15.0(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.15.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/type-utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 is-immutable-type: 1.2.9(eslint@8.56.0)(typescript@5.3.3) tsutils: 3.21.0(typescript@5.3.3) @@ -5996,8 +5955,8 @@ packages: strip-indent: 3.0.0 dev: true - /eslint-plugin-vitest@0.3.17(@typescript-eslint/eslint-plugin@6.14.0)(eslint@8.56.0)(typescript@5.3.3)(vitest@1.0.4): - resolution: {integrity: sha512-JzljEhaJ3YDNJc4n2VTlOdMhElwLsQQprVtgY+eoKQkearKiFP53Vw3515J3jb4ZM8TVnpk7UsIFXM0gbhz+vQ==} + /eslint-plugin-vitest@0.3.18(@typescript-eslint/eslint-plugin@6.15.0)(eslint@8.56.0)(typescript@5.3.3)(vitest@1.0.4): + resolution: {integrity: sha512-IJzs6BpA//wkNxo5845uPIMOIp4j76MiKiagJ3hD6a2DemrktdpB7mmTjU0EeFuq14NXFoO1wN8Fwrx2VxWBRA==} engines: {node: ^18.0.0 || >= 20.0.0} peerDependencies: '@typescript-eslint/eslint-plugin': '*' @@ -6009,10 +5968,10 @@ packages: vitest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 6.14.0(@typescript-eslint/parser@6.14.0)(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 6.15.0(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 - vitest: 1.0.4(@types/node@20.10.4)(@vitest/ui@1.0.4) + vitest: 1.0.4(@types/node@20.10.5)(@vitest/ui@1.0.4) transitivePeerDependencies: - supports-color - typescript @@ -6223,7 +6182,7 @@ packages: resolution: {integrity: sha512-EzV94NYKoO09GLXGjXj9JIlXijVck4ONSr5wiCWDvhsvj5jxSrzTmRU/9C1DyB6uToszLs8aifA6NQ7lEQdvFw==} engines: {node: '>= 0.8'} dependencies: - '@types/node': 20.10.4 + '@types/node': 20.10.5 require-like: 0.1.2 dev: true @@ -7239,7 +7198,7 @@ packages: eslint: '>=8.56.0' typescript: '>=5.3.3' dependencies: - '@typescript-eslint/type-utils': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/type-utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 typescript: 5.3.3 transitivePeerDependencies: @@ -7252,7 +7211,7 @@ packages: eslint: '>=8.56.0' typescript: '>=5.3.3' dependencies: - '@typescript-eslint/type-utils': 6.14.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/type-utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 ts-api-utils: 1.0.3(typescript@5.3.3) typescript: 5.3.3 @@ -7408,7 +7367,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 20.10.4 + '@types/node': 20.10.5 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -7538,8 +7497,8 @@ packages: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} - /knip@3.8.1(@types/node@20.10.4)(typescript@5.3.3): - resolution: {integrity: sha512-KL/E16ZEp1s5NLbRdDI69G4uxQmHuS5aaASoBWEtdQOAu4iT4F+2ICjAZSeZq7udRlGQr9nuwio0O7BMLv3yTA==} + /knip@3.8.2(@types/node@20.10.5)(typescript@5.3.3): + resolution: {integrity: sha512-OKpEuFrwdGpcnTwo092Z41zjoHW9q0TA4tyNwnx1zGEcxjomgpt+dKTmPxQ31iOVvv5GbUYpeQS9S7dyRDusVw==} engines: {node: '>=18.6.0'} hasBin: true peerDependencies: @@ -7553,7 +7512,7 @@ packages: '@pnpm/logger': 5.0.0 '@pnpm/workspace.pkgs-graph': 2.0.12(@pnpm/logger@5.0.0) '@snyk/github-codeowners': 1.1.0 - '@types/node': 20.10.4 + '@types/node': 20.10.5 chalk: 5.3.0 easy-table: 1.2.0 fast-glob: 3.3.2 @@ -10592,7 +10551,7 @@ packages: '@babel/code-frame': 7.23.5 dev: true - /rollup-plugin-swc3@0.11.0(@swc/core@1.3.100)(rollup@4.9.1): + /rollup-plugin-swc3@0.11.0(@swc/core@1.3.101)(rollup@4.9.1): resolution: {integrity: sha512-luB9Ngb1YieWPpJttKvkmjN3lG5l28SmASLbf2CoScUB2+EImU0bE8wX4EYKEqv5clVulhWRQHQvE+H33X/03g==} engines: {node: '>=12'} peerDependencies: @@ -10601,7 +10560,7 @@ packages: dependencies: '@fastify/deepmerge': 1.3.0 '@rollup/pluginutils': 5.1.0(rollup@4.9.1) - '@swc/core': 1.3.100 + '@swc/core': 1.3.101 get-tsconfig: 4.7.2 rollup: 4.9.1 rollup-preserve-directives: 1.0.1(rollup@4.9.1) @@ -11347,7 +11306,7 @@ packages: - supports-color dev: true - /terser-webpack-plugin@5.3.9(@swc/core@1.3.100)(webpack@5.89.0): + /terser-webpack-plugin@5.3.9(@swc/core@1.3.101)(webpack@5.89.0): resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -11364,12 +11323,12 @@ packages: optional: true dependencies: '@jridgewell/trace-mapping': 0.3.20 - '@swc/core': 1.3.100 + '@swc/core': 1.3.101 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.1 terser: 5.26.0 - webpack: 5.89.0(@swc/core@1.3.100) + webpack: 5.89.0(@swc/core@1.3.101) dev: true /terser@5.26.0: @@ -11762,7 +11721,7 @@ packages: '@types/concat-stream': 2.0.3 '@types/debug': 4.1.12 '@types/is-empty': 1.2.3 - '@types/node': 20.10.4 + '@types/node': 20.10.5 '@types/unist': 3.0.2 '@ungap/structured-clone': 1.2.0 concat-stream: 2.0.0 @@ -12151,7 +12110,7 @@ packages: unist-util-stringify-position: 4.0.0 vfile-message: 4.0.2 - /vite-node@0.28.5(@types/node@20.10.4)(sass@1.69.5): + /vite-node@0.28.5(@types/node@20.10.5)(sass@1.69.5): resolution: {integrity: sha512-LmXb9saMGlrMZbXTvOveJKwMTBTNUH66c8rJnQ0ZPNX+myPEol64+szRzXtV5ORb0Hb/91yq+/D3oERoyAt6LA==} engines: {node: '>=v14.16.0'} hasBin: true @@ -12163,7 +12122,7 @@ packages: picocolors: 1.0.0 source-map: 0.6.1 source-map-support: 0.5.21 - vite: 4.5.1(@types/node@20.10.4)(sass@1.69.5) + vite: 4.5.1(@types/node@20.10.5)(sass@1.69.5) transitivePeerDependencies: - '@types/node' - less @@ -12175,7 +12134,7 @@ packages: - terser dev: true - /vite-node@1.0.4(@types/node@20.10.4): + /vite-node@1.0.4(@types/node@20.10.5): resolution: {integrity: sha512-9xQQtHdsz5Qn8hqbV7UKqkm8YkJhzT/zr41Dmt5N7AlD8hJXw/Z7y0QiD5I8lnTthV9Rvcvi0QW7PI0Fq83ZPg==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -12184,7 +12143,7 @@ packages: debug: 4.3.4 pathe: 1.1.1 picocolors: 1.0.0 - vite: 5.0.10(@types/node@20.10.4) + vite: 5.0.10(@types/node@20.10.5) transitivePeerDependencies: - '@types/node' - less @@ -12196,7 +12155,7 @@ packages: - terser dev: true - /vite@4.5.1(@types/node@20.10.4)(sass@1.69.5): + /vite@4.5.1(@types/node@20.10.5)(sass@1.69.5): resolution: {integrity: sha512-AXXFaAJ8yebyqzoNB9fu2pHoo/nWX+xZlaRwoeYUxEqBO+Zj4msE5G+BhGBll9lYEKv9Hfks52PAF2X7qDYXQA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -12224,7 +12183,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.10.4 + '@types/node': 20.10.5 esbuild: 0.19.8 postcss: 8.4.32 rollup: 3.29.4 @@ -12233,7 +12192,7 @@ packages: fsevents: 2.3.3 dev: true - /vite@5.0.10(@types/node@20.10.4): + /vite@5.0.10(@types/node@20.10.5): resolution: {integrity: sha512-2P8J7WWgmc355HUMlFrwofacvr98DAjoE52BfdbwQtyLH06XKwaL/FMnmKM2crF0iX4MpmMKoDlNCB1ok7zHCw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -12261,7 +12220,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.10.4 + '@types/node': 20.10.5 esbuild: 0.19.8 postcss: 8.4.32 rollup: 4.9.1 @@ -12269,7 +12228,7 @@ packages: fsevents: 2.3.3 dev: true - /vitest@1.0.4(@types/node@20.10.4)(@vitest/ui@1.0.4): + /vitest@1.0.4(@types/node@20.10.5)(@vitest/ui@1.0.4): resolution: {integrity: sha512-s1GQHp/UOeWEo4+aXDOeFBJwFzL6mjycbQwwKWX2QcYfh/7tIerS59hWQ20mxzupTJluA2SdwiBuWwQHH67ckg==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -12294,7 +12253,7 @@ packages: jsdom: optional: true dependencies: - '@types/node': 20.10.4 + '@types/node': 20.10.5 '@vitest/expect': 1.0.4 '@vitest/runner': 1.0.4 '@vitest/snapshot': 1.0.4 @@ -12314,8 +12273,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.5.1 tinypool: 0.8.1 - vite: 5.0.10(@types/node@20.10.4) - vite-node: 1.0.4(@types/node@20.10.4) + vite: 5.0.10(@types/node@20.10.5) + vite-node: 1.0.4(@types/node@20.10.5) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -12378,7 +12337,7 @@ packages: engines: {node: '>=10.13.0'} dev: true - /webpack@5.89.0(@swc/core@1.3.100): + /webpack@5.89.0(@swc/core@1.3.101): resolution: {integrity: sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw==} engines: {node: '>=10.13.0'} hasBin: true @@ -12409,7 +12368,7 @@ packages: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.9(@swc/core@1.3.100)(webpack@5.89.0) + terser-webpack-plugin: 5.3.9(@swc/core@1.3.101)(webpack@5.89.0) watchpack: 2.4.0 webpack-sources: 3.2.3 transitivePeerDependencies: diff --git a/scripts/build.ts b/scripts/build.ts index e673f64b2..cfc8b9f57 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -1,11 +1,12 @@ const packages = [ + "third-party", "tools", "types", "shared", - "utils", "ast", "jsx", "core", + "eslint-utils", "eslint-plugin-debug", "eslint-plugin-naming-convention", "eslint-plugin-jsx", diff --git a/taze.config.ts b/taze.config.ts index 9e2066377..2f0a618e1 100644 --- a/taze.config.ts +++ b/taze.config.ts @@ -4,12 +4,12 @@ export default defineConfig({ force: false, install: false, packageMode: { - "@typescript-eslint/eslint-plugin": "6.14.0", - "@typescript-eslint/parser": "6.14.0", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/type-utils": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/utils": "6.14.0", + "@typescript-eslint/eslint-plugin": "6.15.0", + "@typescript-eslint/parser": "6.15.0", + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/type-utils": "6.15.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/utils": "6.15.0", }, write: true, }); diff --git a/website/components/eslint-config.tsx b/website/components/eslint-config.tsx index ac65eedaf..3dd2a2254 100644 --- a/website/components/eslint-config.tsx +++ b/website/components/eslint-config.tsx @@ -1,10 +1,10 @@ import { Tabs } from "nextra-theme-docs"; import React from "react"; -export type ESLintConfigProps = { +export interface ESLintConfigProps { defaultIndex?: number; children: React.ReactNode; -}; +} export function ESLintConfig({ defaultIndex = 0, diff --git a/website/components/image.tsx b/website/components/image.tsx index 63183714b..559758069 100644 --- a/website/components/image.tsx +++ b/website/components/image.tsx @@ -1,7 +1,7 @@ import type { ImageProps as NextImageProps } from "next/image"; import NextImage from "next/image"; -type ImageProps = NextImageProps; +export interface ImageProps extends NextImageProps {} export function Image({ alt, quality = 100, src, ...rest }: ImageProps) { return ; diff --git a/website/package.json b/website/package.json index e64e4fafd..445b7d80e 100644 --- a/website/package.json +++ b/website/package.json @@ -20,11 +20,11 @@ "devDependencies": { "@eslint-react/eslint-plugin": "workspace:*", "@mdx-js/mdx": "3.0.0", - "@types/node": "20.10.4", + "@types/node": "20.10.5", "@types/react": "18.2.45", "@types/react-dom": "18.2.17", - "@typescript-eslint/eslint-plugin": "6.14.0", - "@typescript-eslint/parser": ">=6.14.0", + "@typescript-eslint/eslint-plugin": "6.15.0", + "@typescript-eslint/parser": ">=6.15.0", "@vanilla-extract/css": "1.14.0", "@vanilla-extract/next-plugin": "2.3.2", "autoprefixer": "10.4.16", @@ -32,7 +32,7 @@ "eslint": ">=8.56.0", "eslint-config-next": "14.0.4", "eslint-config-prettier": "9.1.0", - "eslint-config-with-tsconfig": "2.9.170", + "eslint-config-with-tsconfig": "2.9.200", "eslint-define-config": "2.0.0", "eslint-plugin-mdx": "3.0.0", "eslint-plugin-react-hooks": "4.6.0", diff --git a/website/theme.config.tsx b/website/theme.config.tsx index fd9f8afb5..ab2f4ff34 100644 --- a/website/theme.config.tsx +++ b/website/theme.config.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import { useRouter } from "next/router"; import type { DocsThemeConfig } from "nextra-theme-docs"; -import * as M from "ts-pattern"; +import { match, P } from "ts-pattern"; import logo from "#/assets/logo.svg"; import { Image } from "#/components/image"; @@ -21,13 +21,13 @@ export default { defaultMenuCollapseLevel: 1, }, useNextSeoProps() { - return M.match(useRouter()) + return match(useRouter()) .with({ asPath: "/" }, () => ({ title: "ESLint React", description: "ESLint React - More than 50 ESLint rules to catch common mistakes and improve your React code. Built (mostly) from scratch.", })) - .with({ asPath: M.P.string.startsWith("/rules/") }, () => ({ + .with({ asPath: P.string.startsWith("/rules/") }, () => ({ titleTemplate: "Rule: %s", })) .otherwise(() => ({