From 850af73be0ea30e2c02e4fe82ef64c4f4beddf61 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Tue, 25 Mar 2025 19:39:58 +0000 Subject: [PATCH 01/59] 5.1.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2366f23d5c..da49b4a060 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "immutable", - "version": "5.0.3", + "version": "5.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "immutable", - "version": "5.0.3", + "version": "5.1.0", "license": "MIT", "devDependencies": { "@eslint/js": "^9.20.0", diff --git a/package.json b/package.json index 0558fee4f2..889fcd35db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "immutable", - "version": "5.0.3", + "version": "5.1.0", "description": "Immutable Data Collections", "license": "MIT", "homepage": "https://immutable-js.com", From bed5ccd6676e84e43fc1055005ec4d6dc82e9106 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Tue, 25 Mar 2025 19:40:20 +0000 Subject: [PATCH 02/59] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bf6f7531b..9960612633 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ Dates are formatted as YYYY-MM-DD. ## Unreleased +## 5.1.0 + - Add shuffle to list [#2066](https://github.com/immutable-js/immutable-js/pull/2066) by [@mazerty](https://github.com/mazerty) - TypeScript: Better getIn `RetrievePath` [#2070](https://github.com/immutable-js/immutable-js/pull/2070) by [@jdeniau](https://github.com/jdeniau) - Fix #1915 "Converting a Seq to a list causes RangeError (max call size exceeded)" by @alexvictoor in [#2038](https://github.com/immutable-js/immutable-js/pull/2038) From 9fa2f20766b34cead981b9ea21a79572faf58066 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Tue, 25 Mar 2025 23:57:46 +0000 Subject: [PATCH 03/59] fix type copying --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 889fcd35db..093cd3aeb5 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "build": "run-s build:*", "build:clean": "rimraf dist", "build:dist": "rollup -c ./resources/rollup-config.mjs", - "build:types": "cpy ./type-definitions/immutable.* dist", + "build:types": "cpy \"./type-definitions/immutable.*\" dist", "build:prepare": "./resources/prepare-dist.sh", "build:stats": "node ./resources/dist-stats.mjs", "website:build": "cd website && next build && next-sitemap", From 829b2ee566bb8fe5e487b1593e2011d8058cf9c1 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Tue, 25 Mar 2025 23:57:57 +0000 Subject: [PATCH 04/59] 5.1.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index da49b4a060..fa5c28916d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "immutable", - "version": "5.1.0", + "version": "5.1.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "immutable", - "version": "5.1.0", + "version": "5.1.1", "license": "MIT", "devDependencies": { "@eslint/js": "^9.20.0", diff --git a/package.json b/package.json index 093cd3aeb5..2035340da5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "immutable", - "version": "5.1.0", + "version": "5.1.1", "description": "Immutable Data Collections", "license": "MIT", "homepage": "https://immutable-js.com", From 3787e1a5e26d1caee460a0f4ec8b2a1c19f1eaa3 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Tue, 25 Mar 2025 23:58:30 +0000 Subject: [PATCH 05/59] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9960612633..c54b7d1d9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ Dates are formatted as YYYY-MM-DD. ## Unreleased +## 5.1.1 + +- Fix type copying + ## 5.1.0 - Add shuffle to list [#2066](https://github.com/immutable-js/immutable-js/pull/2066) by [@mazerty](https://github.com/mazerty) From 5e85b38d541d5559dc08e5c96de5119c6632c845 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Wed, 26 Mar 2025 11:13:53 +0000 Subject: [PATCH 06/59] Ensure files are properly builded --- .github/workflows/ci.yml | 19 +++++++++++--- package.json | 1 + resources/check-build-output.cjs | 44 ++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 resources/check-build-output.cjs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7134598f7d..29c1b4a5d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,10 +61,21 @@ jobs: path: ~/.npm key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: ${{ runner.OS }}-node- - - run: npm ci - - run: npm run build - - run: npm run test:unit - - run: npm run test:types -- --target 4.5,5.0,current + - name: 'Install dependencies' + run: npm ci + + - name: 'Build JS files' + run: npm run build + + - name: 'Ensure all files are builded' + run: npm run check-build-output + + - name: 'Run unit tests' + run: npm run test:unit + + - name: 'Test types' + run: npm run test:types -- --target 4.5,5.0,current + - run: npx size-limit - run: npm run check-git-clean diff --git a/package.json b/package.json index 2035340da5..25434bac75 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,7 @@ "build:stats": "node ./resources/dist-stats.mjs", "website:build": "cd website && next build && next-sitemap", "website:dev": "cd website && next dev", + "check-build-output": "node ./resources/check-build-output.cjs", "check-git-clean": "./resources/check-git-clean.sh", "benchmark": "node ./resources/benchmark.js", "publish": "echo 'ONLY PUBLISH VIA CI'; exit 1;" diff --git a/resources/check-build-output.cjs b/resources/check-build-output.cjs new file mode 100644 index 0000000000..3baa9afd2f --- /dev/null +++ b/resources/check-build-output.cjs @@ -0,0 +1,44 @@ +const fs = require('node:fs'); + +const packageJsonContent = JSON.parse(fs.readFileSync('package.json', 'utf8')); + +// remove "dist/" prefix from the file names +const distPrefix = 'dist/'; +const removeDistPrefix = (file) => file.replace(distPrefix, ''); + +const expectedFiles = [ + removeDistPrefix(packageJsonContent.main), + removeDistPrefix(packageJsonContent.module), + removeDistPrefix(packageJsonContent.types), + + // extra files that are not in package.json + 'immutable.min.js', + 'immutable.js.flow', +]; + +console.log('expected files: ', expectedFiles); + +const filesInDistDir = fs + .readdirSync(distPrefix) + .filter((file) => !file.startsWith('.')); + +// There should be no extra files in the dist directory and all expected files should be present +const extraFiles = filesInDistDir.filter( + (file) => !expectedFiles.includes(file) +); +if (extraFiles.length > 0) { + console.error('Extra files found in dist directory:', extraFiles); +} + +const missingFiles = expectedFiles.filter( + (file) => !filesInDistDir.includes(file) +); +if (missingFiles.length > 0) { + console.error('Missing files in dist directory:', missingFiles); +} + +if (extraFiles.length > 0 || missingFiles.length > 0) { + process.exit(1); +} + +console.log('All expected files are present in the dist directory.'); From 47830ffcdbe1ca945e5cbd45eb280ea16f5034a9 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Wed, 26 Mar 2025 12:53:09 +0000 Subject: [PATCH 07/59] move check-build-output to mjs file --- package.json | 2 +- .../{check-build-output.cjs => check-build-output.mjs} | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) rename resources/{check-build-output.cjs => check-build-output.mjs} (89%) diff --git a/package.json b/package.json index 25434bac75..00443dd792 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "build:stats": "node ./resources/dist-stats.mjs", "website:build": "cd website && next build && next-sitemap", "website:dev": "cd website && next dev", - "check-build-output": "node ./resources/check-build-output.cjs", + "check-build-output": "node ./resources/check-build-output.mjs", "check-git-clean": "./resources/check-git-clean.sh", "benchmark": "node ./resources/benchmark.js", "publish": "echo 'ONLY PUBLISH VIA CI'; exit 1;" diff --git a/resources/check-build-output.cjs b/resources/check-build-output.mjs similarity index 89% rename from resources/check-build-output.cjs rename to resources/check-build-output.mjs index 3baa9afd2f..1cfffc5b84 100644 --- a/resources/check-build-output.cjs +++ b/resources/check-build-output.mjs @@ -1,10 +1,11 @@ -const fs = require('node:fs'); +import fs from 'node:fs'; +import path from 'node:path'; const packageJsonContent = JSON.parse(fs.readFileSync('package.json', 'utf8')); // remove "dist/" prefix from the file names -const distPrefix = 'dist/'; -const removeDistPrefix = (file) => file.replace(distPrefix, ''); +const distPrefix = 'dist'; +const removeDistPrefix = (file) => path.basename(file); const expectedFiles = [ removeDistPrefix(packageJsonContent.main), From c2ce45cb0a83d0b27755777dc7d08becca2ea292 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 23:45:11 +0000 Subject: [PATCH 08/59] Bump next from 14.2.24 to 14.2.26 Bumps [next](https://github.com/vercel/next.js) from 14.2.24 to 14.2.26. - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](https://github.com/vercel/next.js/compare/v14.2.24...v14.2.26) --- updated-dependencies: - dependency-name: next dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- package-lock.json | 176 +++++++++++++++++++++++----------------------- 1 file changed, 88 insertions(+), 88 deletions(-) diff --git a/package-lock.json b/package-lock.json index fa5c28916d..5c434deaba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1764,16 +1764,16 @@ } }, "node_modules/@next/env": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.24.tgz", - "integrity": "sha512-LAm0Is2KHTNT6IT16lxT+suD0u+VVfYNQqM+EJTKuFRRuY2z+zj01kueWXPCxbMBDt0B5vONYzabHGUNbZYAhA==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.26.tgz", + "integrity": "sha512-vO//GJ/YBco+H7xdQhzJxF7ub3SUwft76jwaeOyVVQFHCi5DCnkP16WHB+JBylo4vOKPoZBlR94Z8xBxNBdNJA==", "dev": true, "license": "MIT" }, "node_modules/@next/swc-darwin-arm64": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.24.tgz", - "integrity": "sha512-7Tdi13aojnAZGpapVU6meVSpNzgrFwZ8joDcNS8cJVNuP3zqqrLqeory9Xec5TJZR/stsGJdfwo8KeyloT3+rQ==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.26.tgz", + "integrity": "sha512-zDJY8gsKEseGAxG+C2hTMT0w9Nk9N1Sk1qV7vXYz9MEiyRoF5ogQX2+vplyUMIfygnjn9/A04I6yrUTRTuRiyQ==", "cpu": [ "arm64" ], @@ -1788,9 +1788,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.24.tgz", - "integrity": "sha512-lXR2WQqUtu69l5JMdTwSvQUkdqAhEWOqJEYUQ21QczQsAlNOW2kWZCucA6b3EXmPbcvmHB1kSZDua/713d52xg==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.26.tgz", + "integrity": "sha512-U0adH5ryLfmTDkahLwG9sUQG2L0a9rYux8crQeC92rPhi3jGQEY47nByQHrVrt3prZigadwj/2HZ1LUUimuSbg==", "cpu": [ "x64" ], @@ -1805,9 +1805,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.24.tgz", - "integrity": "sha512-nxvJgWOpSNmzidYvvGDfXwxkijb6hL9+cjZx1PVG6urr2h2jUqBALkKjT7kpfurRWicK6hFOvarmaWsINT1hnA==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.26.tgz", + "integrity": "sha512-SINMl1I7UhfHGM7SoRiw0AbwnLEMUnJ/3XXVmhyptzriHbWvPPbbm0OEVG24uUKhuS1t0nvN/DBvm5kz6ZIqpg==", "cpu": [ "arm64" ], @@ -1822,9 +1822,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.24.tgz", - "integrity": "sha512-PaBgOPhqa4Abxa3y/P92F3kklNPsiFjcjldQGT7kFmiY5nuFn8ClBEoX8GIpqU1ODP2y8P6hio6vTomx2Vy0UQ==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.26.tgz", + "integrity": "sha512-s6JaezoyJK2DxrwHWxLWtJKlqKqTdi/zaYigDXUJ/gmx/72CrzdVZfMvUc6VqnZ7YEvRijvYo+0o4Z9DencduA==", "cpu": [ "arm64" ], @@ -1839,9 +1839,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.24.tgz", - "integrity": "sha512-vEbyadiRI7GOr94hd2AB15LFVgcJZQWu7Cdi9cWjCMeCiUsHWA0U5BkGPuoYRnTxTn0HacuMb9NeAmStfBCLoQ==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.26.tgz", + "integrity": "sha512-FEXeUQi8/pLr/XI0hKbe0tgbLmHFRhgXOUiPScz2hk0hSmbGiU8aUqVslj/6C6KA38RzXnWoJXo4FMo6aBxjzg==", "cpu": [ "x64" ], @@ -1856,9 +1856,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.24.tgz", - "integrity": "sha512-df0FC9ptaYsd8nQCINCzFtDWtko8PNRTAU0/+d7hy47E0oC17tI54U/0NdGk7l/76jz1J377dvRjmt6IUdkpzQ==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.26.tgz", + "integrity": "sha512-BUsomaO4d2DuXhXhgQCVt2jjX4B4/Thts8nDoIruEJkhE5ifeQFtvW5c9JkdOtYvE5p2G0hcwQ0UbRaQmQwaVg==", "cpu": [ "x64" ], @@ -1873,9 +1873,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.24.tgz", - "integrity": "sha512-ZEntbLjeYAJ286eAqbxpZHhDFYpYjArotQ+/TW9j7UROh0DUmX7wYDGtsTPpfCV8V+UoqHBPU7q9D4nDNH014Q==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.26.tgz", + "integrity": "sha512-5auwsMVzT7wbB2CZXQxDctpWbdEnEW/e66DyXO1DcgHxIyhP06awu+rHKshZE+lPLIGiwtjo7bsyeuubewwxMw==", "cpu": [ "arm64" ], @@ -1890,9 +1890,9 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.24.tgz", - "integrity": "sha512-9KuS+XUXM3T6v7leeWU0erpJ6NsFIwiTFD5nzNg8J5uo/DMIPvCp3L1Ao5HjbHX0gkWPB1VrKoo/Il4F0cGK2Q==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.26.tgz", + "integrity": "sha512-GQWg/Vbz9zUGi9X80lOeGsz1rMH/MtFO/XqigDznhhhTfDlDoynCM6982mPCbSlxJ/aveZcKtTlwfAjwhyxDpg==", "cpu": [ "ia32" ], @@ -1907,9 +1907,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.24.tgz", - "integrity": "sha512-cXcJ2+x0fXQ2CntaE00d7uUH+u1Bfp/E0HsNQH79YiLaZE5Rbm7dZzyAYccn3uICM7mw+DxoMqEfGXZtF4Fgaw==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.26.tgz", + "integrity": "sha512-2rdB3T1/Gp7bv1eQTTm9d1Y1sv9UuJ2LAwOE0Pe2prHKe32UNscj7YS13fRB37d0GAiGNR+Y7ZcW8YjDI8Ns0w==", "cpu": [ "x64" ], @@ -8113,13 +8113,13 @@ "license": "MIT" }, "node_modules/next": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/next/-/next-14.2.24.tgz", - "integrity": "sha512-En8VEexSJ0Py2FfVnRRh8gtERwDRaJGNvsvad47ShkC2Yi8AXQPXEA2vKoDJlGFSj5WE5SyF21zNi4M5gyi+SQ==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/next/-/next-14.2.26.tgz", + "integrity": "sha512-b81XSLihMwCfwiUVRRja3LphLo4uBBMZEzBBWMaISbKTwOmq3wPknIETy/8000tr7Gq4WmbuFYPS7jOYIf+ZJw==", "dev": true, "license": "MIT", "dependencies": { - "@next/env": "14.2.24", + "@next/env": "14.2.26", "@swc/helpers": "0.5.5", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", @@ -8134,15 +8134,15 @@ "node": ">=18.17.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "14.2.24", - "@next/swc-darwin-x64": "14.2.24", - "@next/swc-linux-arm64-gnu": "14.2.24", - "@next/swc-linux-arm64-musl": "14.2.24", - "@next/swc-linux-x64-gnu": "14.2.24", - "@next/swc-linux-x64-musl": "14.2.24", - "@next/swc-win32-arm64-msvc": "14.2.24", - "@next/swc-win32-ia32-msvc": "14.2.24", - "@next/swc-win32-x64-msvc": "14.2.24" + "@next/swc-darwin-arm64": "14.2.26", + "@next/swc-darwin-x64": "14.2.26", + "@next/swc-linux-arm64-gnu": "14.2.26", + "@next/swc-linux-arm64-musl": "14.2.26", + "@next/swc-linux-x64-gnu": "14.2.26", + "@next/swc-linux-x64-musl": "14.2.26", + "@next/swc-win32-arm64-msvc": "14.2.26", + "@next/swc-win32-ia32-msvc": "14.2.26", + "@next/swc-win32-x64-msvc": "14.2.26" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", @@ -12084,71 +12084,71 @@ } }, "@next/env": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.24.tgz", - "integrity": "sha512-LAm0Is2KHTNT6IT16lxT+suD0u+VVfYNQqM+EJTKuFRRuY2z+zj01kueWXPCxbMBDt0B5vONYzabHGUNbZYAhA==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.26.tgz", + "integrity": "sha512-vO//GJ/YBco+H7xdQhzJxF7ub3SUwft76jwaeOyVVQFHCi5DCnkP16WHB+JBylo4vOKPoZBlR94Z8xBxNBdNJA==", "dev": true }, "@next/swc-darwin-arm64": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.24.tgz", - "integrity": "sha512-7Tdi13aojnAZGpapVU6meVSpNzgrFwZ8joDcNS8cJVNuP3zqqrLqeory9Xec5TJZR/stsGJdfwo8KeyloT3+rQ==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.26.tgz", + "integrity": "sha512-zDJY8gsKEseGAxG+C2hTMT0w9Nk9N1Sk1qV7vXYz9MEiyRoF5ogQX2+vplyUMIfygnjn9/A04I6yrUTRTuRiyQ==", "dev": true, "optional": true }, "@next/swc-darwin-x64": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.24.tgz", - "integrity": "sha512-lXR2WQqUtu69l5JMdTwSvQUkdqAhEWOqJEYUQ21QczQsAlNOW2kWZCucA6b3EXmPbcvmHB1kSZDua/713d52xg==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.26.tgz", + "integrity": "sha512-U0adH5ryLfmTDkahLwG9sUQG2L0a9rYux8crQeC92rPhi3jGQEY47nByQHrVrt3prZigadwj/2HZ1LUUimuSbg==", "dev": true, "optional": true }, "@next/swc-linux-arm64-gnu": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.24.tgz", - "integrity": "sha512-nxvJgWOpSNmzidYvvGDfXwxkijb6hL9+cjZx1PVG6urr2h2jUqBALkKjT7kpfurRWicK6hFOvarmaWsINT1hnA==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.26.tgz", + "integrity": "sha512-SINMl1I7UhfHGM7SoRiw0AbwnLEMUnJ/3XXVmhyptzriHbWvPPbbm0OEVG24uUKhuS1t0nvN/DBvm5kz6ZIqpg==", "dev": true, "optional": true }, "@next/swc-linux-arm64-musl": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.24.tgz", - "integrity": "sha512-PaBgOPhqa4Abxa3y/P92F3kklNPsiFjcjldQGT7kFmiY5nuFn8ClBEoX8GIpqU1ODP2y8P6hio6vTomx2Vy0UQ==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.26.tgz", + "integrity": "sha512-s6JaezoyJK2DxrwHWxLWtJKlqKqTdi/zaYigDXUJ/gmx/72CrzdVZfMvUc6VqnZ7YEvRijvYo+0o4Z9DencduA==", "dev": true, "optional": true }, "@next/swc-linux-x64-gnu": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.24.tgz", - "integrity": "sha512-vEbyadiRI7GOr94hd2AB15LFVgcJZQWu7Cdi9cWjCMeCiUsHWA0U5BkGPuoYRnTxTn0HacuMb9NeAmStfBCLoQ==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.26.tgz", + "integrity": "sha512-FEXeUQi8/pLr/XI0hKbe0tgbLmHFRhgXOUiPScz2hk0hSmbGiU8aUqVslj/6C6KA38RzXnWoJXo4FMo6aBxjzg==", "dev": true, "optional": true }, "@next/swc-linux-x64-musl": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.24.tgz", - "integrity": "sha512-df0FC9ptaYsd8nQCINCzFtDWtko8PNRTAU0/+d7hy47E0oC17tI54U/0NdGk7l/76jz1J377dvRjmt6IUdkpzQ==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.26.tgz", + "integrity": "sha512-BUsomaO4d2DuXhXhgQCVt2jjX4B4/Thts8nDoIruEJkhE5ifeQFtvW5c9JkdOtYvE5p2G0hcwQ0UbRaQmQwaVg==", "dev": true, "optional": true }, "@next/swc-win32-arm64-msvc": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.24.tgz", - "integrity": "sha512-ZEntbLjeYAJ286eAqbxpZHhDFYpYjArotQ+/TW9j7UROh0DUmX7wYDGtsTPpfCV8V+UoqHBPU7q9D4nDNH014Q==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.26.tgz", + "integrity": "sha512-5auwsMVzT7wbB2CZXQxDctpWbdEnEW/e66DyXO1DcgHxIyhP06awu+rHKshZE+lPLIGiwtjo7bsyeuubewwxMw==", "dev": true, "optional": true }, "@next/swc-win32-ia32-msvc": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.24.tgz", - "integrity": "sha512-9KuS+XUXM3T6v7leeWU0erpJ6NsFIwiTFD5nzNg8J5uo/DMIPvCp3L1Ao5HjbHX0gkWPB1VrKoo/Il4F0cGK2Q==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.26.tgz", + "integrity": "sha512-GQWg/Vbz9zUGi9X80lOeGsz1rMH/MtFO/XqigDznhhhTfDlDoynCM6982mPCbSlxJ/aveZcKtTlwfAjwhyxDpg==", "dev": true, "optional": true }, "@next/swc-win32-x64-msvc": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.24.tgz", - "integrity": "sha512-cXcJ2+x0fXQ2CntaE00d7uUH+u1Bfp/E0HsNQH79YiLaZE5Rbm7dZzyAYccn3uICM7mw+DxoMqEfGXZtF4Fgaw==", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.26.tgz", + "integrity": "sha512-2rdB3T1/Gp7bv1eQTTm9d1Y1sv9UuJ2LAwOE0Pe2prHKe32UNscj7YS13fRB37d0GAiGNR+Y7ZcW8YjDI8Ns0w==", "dev": true, "optional": true }, @@ -16399,21 +16399,21 @@ "dev": true }, "next": { - "version": "14.2.24", - "resolved": "https://registry.npmjs.org/next/-/next-14.2.24.tgz", - "integrity": "sha512-En8VEexSJ0Py2FfVnRRh8gtERwDRaJGNvsvad47ShkC2Yi8AXQPXEA2vKoDJlGFSj5WE5SyF21zNi4M5gyi+SQ==", - "dev": true, - "requires": { - "@next/env": "14.2.24", - "@next/swc-darwin-arm64": "14.2.24", - "@next/swc-darwin-x64": "14.2.24", - "@next/swc-linux-arm64-gnu": "14.2.24", - "@next/swc-linux-arm64-musl": "14.2.24", - "@next/swc-linux-x64-gnu": "14.2.24", - "@next/swc-linux-x64-musl": "14.2.24", - "@next/swc-win32-arm64-msvc": "14.2.24", - "@next/swc-win32-ia32-msvc": "14.2.24", - "@next/swc-win32-x64-msvc": "14.2.24", + "version": "14.2.26", + "resolved": "https://registry.npmjs.org/next/-/next-14.2.26.tgz", + "integrity": "sha512-b81XSLihMwCfwiUVRRja3LphLo4uBBMZEzBBWMaISbKTwOmq3wPknIETy/8000tr7Gq4WmbuFYPS7jOYIf+ZJw==", + "dev": true, + "requires": { + "@next/env": "14.2.26", + "@next/swc-darwin-arm64": "14.2.26", + "@next/swc-darwin-x64": "14.2.26", + "@next/swc-linux-arm64-gnu": "14.2.26", + "@next/swc-linux-arm64-musl": "14.2.26", + "@next/swc-linux-x64-gnu": "14.2.26", + "@next/swc-linux-x64-musl": "14.2.26", + "@next/swc-win32-arm64-msvc": "14.2.26", + "@next/swc-win32-ia32-msvc": "14.2.26", + "@next/swc-win32-x64-msvc": "14.2.26", "@swc/helpers": "0.5.5", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", From 286f07f317b322342674c2e3663e25123efe6d38 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Wed, 26 Mar 2025 23:41:44 +0000 Subject: [PATCH 09/59] Migrate from jasmine-check to fast-check --- __tests__/Conversion.ts | 15 ++- __tests__/Equality.ts | 53 ++++----- __tests__/IndexedSeq.ts | 3 - __tests__/KeyedSeq.ts | 32 +++--- __tests__/List.ts | 182 ++++++++++++++++--------------- __tests__/Map.ts | 167 +++++++++++++++------------- __tests__/Range.ts | 68 +++++++----- __tests__/Stack.ts | 95 ++++++++-------- __tests__/find.ts | 3 - __tests__/flatten.ts | 3 - __tests__/hash.ts | 22 ++-- __tests__/join.ts | 25 +++-- __tests__/minmax.ts | 32 ++++-- __tests__/slice.ts | 92 ++++++++-------- __tests__/splice.ts | 30 ++--- __tests__/transformerProtocol.ts | 3 - __tests__/tsconfig.json | 3 +- __tests__/zip.ts | 48 ++++---- jest.config.js | 1 - package-lock.json | 143 ++++++++++-------------- package.json | 3 +- resources/jasmine-check.d.ts | 6 - 22 files changed, 516 insertions(+), 513 deletions(-) delete mode 100644 resources/jasmine-check.d.ts diff --git a/__tests__/Conversion.ts b/__tests__/Conversion.ts index 1da714e134..25900bcd5e 100644 --- a/__tests__/Conversion.ts +++ b/__tests__/Conversion.ts @@ -1,7 +1,5 @@ import { fromJS, is, List, Map, OrderedMap, Record } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; - -jasmineCheck.install(); +import fc from 'fast-check'; describe('Conversion', () => { // Note: order of keys based on Map's hashing order @@ -192,9 +190,14 @@ describe('Conversion', () => { expect(fromJS('string')).toEqual('string'); }); - check.it('toJS isomorphic value', { maxSize: 30 }, [gen.JSONValue], (v) => { - const imm = fromJS(v); - expect(imm && imm.toJS ? imm.toJS() : imm).toEqual(v); + it('toJS isomorphic value', () => { + fc.assert( + fc.property(fc.jsonValue(), (v) => { + const imm = fromJS(v); + expect(imm && imm.toJS ? imm.toJS() : imm).toEqual(v); + }), + { numRuns: 30 } + ); }); it('Explicitly convert values to string using String constructor', () => { diff --git a/__tests__/Equality.ts b/__tests__/Equality.ts index 6e074ee477..d8915c4e54 100644 --- a/__tests__/Equality.ts +++ b/__tests__/Equality.ts @@ -1,7 +1,5 @@ import { is, List, Map, Seq, Set } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; - -jasmineCheck.install(); +import fc from 'fast-check'; describe('Equality', () => { function expectIs(left, right) { @@ -119,32 +117,37 @@ describe('Equality', () => { expectIs(list, listShorter); }); - const genSimpleVal = gen.oneOf(['A', 1]); + const genSimpleVal = fc.oneof(fc.constant('A'), fc.constant(1)); - const genVal = gen.oneOf([ - gen.array(genSimpleVal, { minSize: 0, maxSize: 4 }).then(List), - gen.array(genSimpleVal, { minSize: 0, maxSize: 4 }).then(Set), - gen - .array(gen.array(genSimpleVal, { size: 2 }), { - minSize: 0, - maxSize: 4, + const genVal = fc.oneof( + fc.array(genSimpleVal, { minLength: 0, maxLength: 4 }).map(List), + fc.array(genSimpleVal, { minLength: 0, maxLength: 4 }).map(Set), + fc + .array(fc.array(genSimpleVal, { minLength: 2, maxLength: 2 }), { + minLength: 0, + maxLength: 4, }) - .then(Map), - ]); - - check.it( - 'has symmetric equality', - { times: 1000 }, - [genVal, genVal], - (a, b) => { - expect(is(a, b)).toBe(is(b, a)); - } + .map(Map) ); - check.it('has hash equality', { times: 1000 }, [genVal, genVal], (a, b) => { - if (is(a, b)) { - expect(a.hashCode()).toBe(b.hashCode()); - } + it('has symmetric equality', () => { + fc.assert( + fc.property(genVal, genVal, (a, b) => { + expect(is(a, b)).toBe(is(b, a)); + }), + { numRuns: 1000 } + ); + }); + + it('has hash symmetry', () => { + fc.assert( + fc.property(genVal, genVal, (a, b) => { + if (is(a, b)) { + expect(a.hashCode()).toBe(b.hashCode()); + } + }), + { numRuns: 1000 } + ); }); describe('hash', () => { diff --git a/__tests__/IndexedSeq.ts b/__tests__/IndexedSeq.ts index 3b29ba7afc..e113f43999 100644 --- a/__tests__/IndexedSeq.ts +++ b/__tests__/IndexedSeq.ts @@ -1,7 +1,4 @@ import { Seq } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; - -jasmineCheck.install(); describe('IndexedSequence', () => { it('maintains skipped offset', () => { diff --git a/__tests__/KeyedSeq.ts b/__tests__/KeyedSeq.ts index 0a14ebb3d9..cd4d522709 100644 --- a/__tests__/KeyedSeq.ts +++ b/__tests__/KeyedSeq.ts @@ -1,23 +1,25 @@ import { Range, Seq } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; - -jasmineCheck.install(); +import fc from 'fast-check'; describe('KeyedSeq', () => { - check.it('it iterates equivalently', [gen.array(gen.int)], (ints) => { - const seq = Seq(ints); - const keyed = seq.toKeyedSeq(); + it('it iterates equivalently', () => { + fc.assert( + fc.property(fc.array(fc.integer()), (ints) => { + const seq = Seq(ints); + const keyed = seq.toKeyedSeq(); - const seqEntries = seq.entries(); - const keyedEntries = keyed.entries(); + const seqEntries = seq.entries(); + const keyedEntries = keyed.entries(); - let seqStep; - let keyedStep; - do { - seqStep = seqEntries.next(); - keyedStep = keyedEntries.next(); - expect(keyedStep).toEqual(seqStep); - } while (!seqStep.done); + let seqStep; + let keyedStep; + do { + seqStep = seqEntries.next(); + keyedStep = keyedEntries.next(); + expect(keyedStep).toEqual(seqStep); + } while (!seqStep.done); + }) + ); }); it('maintains keys', () => { diff --git a/__tests__/List.ts b/__tests__/List.ts index 5691b1ec19..ee3cec92a9 100644 --- a/__tests__/List.ts +++ b/__tests__/List.ts @@ -1,9 +1,7 @@ import { fromJS, List, Map, Range, Seq, Set } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; +import fc from 'fast-check'; import { create as createSeed } from 'random-seed'; -jasmineCheck.install(); - function arrayOfSize(s: number) { const a = new Array(s); for (let ii = 0; ii < s; ii++) { @@ -402,24 +400,23 @@ describe('List', () => { expect(v1.toArray()).toEqual(['a', 'b', 'c', 'd', 'e', 'f']); }); - check.it( - 'pushes multiple values to the end', - { maxSize: 2000 }, - [gen.posInt, gen.posInt], - (s1, s2) => { - const a1 = arrayOfSize(s1); - const a2 = arrayOfSize(s2); + it('pushes multiple values to the end', () => { + fc.assert( + fc.property(fc.nat(100), fc.nat(100), (s1, s2) => { + const a1 = arrayOfSize(s1); + const a2 = arrayOfSize(s2); - const v1 = List(a1); - const v3 = v1.push.apply(v1, a2); + const v1 = List(a1); + const v3 = v1.push.apply(v1, a2); - const a3 = a1.slice(); - a3.push.apply(a3, a2); + const a3 = a1.slice(); + a3.push.apply(a3, a2); - expect(v3.size).toEqual(a3.length); - expect(v3.toArray()).toEqual(a3); - } - ); + expect(v3.size).toEqual(a3.length); + expect(v3.toArray()).toEqual(a3); + }) + ); + }); it('pop removes the highest index, decrementing size', () => { let v = List.of('a', 'b', 'c').pop(); @@ -436,43 +433,41 @@ describe('List', () => { expect(v.last()).toBe('X'); }); - check.it( - 'pop removes the highest index, just like array', - { maxSize: 2000 }, - [gen.posInt], - (len) => { - const a = arrayOfSize(len); - let v = List(a); + it('pop removes the highest index, just like array', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const a = arrayOfSize(len); + let v = List(a); - while (a.length) { + while (a.length) { + expect(v.size).toBe(a.length); + expect(v.toArray()).toEqual(a); + v = v.pop(); + a.pop(); + } expect(v.size).toBe(a.length); expect(v.toArray()).toEqual(a); - v = v.pop(); - a.pop(); - } - expect(v.size).toBe(a.length); - expect(v.toArray()).toEqual(a); - } - ); + }) + ); + }); - check.it( - 'push adds the next highest index, just like array', - { maxSize: 2000 }, - [gen.posInt], - (len) => { - const a: Array = []; - let v = List(); + it('push adds the next highest index, just like array', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const a: Array = []; + let v = List(); - for (let ii = 0; ii < len; ii++) { + for (let ii = 0; ii < len; ii++) { + expect(v.size).toBe(a.length); + expect(v.toArray()).toEqual(a); + v = v.push(ii); + a.push(ii); + } expect(v.size).toBe(a.length); expect(v.toArray()).toEqual(a); - v = v.push(ii); - a.push(ii); - } - expect(v.size).toBe(a.length); - expect(v.toArray()).toEqual(a); - } - ); + }) + ); + }); it('allows popping an empty list', () => { let v = List.of('a').pop(); @@ -509,24 +504,23 @@ describe('List', () => { expect(v.toArray()).toEqual(['x', 'y', 'z', 'a', 'b', 'c']); }); - check.it( - 'unshifts multiple values to the front', - { maxSize: 2000 }, - [gen.posInt, gen.posInt], - (s1, s2) => { - const a1 = arrayOfSize(s1); - const a2 = arrayOfSize(s2); + it('unshifts multiple values to the front', () => { + fc.assert( + fc.property(fc.nat(100), fc.nat(100), (s1, s2) => { + const a1 = arrayOfSize(s1); + const a2 = arrayOfSize(s2); - const v1 = List(a1); - const v3 = v1.unshift.apply(v1, a2); + const v1 = List(a1); + const v3 = v1.unshift.apply(v1, a2); - const a3 = a1.slice(); - a3.unshift.apply(a3, a2); + const a3 = a1.slice(); + a3.unshift.apply(a3, a2); - expect(v3.size).toEqual(a3.length); - expect(v3.toArray()).toEqual(a3); - } - ); + expect(v3.size).toEqual(a3.length); + expect(v3.toArray()).toEqual(a3); + }) + ); + }); it('finds values using indexOf', () => { const v = List.of('a', 'b', 'c', 'b', 'a'); @@ -1039,35 +1033,43 @@ describe('List', () => { }); describe('Iterator', () => { - const pInt = gen.posInt; - - check.it('iterates through List', [pInt, pInt], (start, len) => { - const l1 = Range(0, start + len).toList(); - const l2: List = l1.slice(start, start + len); - expect(l2.size).toBe(len); - const valueIter = l2.values(); - const keyIter = l2.keys(); - const entryIter = l2.entries(); - for (let ii = 0; ii < len; ii++) { - expect(valueIter.next().value).toBe(start + ii); - expect(keyIter.next().value).toBe(ii); - expect(entryIter.next().value).toEqual([ii, start + ii]); - } + const pInt = fc.nat(100); + + it('iterates through List', () => { + fc.assert( + fc.property(pInt, pInt, (start, len) => { + const l1 = Range(0, start + len).toList(); + const l2: List = l1.slice(start, start + len); + expect(l2.size).toBe(len); + const valueIter = l2.values(); + const keyIter = l2.keys(); + const entryIter = l2.entries(); + for (let ii = 0; ii < len; ii++) { + expect(valueIter.next().value).toBe(start + ii); + expect(keyIter.next().value).toBe(ii); + expect(entryIter.next().value).toEqual([ii, start + ii]); + } + }) + ); }); - check.it('iterates through List in reverse', [pInt, pInt], (start, len) => { - const l1 = Range(0, start + len).toList(); - const l2: List = l1.slice(start, start + len); - const s = l2.toSeq().reverse(); // impl calls List.__iterator(REVERSE) - expect(s.size).toBe(len); - const valueIter = s.values(); - const keyIter = s.keys(); - const entryIter = s.entries(); - for (let ii = 0; ii < len; ii++) { - expect(valueIter.next().value).toBe(start + len - 1 - ii); - expect(keyIter.next().value).toBe(ii); - expect(entryIter.next().value).toEqual([ii, start + len - 1 - ii]); - } + it('iterates through List in reverse', () => { + fc.assert( + fc.property(pInt, pInt, (start, len) => { + const l1 = Range(0, start + len).toList(); + const l2: List = l1.slice(start, start + len); + const s = l2.toSeq().reverse(); // impl calls List.__iterator(REVERSE) + expect(s.size).toBe(len); + const valueIter = s.values(); + const keyIter = s.keys(); + const entryIter = s.entries(); + for (let ii = 0; ii < len; ii++) { + expect(valueIter.next().value).toBe(start + len - 1 - ii); + expect(keyIter.next().value).toBe(ii); + expect(entryIter.next().value).toEqual([ii, start + len - 1 - ii]); + } + }) + ); }); }); }); diff --git a/__tests__/Map.ts b/__tests__/Map.ts index 85e84de05e..2e34c86ae0 100644 --- a/__tests__/Map.ts +++ b/__tests__/Map.ts @@ -1,7 +1,5 @@ import { fromJS, is, List, Map, Range, Record, Seq } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; - -jasmineCheck.install(); +import fc from 'fast-check'; describe('Map', () => { it('converts from object', () => { @@ -197,14 +195,18 @@ describe('Map', () => { expect(m5.get('c')).toBe('Canary'); }); - check.it('deletes down to empty map', [gen.posInt], (size) => { - let m = Range(0, size).toMap(); - expect(m.size).toBe(size); - for (let ii = size - 1; ii >= 0; ii--) { - m = m.remove(ii); - expect(m.size).toBe(ii); - } - expect(m).toBe(Map()); + it('deletes down to empty map', () => { + fc.assert( + fc.property(fc.nat(100), (size) => { + let m = Range(0, size).toMap(); + expect(m.size).toBe(size); + for (let ii = size - 1; ii >= 0; ii--) { + m = m.remove(ii); + expect(m.size).toBe(ii); + } + expect(m).toBe(Map()); + }) + ); }); it('can map many items', () => { @@ -330,75 +332,94 @@ describe('Map', () => { expect(k.get(1)).toBe('b'); }); - check.it( - 'works like an object', - { maxSize: 50 }, - [gen.object(gen.JSONPrimitive)], - (obj) => { - let map = Map(obj); - Object.keys(obj).forEach((key) => { - expect(map.get(key)).toBe(obj[key]); - expect(map.has(key)).toBe(true); - }); - Object.keys(obj).forEach((key) => { - expect(map.get(key)).toBe(obj[key]); - expect(map.has(key)).toBe(true); - map = map.remove(key); - expect(map.get(key)).toBe(undefined); - expect(map.has(key)).toBe(false); - }); - } - ); + it('works like an object', () => { + fc.assert( + fc.property(fc.object({ maxKeys: 50 }), (obj) => { + let map = Map(obj); + Object.keys(obj).forEach((key) => { + expect(map.get(key)).toBe(obj[key]); + expect(map.has(key)).toBe(true); + }); + Object.keys(obj).forEach((key) => { + expect(map.get(key)).toBe(obj[key]); + expect(map.has(key)).toBe(true); + map = map.remove(key); + expect(map.get(key)).toBe(undefined); + expect(map.has(key)).toBe(false); + }); + }) + ); + }); - check.it('sets', { maxSize: 5000 }, [gen.posInt], (len) => { - let map = Map(); - for (let ii = 0; ii < len; ii++) { - expect(map.size).toBe(ii); - map = map.set('' + ii, ii); - } - expect(map.size).toBe(len); - expect(is(map.toSet(), Range(0, len).toSet())).toBe(true); - }); - - check.it('has and get', { maxSize: 5000 }, [gen.posInt], (len) => { - const map = Range(0, len) - .toKeyedSeq() - .mapKeys((x) => '' + x) - .toMap(); - for (let ii = 0; ii < len; ii++) { - expect(map.get('' + ii)).toBe(ii); - expect(map.has('' + ii)).toBe(true); - } + it('sets', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + let map = Map(); + for (let ii = 0; ii < len; ii++) { + expect(map.size).toBe(ii); + map = map.set('' + ii, ii); + } + expect(map.size).toBe(len); + expect(is(map.toSet(), Range(0, len).toSet())).toBe(true); + }) + ); }); - check.it('deletes', { maxSize: 5000 }, [gen.posInt], (len) => { - let map = Range(0, len).toMap(); - for (let ii = 0; ii < len; ii++) { - expect(map.size).toBe(len - ii); - map = map.remove(ii); - } - expect(map.size).toBe(0); - expect(map.toObject()).toEqual({}); + it('has and get', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const map = Range(0, len) + .toKeyedSeq() + .mapKeys((x) => '' + x) + .toMap(); + for (let ii = 0; ii < len; ii++) { + expect(map.get('' + ii)).toBe(ii); + expect(map.has('' + ii)).toBe(true); + } + }) + ); }); - check.it('deletes from transient', { maxSize: 5000 }, [gen.posInt], (len) => { - const map = Range(0, len).toMap().asMutable(); - for (let ii = 0; ii < len; ii++) { - expect(map.size).toBe(len - ii); - map.remove(ii); - } - expect(map.size).toBe(0); - expect(map.toObject()).toEqual({}); + it('deletes', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + let map = Range(0, len).toMap(); + for (let ii = 0; ii < len; ii++) { + expect(map.size).toBe(len - ii); + map = map.remove(ii); + } + expect(map.size).toBe(0); + expect(map.toObject()).toEqual({}); + }) + ); }); - check.it('iterates through all entries', [gen.posInt], (len) => { - const v = Range(0, len).toMap(); - const a = v.toArray(); - const iter = v.entries(); - for (let ii = 0; ii < len; ii++) { - delete a[iter.next().value[0]]; - } - expect(a).toEqual(new Array(len)); + it('deletes from transient', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const map = Range(0, len).toMap().asMutable(); + for (let ii = 0; ii < len; ii++) { + expect(map.size).toBe(len - ii); + map.remove(ii); + } + expect(map.size).toBe(0); + expect(map.toObject()).toEqual({}); + }) + ); + }); + + it('iterates through all entries', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const v = Range(0, len).toMap(); + const a = v.toArray(); + const iter = v.entries(); + for (let ii = 0; ii < len; ii++) { + delete a[iter.next().value[0]]; + } + expect(a).toEqual(new Array(len)); + }) + ); }); it('allows chained mutations', () => { diff --git a/__tests__/Range.ts b/__tests__/Range.ts index b134dfe49c..07d7f1b327 100644 --- a/__tests__/Range.ts +++ b/__tests__/Range.ts @@ -1,7 +1,5 @@ import { Range } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; - -jasmineCheck.install(); +import fc from 'fast-check'; describe('Range', () => { it('fixed range', () => { @@ -72,33 +70,43 @@ describe('Range', () => { expect(v.toArray()).toEqual([]); }); - check.it('includes first, excludes last', [gen.int, gen.int], (from, to) => { - const isIncreasing = to >= from; - const size = isIncreasing ? to - from : from - to; - const r = Range(from, to); - const a = r.toArray(); - expect(r.size).toBe(size); - expect(a.length).toBe(size); - expect(r.get(0)).toBe(size ? from : undefined); - expect(a[0]).toBe(size ? from : undefined); - const last = to + (isIncreasing ? -1 : 1); - expect(r.last()).toBe(size ? last : undefined); - if (size) { - expect(a[a.length - 1]).toBe(last); - } - }); - - const shrinkInt = gen.int.alwaysShrink(); - - check.it( - 'slices the same as array slices', - [shrinkInt, shrinkInt, shrinkInt, shrinkInt], - (from, to, begin, end) => { - const r = Range(from, to); - const a = r.toArray(); - expect(r.slice(begin, end).toArray()).toEqual(a.slice(begin, end)); - } - ); + const shrinkInt = fc.integer({ min: -1000, max: 1000 }); + + it('includes first, excludes last', () => { + fc.assert( + fc.property(shrinkInt, shrinkInt, (from, to) => { + const isIncreasing = to >= from; + const size = isIncreasing ? to - from : from - to; + const r = Range(from, to); + const a = r.toArray(); + expect(r.size).toBe(size); + expect(a.length).toBe(size); + expect(r.get(0)).toBe(size ? from : undefined); + expect(a[0]).toBe(size ? from : undefined); + const last = to + (isIncreasing ? -1 : 1); + expect(r.last()).toBe(size ? last : undefined); + if (size) { + expect(a[a.length - 1]).toBe(last); + } + }) + ); + }); + + it('slices the same as array slices', () => { + fc.assert( + fc.property( + shrinkInt, + shrinkInt, + shrinkInt, + shrinkInt, + (from, to, begin, end) => { + const r = Range(from, to); + const a = r.toArray(); + expect(r.slice(begin, end).toArray()).toEqual(a.slice(begin, end)); + } + ) + ); + }); it('slices range', () => { const v = Range(1, 11, 2); diff --git a/__tests__/Stack.ts b/__tests__/Stack.ts index 31dd29e064..97c8744074 100644 --- a/__tests__/Stack.ts +++ b/__tests__/Stack.ts @@ -1,7 +1,5 @@ import { Seq, Stack } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; - -jasmineCheck.install(); +import fc from 'fast-check'; function arrayOfSize(s) { const a = new Array(s); @@ -133,62 +131,59 @@ describe('Stack', () => { expect(s.toArray()).toEqual(['b', 'c']); }); - check.it( - 'shift removes the lowest index, just like array', - { maxSize: 2000 }, - [gen.posInt], - (len) => { - const a = arrayOfSize(len); - let s = Stack(a); - - while (a.length) { + it('shift removes the lowest index, just like array', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const a = arrayOfSize(len); + let s = Stack(a); + + while (a.length) { + expect(s.size).toBe(a.length); + expect(s.toArray()).toEqual(a); + s = s.shift(); + a.shift(); + } expect(s.size).toBe(a.length); expect(s.toArray()).toEqual(a); - s = s.shift(); - a.shift(); - } - expect(s.size).toBe(a.length); - expect(s.toArray()).toEqual(a); - } - ); - - check.it( - 'unshift adds the next lowest index, just like array', - { maxSize: 2000 }, - [gen.posInt], - (len) => { - const a: Array = []; - let s = Stack(); + }) + ); + }); - for (let ii = 0; ii < len; ii++) { + it('unshift adds the next lowest index, just like array', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const a: Array = []; + let s = Stack(); + + for (let ii = 0; ii < len; ii++) { + expect(s.size).toBe(a.length); + expect(s.toArray()).toEqual(a); + s = s.unshift(ii); + a.unshift(ii); + } expect(s.size).toBe(a.length); expect(s.toArray()).toEqual(a); - s = s.unshift(ii); - a.unshift(ii); - } - expect(s.size).toBe(a.length); - expect(s.toArray()).toEqual(a); - } - ); + }) + ); + }); - check.it( - 'unshifts multiple values to the front', - { maxSize: 2000 }, - [gen.posInt, gen.posInt], - (size1: number, size2: number) => { - const a1 = arrayOfSize(size1); - const a2 = arrayOfSize(size2); + it('unshifts multiple values to the front', () => { + fc.assert( + fc.property(fc.nat(100), fc.nat(100), (size1: number, size2: number) => { + const a1 = arrayOfSize(size1); + const a2 = arrayOfSize(size2); - const s1 = Stack(a1); - const s3 = s1.unshift.apply(s1, a2); + const s1 = Stack(a1); + const s3 = s1.unshift.apply(s1, a2); - const a3 = a1.slice(); - a3.unshift.apply(a3, a2); + const a3 = a1.slice(); + a3.unshift.apply(a3, a2); - expect(s3.size).toEqual(a3.length); - expect(s3.toArray()).toEqual(a3); - } - ); + expect(s3.size).toEqual(a3.length); + expect(s3.toArray()).toEqual(a3); + }) + ); + }); it('finds values using indexOf', () => { const s = Stack.of('a', 'b', 'c', 'b', 'a'); diff --git a/__tests__/find.ts b/__tests__/find.ts index b8806d1f95..78af24c6d7 100644 --- a/__tests__/find.ts +++ b/__tests__/find.ts @@ -1,7 +1,4 @@ import { Seq } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; - -jasmineCheck.install(); describe('find', () => { it('find returns notSetValue when match is not found', () => { diff --git a/__tests__/flatten.ts b/__tests__/flatten.ts index b4c8e6fe25..f76a5d3939 100644 --- a/__tests__/flatten.ts +++ b/__tests__/flatten.ts @@ -1,7 +1,4 @@ import { Collection, fromJS, List, Range, Seq } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; - -jasmineCheck.install(); describe('flatten', () => { it('flattens sequences one level deep', () => { diff --git a/__tests__/hash.ts b/__tests__/hash.ts index bc7b303038..06c5fcd4bc 100644 --- a/__tests__/hash.ts +++ b/__tests__/hash.ts @@ -1,7 +1,5 @@ import { hash } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; - -jasmineCheck.install(); +import fc from 'fast-check'; describe('hash', () => { it('stable hash of well known values', () => { @@ -42,12 +40,16 @@ describe('hash', () => { expect(hash(funA)).not.toBe(hash(funB)); }); - const genValue = gen.oneOf([gen.string, gen.int]); - - check.it('generates unsigned 31-bit integers', [genValue], (value) => { - const hashVal = hash(value); - expect(Number.isInteger(hashVal)).toBe(true); - expect(hashVal).toBeGreaterThan(-(2 ** 31)); - expect(hashVal).toBeLessThan(2 ** 31); + const genValue = fc.oneof(fc.string(), fc.integer()); + + it('generates unsigned 31-bit integers', () => { + fc.assert( + fc.property(genValue, (value) => { + const hashVal = hash(value); + expect(Number.isInteger(hashVal)).toBe(true); + expect(hashVal).toBeGreaterThan(-(2 ** 31)); + expect(hashVal).toBeLessThan(2 ** 31); + }) + ); }); }); diff --git a/__tests__/join.ts b/__tests__/join.ts index 02102de7f3..e08f8bef72 100644 --- a/__tests__/join.ts +++ b/__tests__/join.ts @@ -1,7 +1,5 @@ import { Seq } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; - -jasmineCheck.install(); +import fc from 'fast-check'; describe('join', () => { it('string-joins sequences with commas by default', () => { @@ -33,11 +31,20 @@ describe('join', () => { expect(Seq(a).join()).toBe(a.join()); }); - check.it( - 'behaves the same as Array.join', - [gen.array(gen.primitive), gen.primitive], - (array, joiner) => { - expect(Seq(array).join(joiner)).toBe(array.join(joiner)); - } + const genPrimitive = fc.oneof( + fc.string(), + fc.integer(), + fc.boolean(), + fc.constant(null), + fc.constant(undefined), + fc.constant(NaN) ); + + it('behaves the same as Array.join', () => { + fc.assert( + fc.property(fc.array(genPrimitive), genPrimitive, (array, joiner) => { + expect(Seq(array).join(joiner)).toBe(array.join(joiner)); + }) + ); + }); }); diff --git a/__tests__/minmax.ts b/__tests__/minmax.ts index ae04058040..c7f73ecbf5 100644 --- a/__tests__/minmax.ts +++ b/__tests__/minmax.ts @@ -1,12 +1,10 @@ import { is, Seq } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; +import fc from 'fast-check'; -jasmineCheck.install(); - -const genHeterogeneousishArray = gen.oneOf([ - gen.array(gen.oneOf([gen.string, gen.undefined])), - gen.array(gen.oneOf([gen.int, gen.NaN])), -]); +const genHeterogeneousishArray = fc.oneof( + fc.sparseArray(fc.string()), + fc.array(fc.oneof(fc.integer(), fc.constant(NaN))) +); describe('max', () => { it('returns max in a sequence', () => { @@ -53,8 +51,14 @@ describe('max', () => { expect(is(2, Seq([-1, -2, null, 1, 2]).max())).toBe(true); }); - check.it('is not dependent on order', [genHeterogeneousishArray], (vals) => { - expect(is(Seq(shuffle(vals.slice())).max(), Seq(vals).max())).toEqual(true); + it('is not dependent on order', () => { + fc.assert( + fc.property(genHeterogeneousishArray, (vals) => { + expect(is(Seq(shuffle(vals.slice())).max(), Seq(vals).max())).toEqual( + true + ); + }) + ); }); }); @@ -92,8 +96,14 @@ describe('min', () => { ).toBe(family.get(2)); }); - check.it('is not dependent on order', [genHeterogeneousishArray], (vals) => { - expect(is(Seq(shuffle(vals.slice())).min(), Seq(vals).min())).toEqual(true); + it('is not dependent on order', () => { + fc.assert( + fc.property(genHeterogeneousishArray, (vals) => { + expect(is(Seq(shuffle(vals.slice())).min(), Seq(vals).min())).toEqual( + true + ); + }) + ); }); }); diff --git a/__tests__/slice.ts b/__tests__/slice.ts index d7c52dd438..4adc40dbda 100644 --- a/__tests__/slice.ts +++ b/__tests__/slice.ts @@ -1,7 +1,5 @@ import { List, Range, Seq } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; - -jasmineCheck.install(); +import fc from 'fast-check'; describe('slice', () => { it('slices a sequence', () => { @@ -227,53 +225,53 @@ describe('slice', () => { expect(iterTail.next()).toEqual({ value: undefined, done: true }); }); - check.it( - 'works like Array.prototype.slice', - [ - gen.int, - gen.array(gen.oneOf([gen.int, gen.undefined]), { - minSize: 0, - maxSize: 3, - }), - ], - (valuesLen, args) => { - const a = Range(0, valuesLen).toArray(); - const v = List(a); - const slicedV = v.slice.apply(v, args); - const slicedA = a.slice.apply(a, args); - expect(slicedV.toArray()).toEqual(slicedA); - } - ); + it('works like Array.prototype.slice', () => { + fc.assert( + fc.property( + fc.integer({ min: -1000, max: 1000 }), + fc.sparseArray(fc.integer({ min: -1000, max: 1000 }), { maxLength: 3 }), + (valuesLen, args) => { + const a = Range(0, valuesLen).toArray(); + const v = List(a); + const slicedV = v.slice.apply(v, args); + const slicedA = a.slice.apply(a, args); + expect(slicedV.toArray()).toEqual(slicedA); + } + ) + ); + }); - check.it( - 'works like Array.prototype.slice on sparse array input', - [ - gen.array(gen.array([gen.posInt, gen.int])), - gen.array(gen.oneOf([gen.int, gen.undefined]), { - minSize: 0, - maxSize: 3, - }), - ], - (entries, args) => { - const a: Array = []; - entries.forEach((entry) => (a[entry[0]] = entry[1])); - const s = Seq(a); - const slicedS = s.slice.apply(s, args); - const slicedA = a.slice.apply(a, args); - expect(slicedS.toArray()).toEqual(slicedA); - } - ); + it('works like Array.prototype.slice on sparse array input', () => { + fc.assert( + fc.property( + fc.array(fc.tuple(fc.nat(1000), fc.integer({ min: -1000, max: 1000 }))), + fc.sparseArray(fc.integer({ min: -1000, max: 1000 }), { maxLength: 3 }), + (entries, args) => { + const a: Array = []; + entries.forEach((entry) => (a[entry[0]] = entry[1])); + const s = Seq(a); + const slicedS = s.slice.apply(s, args); + const slicedA = a.slice.apply(a, args); + expect(slicedS.toArray()).toEqual(slicedA); + } + ) + ); + }); describe('take', () => { - check.it( - 'takes the first n from a list', - [gen.int, gen.posInt], - (len, num) => { - const a = Range(0, len).toArray(); - const v = List(a); - expect(v.take(num).toArray()).toEqual(a.slice(0, num)); - } - ); + it('takes the first n from a list', () => { + fc.assert( + fc.property( + fc.integer({ min: -1000, max: 1000 }), + fc.nat(1000), + (len, num) => { + const a = Range(0, len).toArray(); + const v = List(a); + expect(v.take(num).toArray()).toEqual(a.slice(0, num)); + } + ) + ); + }); it('creates an immutable stable sequence', () => { const seq = Seq([1, 2, 3, 4, 5, 6]); diff --git a/__tests__/splice.ts b/__tests__/splice.ts index 4d5dd309ff..519bbe906f 100644 --- a/__tests__/splice.ts +++ b/__tests__/splice.ts @@ -1,7 +1,5 @@ import { List, Range, Seq } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; - -jasmineCheck.install(); +import fc from 'fast-check'; describe('splice', () => { it('splices a sequence only removing elements', () => { @@ -48,15 +46,19 @@ describe('splice', () => { expect(v.splice(-18, 0, 0).toList().toArray()).toEqual(a); }); - check.it( - 'has the same behavior as array splice', - [gen.array(gen.int), gen.array(gen.oneOf([gen.int, gen.undefined]))], - (values, args) => { - const v = List(values); - const a = values.slice(); // clone - const splicedV = v.splice.apply(v, args); // persistent - a.splice.apply(a, args); // mutative - expect(splicedV.toArray()).toEqual(a); - } - ); + it('has the same behavior as array splice', () => { + fc.assert( + fc.property( + fc.array(fc.integer()), + fc.array(fc.sparseArray(fc.integer())), + (values, args) => { + const v = List(values); + const a = values.slice(); // clone + const splicedV = v.splice.apply(v, args); // persistent + a.splice.apply(a, args); // mutative + expect(splicedV.toArray()).toEqual(a); + } + ) + ); + }); }); diff --git a/__tests__/transformerProtocol.ts b/__tests__/transformerProtocol.ts index e13c1556a1..ec73153b51 100644 --- a/__tests__/transformerProtocol.ts +++ b/__tests__/transformerProtocol.ts @@ -1,8 +1,5 @@ import * as t from 'transducers-js'; import { List, Map, Set, Stack } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; - -jasmineCheck.install(); describe('Transformer Protocol', () => { it('transduces Stack without initial values', () => { diff --git a/__tests__/tsconfig.json b/__tests__/tsconfig.json index 1de3301b83..78742cd9bd 100644 --- a/__tests__/tsconfig.json +++ b/__tests__/tsconfig.json @@ -8,8 +8,7 @@ "moduleResolution": "node", "skipLibCheck": true, "paths": { - "immutable": ["../type-definitions/immutable.d.ts"], - "jasmine-check": ["../resources/jasmine-check.d.ts"] + "immutable": ["../type-definitions/immutable.d.ts"] } } } diff --git a/__tests__/zip.ts b/__tests__/zip.ts index ca32a3f88e..1ae651dfa6 100644 --- a/__tests__/zip.ts +++ b/__tests__/zip.ts @@ -1,7 +1,5 @@ import { List, Range, Seq } from 'immutable'; -import * as jasmineCheck from 'jasmine-check'; - -jasmineCheck.install(); +import fc from 'fast-check'; describe('zip', () => { it('zips lists into a list of tuples', () => { @@ -53,17 +51,17 @@ describe('zip', () => { expect(zipped.count()).toBe(5); }); - check.it( - 'is always the size of the smaller sequence', - [gen.array(gen.posInt).notEmpty()], - (lengths) => { - const ranges = lengths.map((l) => Range(0, l)); - const first = ranges.shift(); - const zipped = first.zip.apply(first, ranges); - const shortestLength = Math.min.apply(Math, lengths); - expect(zipped.size).toBe(shortestLength); - } - ); + it('is always the size of the smaller sequence', () => { + fc.assert( + fc.property(fc.array(fc.nat(), { minLength: 1 }), (lengths) => { + const ranges = lengths.map((l) => Range(0, l)); + const first = ranges.shift(); + const zipped = first.zip.apply(first, ranges); + const shortestLength = Math.min.apply(Math, lengths); + expect(zipped.size).toBe(shortestLength); + }) + ); + }); describe('zipWith', () => { it('zips with a custom function', () => { @@ -107,17 +105,17 @@ describe('zip', () => { ]); }); - check.it( - 'is always the size of the longest sequence', - [gen.array(gen.posInt).notEmpty()], - (lengths) => { - const ranges = lengths.map((l) => Range(0, l)); - const first = ranges.shift(); - const zipped = first.zipAll.apply(first, ranges); - const longestLength = Math.max.apply(Math, lengths); - expect(zipped.size).toBe(longestLength); - } - ); + it('is always the size of the longest sequence', () => { + fc.assert( + fc.property(fc.array(fc.nat(), { minLength: 1 }), (lengths) => { + const ranges = lengths.map((l) => Range(0, l)); + const first = ranges.shift(); + const zipped = first.zipAll.apply(first, ranges); + const longestLength = Math.max.apply(Math, lengths); + expect(zipped.size).toBe(longestLength); + }) + ); + }); }); describe('interleave', () => { diff --git a/jest.config.js b/jest.config.js index 5aa77d6386..f4c587c290 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,6 +1,5 @@ // eslint-disable-next-line no-undef module.exports = { - testRunner: 'jest-jasmine2', // See https://jestjs.io/blog/2021/05/25/jest-27#flipping-defaults as `jasmine-check` uses jasmine and not `jest-circus` moduleFileExtensions: ['js', 'ts'], resolver: '/resources/jestResolver.js', transform: { diff --git a/package-lock.json b/package-lock.json index fa5c28916d..32bc7136bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,12 +29,11 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-jest": "^28.11.0", "eslint-plugin-react": "^7.37.4", + "fast-check": "^4.0.0", "flow-bin": "0.160.0", "globals": "^15.15.0", - "jasmine-check": "1.0.0-rc.0", "jest": "^29.0.0", "jest-environment-jsdom": "^29.6.4", - "jest-jasmine2": "^29.6.4", "make-synchronous": "0.1.1", "marked": "^11.2.0", "marked-highlight": "^2.1.0", @@ -5453,6 +5452,46 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/fast-check": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.0.0.tgz", + "integrity": "sha512-aXLyLemZ7qhLNn2oq+YpjT2Xed21+i29WGAYuyrGbU4r8oinB3i4XR4e62O3NY6qmm5qHEDoc/7d+gMsri3AfA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT", + "dependencies": { + "pure-rand": "^7.0.0" + }, + "engines": { + "node": ">=12.17.0" + } + }, + "node_modules/fast-check/node_modules/pure-rand": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-7.0.1.tgz", + "integrity": "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -6868,15 +6907,6 @@ "node": ">= 0.4" } }, - "node_modules/jasmine-check": { - "version": "1.0.0-rc.0", - "resolved": "https://registry.npmjs.org/jasmine-check/-/jasmine-check-1.0.0-rc.0.tgz", - "integrity": "sha1-EXcowVAHjs8hGYbF8WQnW3HpN6Q=", - "dev": true, - "dependencies": { - "testcheck": "^1.0.0-rc" - } - }, "node_modules/jest": { "version": "29.6.4", "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.4.tgz", @@ -7166,34 +7196,6 @@ "fsevents": "^2.3.2" } }, - "node_modules/jest-jasmine2": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-29.6.4.tgz", - "integrity": "sha512-xJ1A+UA5WKs4aA1SP++KA+bOaM/mA0atDRAjkboUUkzWw5hRJxFam7fJoJ18C87VVN4XT2ZmO9m5dWOc30lQxg==", - "dev": true, - "dependencies": { - "@jest/environment": "^29.6.4", - "@jest/expect": "^29.6.4", - "@jest/source-map": "^29.6.3", - "@jest/test-result": "^29.6.4", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "co": "^4.6.0", - "is-generator-fn": "^2.0.0", - "jest-each": "^29.6.3", - "jest-matcher-utils": "^29.6.4", - "jest-message-util": "^29.6.3", - "jest-runtime": "^29.6.4", - "jest-snapshot": "^29.6.4", - "jest-util": "^29.6.3", - "p-limit": "^3.1.0", - "pretty-format": "^29.6.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/jest-leak-detector": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.3.tgz", @@ -10216,12 +10218,6 @@ "node": ">=8" } }, - "node_modules/testcheck": { - "version": "1.0.0-rc.2", - "resolved": "https://registry.npmjs.org/testcheck/-/testcheck-1.0.0-rc.2.tgz", - "integrity": "sha1-ETVqJbhFde/gsIV0UehbX6dO5OQ=", - "dev": true - }, "node_modules/tinyglobby": { "version": "0.2.12", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", @@ -14535,6 +14531,23 @@ "jest-util": "^29.6.3" } }, + "fast-check": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.0.0.tgz", + "integrity": "sha512-aXLyLemZ7qhLNn2oq+YpjT2Xed21+i29WGAYuyrGbU4r8oinB3i4XR4e62O3NY6qmm5qHEDoc/7d+gMsri3AfA==", + "dev": true, + "requires": { + "pure-rand": "^7.0.0" + }, + "dependencies": { + "pure-rand": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-7.0.1.tgz", + "integrity": "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ==", + "dev": true + } + } + }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -15473,15 +15486,6 @@ "set-function-name": "^2.0.2" } }, - "jasmine-check": { - "version": "1.0.0-rc.0", - "resolved": "https://registry.npmjs.org/jasmine-check/-/jasmine-check-1.0.0-rc.0.tgz", - "integrity": "sha1-EXcowVAHjs8hGYbF8WQnW3HpN6Q=", - "dev": true, - "requires": { - "testcheck": "^1.0.0-rc" - } - }, "jest": { "version": "29.6.4", "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.4.tgz", @@ -15687,31 +15691,6 @@ "walker": "^1.0.8" } }, - "jest-jasmine2": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-29.6.4.tgz", - "integrity": "sha512-xJ1A+UA5WKs4aA1SP++KA+bOaM/mA0atDRAjkboUUkzWw5hRJxFam7fJoJ18C87VVN4XT2ZmO9m5dWOc30lQxg==", - "dev": true, - "requires": { - "@jest/environment": "^29.6.4", - "@jest/expect": "^29.6.4", - "@jest/source-map": "^29.6.3", - "@jest/test-result": "^29.6.4", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "co": "^4.6.0", - "is-generator-fn": "^2.0.0", - "jest-each": "^29.6.3", - "jest-matcher-utils": "^29.6.4", - "jest-message-util": "^29.6.3", - "jest-runtime": "^29.6.4", - "jest-snapshot": "^29.6.4", - "jest-util": "^29.6.3", - "p-limit": "^3.1.0", - "pretty-format": "^29.6.3" - } - }, "jest-leak-detector": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.3.tgz", @@ -17833,12 +17812,6 @@ "minimatch": "^3.0.4" } }, - "testcheck": { - "version": "1.0.0-rc.2", - "resolved": "https://registry.npmjs.org/testcheck/-/testcheck-1.0.0-rc.2.tgz", - "integrity": "sha1-ETVqJbhFde/gsIV0UehbX6dO5OQ=", - "dev": true - }, "tinyglobby": { "version": "0.2.12", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", diff --git a/package.json b/package.json index 00443dd792..1ca444cd5c 100644 --- a/package.json +++ b/package.json @@ -103,12 +103,11 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-jest": "^28.11.0", "eslint-plugin-react": "^7.37.4", + "fast-check": "^4.0.0", "flow-bin": "0.160.0", "globals": "^15.15.0", - "jasmine-check": "1.0.0-rc.0", "jest": "^29.0.0", "jest-environment-jsdom": "^29.6.4", - "jest-jasmine2": "^29.6.4", "make-synchronous": "0.1.1", "marked": "^11.2.0", "marked-highlight": "^2.1.0", diff --git a/resources/jasmine-check.d.ts b/resources/jasmine-check.d.ts deleted file mode 100644 index cfb8545353..0000000000 --- a/resources/jasmine-check.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -// TODO: proper types -// eslint-disable-next-line @typescript-eslint/no-explicit-any -declare var check: any; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -declare var gen: any; -declare module 'jasmine-check'; From 6e6cb1a6a1af873ff87c2caf6bdc7bdf56b1155a Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Thu, 27 Mar 2025 08:01:32 +0000 Subject: [PATCH 10/59] fix Typescript reports --- __tests__/Conversion.ts | 9 ++++++--- __tests__/join.ts | 1 + __tests__/minmax.ts | 12 ++++++------ __tests__/ts-utils.ts | 5 +++++ __tests__/zip.ts | 3 +++ jest.config.js | 1 + 6 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 __tests__/ts-utils.ts diff --git a/__tests__/Conversion.ts b/__tests__/Conversion.ts index 25900bcd5e..c5d081782a 100644 --- a/__tests__/Conversion.ts +++ b/__tests__/Conversion.ts @@ -1,5 +1,5 @@ import { fromJS, is, List, Map, OrderedMap, Record } from 'immutable'; -import fc from 'fast-check'; +import fc, { type JsonValue } from 'fast-check'; describe('Conversion', () => { // Note: order of keys based on Map's hashing order @@ -192,9 +192,12 @@ describe('Conversion', () => { it('toJS isomorphic value', () => { fc.assert( - fc.property(fc.jsonValue(), (v) => { + fc.property(fc.jsonValue(), (v: JsonValue) => { const imm = fromJS(v); - expect(imm && imm.toJS ? imm.toJS() : imm).toEqual(v); + expect( + // @ts-expect-error Property 'toJS' does not exist on type '{}'.ts(2339) + imm && imm.toJS ? imm.toJS() : imm + ).toEqual(v); }), { numRuns: 30 } ); diff --git a/__tests__/join.ts b/__tests__/join.ts index e08f8bef72..8b072d5c93 100644 --- a/__tests__/join.ts +++ b/__tests__/join.ts @@ -43,6 +43,7 @@ describe('join', () => { it('behaves the same as Array.join', () => { fc.assert( fc.property(fc.array(genPrimitive), genPrimitive, (array, joiner) => { + // @ts-expect-error unexpected values for typescript joiner, but valid at runtime despite the unexpected errors expect(Seq(array).join(joiner)).toBe(array.join(joiner)); }) ); diff --git a/__tests__/minmax.ts b/__tests__/minmax.ts index c7f73ecbf5..7fb15856d0 100644 --- a/__tests__/minmax.ts +++ b/__tests__/minmax.ts @@ -54,9 +54,9 @@ describe('max', () => { it('is not dependent on order', () => { fc.assert( fc.property(genHeterogeneousishArray, (vals) => { - expect(is(Seq(shuffle(vals.slice())).max(), Seq(vals).max())).toEqual( - true - ); + expect( + is(Seq(shuffle(vals.slice())).max(), Seq(vals).max()) + ).toEqual(true); }) ); }); @@ -99,9 +99,9 @@ describe('min', () => { it('is not dependent on order', () => { fc.assert( fc.property(genHeterogeneousishArray, (vals) => { - expect(is(Seq(shuffle(vals.slice())).min(), Seq(vals).min())).toEqual( - true - ); + expect( + is(Seq(shuffle(vals.slice())).min(), Seq(vals).min()) + ).toEqual(true); }) ); }); diff --git a/__tests__/ts-utils.ts b/__tests__/ts-utils.ts new file mode 100644 index 0000000000..c669bf99ef --- /dev/null +++ b/__tests__/ts-utils.ts @@ -0,0 +1,5 @@ +export function expectToBeDefined( + arg: T +): asserts arg is Exclude { + expect(arg).toBeDefined(); +} diff --git a/__tests__/zip.ts b/__tests__/zip.ts index 1ae651dfa6..67af47f8a6 100644 --- a/__tests__/zip.ts +++ b/__tests__/zip.ts @@ -1,5 +1,6 @@ import { List, Range, Seq } from 'immutable'; import fc from 'fast-check'; +import { expectToBeDefined } from './ts-utils'; describe('zip', () => { it('zips lists into a list of tuples', () => { @@ -56,6 +57,7 @@ describe('zip', () => { fc.property(fc.array(fc.nat(), { minLength: 1 }), (lengths) => { const ranges = lengths.map((l) => Range(0, l)); const first = ranges.shift(); + expectToBeDefined(first); const zipped = first.zip.apply(first, ranges); const shortestLength = Math.min.apply(Math, lengths); expect(zipped.size).toBe(shortestLength); @@ -110,6 +112,7 @@ describe('zip', () => { fc.property(fc.array(fc.nat(), { minLength: 1 }), (lengths) => { const ranges = lengths.map((l) => Range(0, l)); const first = ranges.shift(); + expectToBeDefined(first); const zipped = first.zipAll.apply(first, ranges); const longestLength = Math.max.apply(Math, lengths); expect(zipped.size).toBe(longestLength); diff --git a/jest.config.js b/jest.config.js index f4c587c290..b1b92a65c6 100644 --- a/jest.config.js +++ b/jest.config.js @@ -6,5 +6,6 @@ module.exports = { '^.+\\.(js|ts)$': '/resources/jestPreprocessor.js', }, testRegex: '/__tests__/.*\\.(ts|js)$', + testPathIgnorePatterns: ['/__tests__/ts-utils.ts'], unmockedModulePathPatterns: ['./node_modules/react'], }; From b90d454eb756e7bbe7759491bde7671217293267 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Thu, 27 Mar 2025 09:49:30 +0000 Subject: [PATCH 11/59] type shuffle util in tests --- __tests__/minmax.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/__tests__/minmax.ts b/__tests__/minmax.ts index 7fb15856d0..a4a23205c3 100644 --- a/__tests__/minmax.ts +++ b/__tests__/minmax.ts @@ -55,7 +55,10 @@ describe('max', () => { fc.assert( fc.property(genHeterogeneousishArray, (vals) => { expect( - is(Seq(shuffle(vals.slice())).max(), Seq(vals).max()) + is( + Seq(shuffle(vals.slice())).max(), + Seq(vals).max() + ) ).toEqual(true); }) ); @@ -100,14 +103,17 @@ describe('min', () => { fc.assert( fc.property(genHeterogeneousishArray, (vals) => { expect( - is(Seq(shuffle(vals.slice())).min(), Seq(vals).min()) + is( + Seq(shuffle(vals.slice())).min(), + Seq(vals).min() + ) ).toEqual(true); }) ); }); }); -function shuffle(array) { +function shuffle>(array: A): A { let m = array.length; let t; let i; From 992f37c28c34c49eb03c70ceaf83bd948abff05e Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Fri, 28 Mar 2025 22:23:43 +0000 Subject: [PATCH 12/59] Better TypeScript configuration for jest --- __tests__/ArraySeq.ts | 1 + __tests__/Comparator.ts | 1 + __tests__/Conversion.ts | 1 + __tests__/Equality.ts | 2 + __tests__/IndexedSeq.ts | 1 + __tests__/KeyedSeq.ts | 3 +- __tests__/List.ts | 1 + __tests__/ListJS.js | 1 + __tests__/Map.ts | 1 + __tests__/MultiRequire.js | 1 + __tests__/ObjectSeq.ts | 1 + __tests__/OrderedMap.ts | 1 + __tests__/OrderedSet.ts | 1 + __tests__/Predicates.ts | 1 + __tests__/Range.ts | 2 + __tests__/Record.ts | 3 +- __tests__/RecordJS.js | 5 +- __tests__/Repeat.ts | 1 + __tests__/Seq.ts | 1 + __tests__/Set.ts | 1 + __tests__/Stack.ts | 1 + __tests__/concat.ts | 1 + __tests__/count.ts | 1 + __tests__/find.ts | 1 + __tests__/flatten.ts | 1 + __tests__/fromJS.ts | 3 +- __tests__/functional/get.ts | 1 + __tests__/functional/has.ts | 1 + __tests__/functional/remove.ts | 1 + __tests__/functional/set.ts | 1 + __tests__/functional/update.ts | 1 + __tests__/get.ts | 1 + __tests__/getIn.ts | 1 + __tests__/groupBy.ts | 3 + __tests__/hasIn.ts | 1 + __tests__/hash.ts | 1 + __tests__/interpose.ts | 1 + __tests__/issues.ts | 11 +- __tests__/join.ts | 1 + __tests__/merge.ts | 3 +- __tests__/minmax.ts | 1 + __tests__/partition.ts | 3 +- __tests__/slice.ts | 1 + __tests__/sort.ts | 1 + __tests__/splice.ts | 1 + __tests__/transformerProtocol.ts | 1 + __tests__/ts-utils.ts | 2 + __tests__/updateIn.ts | 1 + __tests__/zip.ts | 1 + eslint.config.mjs | 31 +- jest.config.js => jest.config.mjs | 7 +- package-lock.json | 627 +++++++++++++++++++++--------- package.json | 3 +- perf/List.js | 2 +- website/src/MarkdownContent.tsx | 1 + 55 files changed, 546 insertions(+), 203 deletions(-) rename jest.config.js => jest.config.mjs (70%) diff --git a/__tests__/ArraySeq.ts b/__tests__/ArraySeq.ts index 85b526edbd..1068acb93e 100644 --- a/__tests__/ArraySeq.ts +++ b/__tests__/ArraySeq.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { Seq } from 'immutable'; describe('ArraySequence', () => { diff --git a/__tests__/Comparator.ts b/__tests__/Comparator.ts index f4a95173a9..39ab3679fb 100644 --- a/__tests__/Comparator.ts +++ b/__tests__/Comparator.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { List, OrderedSet, Seq, type Comparator, PairSorting } from 'immutable'; const sourceNumbers: readonly number[] = [3, 4, 5, 6, 7, 9, 10, 12, 90, 92, 95]; diff --git a/__tests__/Conversion.ts b/__tests__/Conversion.ts index c5d081782a..5a008e7e55 100644 --- a/__tests__/Conversion.ts +++ b/__tests__/Conversion.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { fromJS, is, List, Map, OrderedMap, Record } from 'immutable'; import fc, { type JsonValue } from 'fast-check'; diff --git a/__tests__/Equality.ts b/__tests__/Equality.ts index d8915c4e54..ae95ef4a12 100644 --- a/__tests__/Equality.ts +++ b/__tests__/Equality.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { is, List, Map, Seq, Set } from 'immutable'; import fc from 'fast-check'; @@ -143,6 +144,7 @@ describe('Equality', () => { fc.assert( fc.property(genVal, genVal, (a, b) => { if (is(a, b)) { + // eslint-disable-next-line jest/no-conditional-expect expect(a.hashCode()).toBe(b.hashCode()); } }), diff --git a/__tests__/IndexedSeq.ts b/__tests__/IndexedSeq.ts index e113f43999..9d33c234e0 100644 --- a/__tests__/IndexedSeq.ts +++ b/__tests__/IndexedSeq.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { Seq } from 'immutable'; describe('IndexedSequence', () => { diff --git a/__tests__/KeyedSeq.ts b/__tests__/KeyedSeq.ts index cd4d522709..528c28f523 100644 --- a/__tests__/KeyedSeq.ts +++ b/__tests__/KeyedSeq.ts @@ -1,8 +1,9 @@ +import { describe, expect, it } from '@jest/globals'; import { Range, Seq } from 'immutable'; import fc from 'fast-check'; describe('KeyedSeq', () => { - it('it iterates equivalently', () => { + it('iterates equivalently', () => { fc.assert( fc.property(fc.array(fc.integer()), (ints) => { const seq = Seq(ints); diff --git a/__tests__/List.ts b/__tests__/List.ts index ee3cec92a9..da2e9d996b 100644 --- a/__tests__/List.ts +++ b/__tests__/List.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { fromJS, List, Map, Range, Seq, Set } from 'immutable'; import fc from 'fast-check'; import { create as createSeed } from 'random-seed'; diff --git a/__tests__/ListJS.js b/__tests__/ListJS.js index b1bdceec0f..ae18d4881d 100644 --- a/__tests__/ListJS.js +++ b/__tests__/ListJS.js @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { List } from 'immutable'; const NON_NUMBERS = { diff --git a/__tests__/Map.ts b/__tests__/Map.ts index 2e34c86ae0..d8ae8b16ca 100644 --- a/__tests__/Map.ts +++ b/__tests__/Map.ts @@ -1,3 +1,4 @@ +import { describe, expect, it, jest } from '@jest/globals'; import { fromJS, is, List, Map, Range, Record, Seq } from 'immutable'; import fc from 'fast-check'; diff --git a/__tests__/MultiRequire.js b/__tests__/MultiRequire.js index 3afa018aab..17c3de9472 100644 --- a/__tests__/MultiRequire.js +++ b/__tests__/MultiRequire.js @@ -1,3 +1,4 @@ +import { describe, expect, it, jest } from '@jest/globals'; import * as Immutable1 from '../src/Immutable'; jest.resetModules(); diff --git a/__tests__/ObjectSeq.ts b/__tests__/ObjectSeq.ts index bfc0a6f5cd..2b10807cb5 100644 --- a/__tests__/ObjectSeq.ts +++ b/__tests__/ObjectSeq.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { Seq } from 'immutable'; describe('ObjectSequence', () => { diff --git a/__tests__/OrderedMap.ts b/__tests__/OrderedMap.ts index 6258e95114..9c06a6582e 100644 --- a/__tests__/OrderedMap.ts +++ b/__tests__/OrderedMap.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { OrderedMap, Range, Seq } from 'immutable'; describe('OrderedMap', () => { diff --git a/__tests__/OrderedSet.ts b/__tests__/OrderedSet.ts index b85dc16bff..12c958072d 100644 --- a/__tests__/OrderedSet.ts +++ b/__tests__/OrderedSet.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { OrderedSet, Map } from 'immutable'; describe('OrderedSet', () => { diff --git a/__tests__/Predicates.ts b/__tests__/Predicates.ts index 40136c71b9..0ab282205b 100644 --- a/__tests__/Predicates.ts +++ b/__tests__/Predicates.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { is, isImmutable, diff --git a/__tests__/Range.ts b/__tests__/Range.ts index 07d7f1b327..94c096d1a8 100644 --- a/__tests__/Range.ts +++ b/__tests__/Range.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { Range } from 'immutable'; import fc from 'fast-check'; @@ -86,6 +87,7 @@ describe('Range', () => { const last = to + (isIncreasing ? -1 : 1); expect(r.last()).toBe(size ? last : undefined); if (size) { + // eslint-disable-next-line jest/no-conditional-expect expect(a[a.length - 1]).toBe(last); } }) diff --git a/__tests__/Record.ts b/__tests__/Record.ts index 415b27f1d4..3839b6c46b 100644 --- a/__tests__/Record.ts +++ b/__tests__/Record.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { isKeyed, List, Map, Record, Seq } from 'immutable'; describe('Record', () => { @@ -78,7 +79,7 @@ describe('Record', () => { const MyType = Record({ a: 1, b: 2, c: 3 }); const t1 = MyType({ a: 10 }); const t2 = MyType({ a: 10, b: 2 }); - expect(t1.equals(t2)); + expect(t1.equals(t2)).toBe(true); }); it('if compared against undefined or null should return false', () => { diff --git a/__tests__/RecordJS.js b/__tests__/RecordJS.js index 2453e51e78..3ae53fb878 100644 --- a/__tests__/RecordJS.js +++ b/__tests__/RecordJS.js @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { Record } from 'immutable'; describe('Record', () => { @@ -41,8 +42,8 @@ describe('Record', () => { const t = new Alphabet(); const t2 = t.set('b', 200); - expect(t instanceof Record); - expect(t instanceof Alphabet); + expect(t instanceof Record).toBe(true); + expect(t instanceof Alphabet).toBe(true); expect(t.soup()).toBe(6); expect(t2.soup()).toBe(204); diff --git a/__tests__/Repeat.ts b/__tests__/Repeat.ts index 5236a5b8e8..1553232ba5 100644 --- a/__tests__/Repeat.ts +++ b/__tests__/Repeat.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { Repeat } from 'immutable'; describe('Repeat', () => { diff --git a/__tests__/Seq.ts b/__tests__/Seq.ts index d2a954a7af..cbb048eb8b 100644 --- a/__tests__/Seq.ts +++ b/__tests__/Seq.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { isCollection, isIndexed, isKeyed, Seq } from 'immutable'; describe('Seq', () => { diff --git a/__tests__/Set.ts b/__tests__/Set.ts index ff4997c1f7..5e8f1fe5d7 100644 --- a/__tests__/Set.ts +++ b/__tests__/Set.ts @@ -1,3 +1,4 @@ +import { describe, expect, it, jest } from '@jest/globals'; import { fromJS, is, List, Map, OrderedSet, Seq, Set } from 'immutable'; describe('Set', () => { diff --git a/__tests__/Stack.ts b/__tests__/Stack.ts index 97c8744074..f3fc3d9326 100644 --- a/__tests__/Stack.ts +++ b/__tests__/Stack.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { Seq, Stack } from 'immutable'; import fc from 'fast-check'; diff --git a/__tests__/concat.ts b/__tests__/concat.ts index 34a7eebe70..35710a7c49 100644 --- a/__tests__/concat.ts +++ b/__tests__/concat.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { List, Seq, Set } from 'immutable'; describe('concat', () => { diff --git a/__tests__/count.ts b/__tests__/count.ts index 86b0bdf297..488e8d8b5d 100644 --- a/__tests__/count.ts +++ b/__tests__/count.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { Range, Seq } from 'immutable'; describe('count', () => { diff --git a/__tests__/find.ts b/__tests__/find.ts index 78af24c6d7..2f6f186690 100644 --- a/__tests__/find.ts +++ b/__tests__/find.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { Seq } from 'immutable'; describe('find', () => { diff --git a/__tests__/flatten.ts b/__tests__/flatten.ts index f76a5d3939..0d5cea91e8 100644 --- a/__tests__/flatten.ts +++ b/__tests__/flatten.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { Collection, fromJS, List, Range, Seq } from 'immutable'; describe('flatten', () => { diff --git a/__tests__/fromJS.ts b/__tests__/fromJS.ts index 3bddc24b64..90f70228e2 100644 --- a/__tests__/fromJS.ts +++ b/__tests__/fromJS.ts @@ -1,5 +1,5 @@ +import { describe, expect, it } from '@jest/globals'; import { runInNewContext } from 'vm'; - import { List, Map, Set, isCollection, fromJS } from 'immutable'; describe('fromJS', () => { @@ -64,6 +64,7 @@ describe('fromJS', () => { expect(isCollection(fromJS({}))).toBe(true); }); + // eslint-disable-next-line jest/expect-expect it('is iterable inside of a vm', () => { runInNewContext( ` diff --git a/__tests__/functional/get.ts b/__tests__/functional/get.ts index fdb687302b..901724f1c3 100644 --- a/__tests__/functional/get.ts +++ b/__tests__/functional/get.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { get, Map, List, Range } from 'immutable'; describe('get', () => { diff --git a/__tests__/functional/has.ts b/__tests__/functional/has.ts index ca2a7493b4..3d4f550dec 100644 --- a/__tests__/functional/has.ts +++ b/__tests__/functional/has.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { has, Map, List, Range } from 'immutable'; describe('has', () => { diff --git a/__tests__/functional/remove.ts b/__tests__/functional/remove.ts index e4c2e55632..10674c695b 100644 --- a/__tests__/functional/remove.ts +++ b/__tests__/functional/remove.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { remove, List, Map } from 'immutable'; describe('remove', () => { diff --git a/__tests__/functional/set.ts b/__tests__/functional/set.ts index d5eb40d0fb..154009880a 100644 --- a/__tests__/functional/set.ts +++ b/__tests__/functional/set.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { set } from 'immutable'; describe('set', () => { diff --git a/__tests__/functional/update.ts b/__tests__/functional/update.ts index cf29ed9bcf..0ed9042e85 100644 --- a/__tests__/functional/update.ts +++ b/__tests__/functional/update.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { update } from 'immutable'; describe('update', () => { diff --git a/__tests__/get.ts b/__tests__/get.ts index 5bed960679..7853ad30ca 100644 --- a/__tests__/get.ts +++ b/__tests__/get.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { Range } from 'immutable'; describe('get', () => { diff --git a/__tests__/getIn.ts b/__tests__/getIn.ts index 55354a9bc1..57074034c6 100644 --- a/__tests__/getIn.ts +++ b/__tests__/getIn.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { fromJS, getIn, List, Map } from 'immutable'; describe('getIn', () => { diff --git a/__tests__/groupBy.ts b/__tests__/groupBy.ts index b759661711..020a5d373a 100644 --- a/__tests__/groupBy.ts +++ b/__tests__/groupBy.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { Collection, Map, @@ -40,8 +41,10 @@ describe('groupBy', () => { expect(isOrdered(col)).toBe(constructorIsOrdered); expect(isOrdered(grouped)).toBe(constructorIsOrdered); if (constructorIsOrdered) { + // eslint-disable-next-line jest/no-conditional-expect expect(grouped).toBeInstanceOf(OrderedMap); } else { + // eslint-disable-next-line jest/no-conditional-expect expect(grouped).not.toBeInstanceOf(OrderedMap); } } diff --git a/__tests__/hasIn.ts b/__tests__/hasIn.ts index e280b99a6a..da2baa0a89 100644 --- a/__tests__/hasIn.ts +++ b/__tests__/hasIn.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { fromJS, hasIn, List, Map } from 'immutable'; describe('hasIn', () => { diff --git a/__tests__/hash.ts b/__tests__/hash.ts index 06c5fcd4bc..168ded87f1 100644 --- a/__tests__/hash.ts +++ b/__tests__/hash.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { hash } from 'immutable'; import fc from 'fast-check'; diff --git a/__tests__/interpose.ts b/__tests__/interpose.ts index 506bc513b9..a3698628af 100644 --- a/__tests__/interpose.ts +++ b/__tests__/interpose.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { Range } from 'immutable'; describe('interpose', () => { diff --git a/__tests__/issues.ts b/__tests__/issues.ts index 56ac67ced3..e283378cfc 100644 --- a/__tests__/issues.ts +++ b/__tests__/issues.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { fromJS, List, @@ -34,7 +35,7 @@ describe('Issue #1188', () => { }); }); -describe('Issue #1220 : Seq.rest() throws an exception when invoked on a single item sequence ', () => { +describe('Issue #1220 : Seq.rest() throws an exception when invoked on a single item sequence', () => { it('should be iterable', () => { // Helper for this test const ITERATOR_SYMBOL = @@ -122,15 +123,17 @@ describe('Issue #1643', () => { it(`Collection#hashCode() should handle objects that return ${label} for valueOf`, () => { const set = Set().add(new MyClass()); - set.hashCode(); + expect(() => set.hashCode()).not.toThrow(); }); }); }); describe('Issue #1785', () => { - const emptyRecord = Record({})(); + it('merge() should not return undefined', () => { + const emptyRecord = Record({})(); - expect(emptyRecord.merge({ id: 1 })).toBe(emptyRecord); + expect(emptyRecord.merge({ id: 1 })).toBe(emptyRecord); + }); }); describe('Issue #1475', () => { diff --git a/__tests__/join.ts b/__tests__/join.ts index 8b072d5c93..4d6d472835 100644 --- a/__tests__/join.ts +++ b/__tests__/join.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { Seq } from 'immutable'; import fc from 'fast-check'; diff --git a/__tests__/merge.ts b/__tests__/merge.ts index af3b0c8453..00254a4be7 100644 --- a/__tests__/merge.ts +++ b/__tests__/merge.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { fromJS, List, @@ -34,7 +35,7 @@ describe('merge', () => { const m1 = Map({ a: 1, b: 2, c: 3 }); const m2 = Map({ d: 10, b: 20, e: 30 }); // @ts-expect-error -- test that runtime does throw - expect(() => m1.mergeWith(1, m2)).toThrowError(TypeError); + expect(() => m1.mergeWith(1, m2)).toThrow(TypeError); }); it('provides key as the third argument of merge function', () => { diff --git a/__tests__/minmax.ts b/__tests__/minmax.ts index a4a23205c3..9a4c7a3c59 100644 --- a/__tests__/minmax.ts +++ b/__tests__/minmax.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { is, Seq } from 'immutable'; import fc from 'fast-check'; diff --git a/__tests__/partition.ts b/__tests__/partition.ts index 35e76e2acc..0a59b3d8ec 100644 --- a/__tests__/partition.ts +++ b/__tests__/partition.ts @@ -1,3 +1,4 @@ +import { beforeEach, describe, expect, it, jest } from '@jest/globals'; import { isAssociative, isIndexed, @@ -13,7 +14,7 @@ import { } from 'immutable'; describe('partition', () => { - let isOdd: jest.Mock; + let isOdd: jest.Mock<(x: number) => number>; beforeEach(() => { isOdd = jest.fn((x) => x % 2); diff --git a/__tests__/slice.ts b/__tests__/slice.ts index 4adc40dbda..07b763ff58 100644 --- a/__tests__/slice.ts +++ b/__tests__/slice.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { List, Range, Seq } from 'immutable'; import fc from 'fast-check'; diff --git a/__tests__/sort.ts b/__tests__/sort.ts index 8e10957f35..0a5afbf9ad 100644 --- a/__tests__/sort.ts +++ b/__tests__/sort.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { List, OrderedMap, Range, Seq } from 'immutable'; describe('sort', () => { diff --git a/__tests__/splice.ts b/__tests__/splice.ts index 519bbe906f..cb90281016 100644 --- a/__tests__/splice.ts +++ b/__tests__/splice.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { List, Range, Seq } from 'immutable'; import fc from 'fast-check'; diff --git a/__tests__/transformerProtocol.ts b/__tests__/transformerProtocol.ts index ec73153b51..c3cedb3577 100644 --- a/__tests__/transformerProtocol.ts +++ b/__tests__/transformerProtocol.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import * as t from 'transducers-js'; import { List, Map, Set, Stack } from 'immutable'; diff --git a/__tests__/ts-utils.ts b/__tests__/ts-utils.ts index c669bf99ef..d4cc759e68 100644 --- a/__tests__/ts-utils.ts +++ b/__tests__/ts-utils.ts @@ -1,3 +1,5 @@ +import { expect } from '@jest/globals'; + export function expectToBeDefined( arg: T ): asserts arg is Exclude { diff --git a/__tests__/updateIn.ts b/__tests__/updateIn.ts index 3ab735e335..1ca054f979 100644 --- a/__tests__/updateIn.ts +++ b/__tests__/updateIn.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { fromJS, List, diff --git a/__tests__/zip.ts b/__tests__/zip.ts index 67af47f8a6..4487fa1b95 100644 --- a/__tests__/zip.ts +++ b/__tests__/zip.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from '@jest/globals'; import { List, Range, Seq } from 'immutable'; import fc from 'fast-check'; import { expectToBeDefined } from './ts-utils'; diff --git a/eslint.config.mjs b/eslint.config.mjs index 1e29c04507..5f9dcd489b 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -18,7 +18,16 @@ export default tseslint.config( 'website/.next/', ], }, - { languageOptions: { globals: globals.browser } }, + { + languageOptions: { + globals: globals.browser, + + // parserOptions: { + // projectService: true, + // tsconfigRootDir: import.meta.dirname, + // }, + }, + }, pluginJs.configs.recommended, importPlugin.flatConfigs.recommended, importPlugin.flatConfigs.typescript, @@ -103,13 +112,24 @@ export default tseslint.config( }, { - // TODO might be handled by config jest files: ['__tests__/**/*', 'perf/*'], - plugins: { jest: pluginJest }, languageOptions: { globals: pluginJest.environments.globals.globals, }, + ...pluginJest.configs['flat/recommended'], + ...pluginJest.configs['flat/style'], + plugins: { jest: pluginJest }, rules: { + ...pluginJest.configs['flat/recommended'].rules, + // TODO activate style rules later + // ...pluginJest.configs['jest/style'].rules, + 'jest/expect-expect': [ + 'error', + { + assertFunctionNames: ['expect', 'expectIs', 'expectIsNot'], + additionalTestBlockFunctions: [], + }, + ], 'import/no-unresolved': [ 'error', { @@ -119,10 +139,9 @@ export default tseslint.config( }, }, { - // // TODO might be handled by config jest - // files: ['perf/*'], + files: ['perf/*'], rules: { - // 'no-undef': 'off', + 'jest/expect-expect': 'off', 'no-redeclare': 'off', 'no-var': 'off', 'prefer-arrow-callback': 'off', diff --git a/jest.config.js b/jest.config.mjs similarity index 70% rename from jest.config.js rename to jest.config.mjs index b1b92a65c6..1aaace83c6 100644 --- a/jest.config.js +++ b/jest.config.mjs @@ -1,5 +1,5 @@ -// eslint-disable-next-line no-undef -module.exports = { +/** @type {import('jest').Config} */ +const config = { moduleFileExtensions: ['js', 'ts'], resolver: '/resources/jestResolver.js', transform: { @@ -7,5 +7,6 @@ module.exports = { }, testRegex: '/__tests__/.*\\.(ts|js)$', testPathIgnorePatterns: ['/__tests__/ts-utils.ts'], - unmockedModulePathPatterns: ['./node_modules/react'], }; + +export default config; diff --git a/package-lock.json b/package-lock.json index 6cc73d8569..c8a9f2df0b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "MIT", "devDependencies": { "@eslint/js": "^9.20.0", + "@jest/globals": "^29.7.0", "@rollup/plugin-buble": "1.0.3", "@rollup/plugin-commonjs": "28.0.2", "@rollup/plugin-json": "6.1.0", @@ -17,7 +18,6 @@ "@rollup/plugin-typescript": "^12.1.2", "@size-limit/esbuild-why": "^11.2.0", "@size-limit/preset-small-lib": "^11.2.0", - "@types/jest": "^29.0.0", "@types/prismjs": "^1.26.3", "@types/random-seed": "0.3.5", "@types/react": "17.0.11", @@ -50,6 +50,7 @@ "rollup": "4.34.8", "size-limit": "^11.2.0", "transducers-js": "0.4.174", + "ts-node": "^10.9.2", "tslib": "^2.8.1", "tstyche": "^3.5", "typescript": "5.7", @@ -585,6 +586,30 @@ "integrity": "sha512-N8uEMrMPL0cu/bdboEWpQYb/0i2K5Qn8eCsxzOmxSggJbbQte7ljMRoXm917AbntqTGOzdTu+vP3KOOzoC70HQ==", "dev": true }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.25.1", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.1.tgz", @@ -1451,38 +1476,41 @@ } }, "node_modules/@jest/environment": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.6.4.tgz", - "integrity": "sha512-sQ0SULEjA1XUTHmkBRl7A1dyITM9yb1yb3ZNKPX3KlTd6IG7mWUe3e2yfExtC2Zz1Q+mMckOLHmL/qLiuQJrBQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/fake-timers": "^29.6.4", + "@jest/fake-timers": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^29.6.3" + "jest-mock": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.6.4.tgz", - "integrity": "sha512-Warhsa7d23+3X5bLbrbYvaehcgX5TLYhI03JKoedTiI8uJU4IhqYBWF7OSSgUyz4IgLpUYPkK0AehA5/fRclAA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", "dev": true, + "license": "MIT", "dependencies": { - "expect": "^29.6.4", - "jest-snapshot": "^29.6.4" + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect-utils": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.6.4.tgz", - "integrity": "sha512-FEhkJhqtvBwgSpiTrocquJCdXPsyvNKcl/n7A3u7X4pVoF4bswm11c9d4AV+kfq2Gpv/mM8x7E7DsRvH+djkrg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", "dev": true, + "license": "MIT", "dependencies": { "jest-get-type": "^29.6.3" }, @@ -1491,32 +1519,34 @@ } }, "node_modules/@jest/fake-timers": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.6.4.tgz", - "integrity": "sha512-6UkCwzoBK60edXIIWb0/KWkuj7R7Qq91vVInOe3De6DSpaEiqjKcJw4F7XUet24Wupahj9J6PlR09JqJ5ySDHw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, + "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", - "jest-message-util": "^29.6.3", - "jest-mock": "^29.6.3", - "jest-util": "^29.6.3" + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/globals": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.6.4.tgz", - "integrity": "sha512-wVIn5bdtjlChhXAzVXavcY/3PEjf4VqM174BM3eGL5kMxLiZD5CLnbmkEyA1Dwh9q8XjP6E8RwjBsY/iCWrWsA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/environment": "^29.6.4", - "@jest/expect": "^29.6.4", + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", "@jest/types": "^29.6.3", - "jest-mock": "^29.6.3" + "jest-mock": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -1652,10 +1682,11 @@ } }, "node_modules/@jest/transform": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.6.4.tgz", - "integrity": "sha512-8thgRSiXUqtr/pPGY/OsyHuMjGyhVnWrFAwoxmIemlBuiMyU1WFs0tXoNxzcr4A4uErs/ABre76SGmrr5ab/AA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/core": "^7.11.6", "@jest/types": "^29.6.3", @@ -1665,9 +1696,9 @@ "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.4", + "jest-haste-map": "^29.7.0", "jest-regex-util": "^29.6.3", - "jest-util": "^29.6.3", + "jest-util": "^29.7.0", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", @@ -2673,6 +2704,34 @@ "node": ">= 10" } }, + "node_modules/@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/babel__core": { "version": "7.20.1", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz", @@ -2770,16 +2829,6 @@ "@types/istanbul-lib-report": "*" } }, - "node_modules/@types/jest": { - "version": "29.5.4", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.4.tgz", - "integrity": "sha512-PhglGmhWeD46FYOVLt3X7TiWjzwuVGW9wG/4qocPevXMjCmrIc5b6db9WjeGE4QYVpUAWMDv3v0IiBwObY289A==", - "dev": true, - "dependencies": { - "expect": "^29.0.0", - "pretty-format": "^29.0.0" - } - }, "node_modules/@types/jsdom": { "version": "20.0.1", "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz", @@ -3371,6 +3420,13 @@ "node": ">= 8" } }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "license": "MIT" + }, "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -4212,6 +4268,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "license": "MIT" + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -4466,11 +4529,22 @@ "node": ">=8" } }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/diff-sequences": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, + "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -5437,16 +5511,17 @@ } }, "node_modules/expect": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.6.4.tgz", - "integrity": "sha512-F2W2UyQ8XYyftHT57dtfg8Ue3X5qLgm2sSug0ivvLRH/VKNRL/pDxg/TH7zVzbQB0tu80clNFy6LU7OS/VSEKA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/expect-utils": "^29.6.4", + "@jest/expect-utils": "^29.7.0", "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.6.4", - "jest-message-util": "^29.6.3", - "jest-util": "^29.6.3" + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -7076,15 +7151,16 @@ } }, "node_modules/jest-diff": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.4.tgz", - "integrity": "sha512-9F48UxR9e4XOEZvoUXEHSWY4qC4zERJaOfrbBg9JpbJOO43R1vN76REt/aMGZoY6GD5g84nnJiBIVlscegefpw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^4.0.0", "diff-sequences": "^29.6.3", "jest-get-type": "^29.6.3", - "pretty-format": "^29.6.3" + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -7172,10 +7248,11 @@ } }, "node_modules/jest-haste-map": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.6.4.tgz", - "integrity": "sha512-12Ad+VNTDHxKf7k+M65sviyynRoZYuL1/GTuhEVb8RYsNSNln71nANRb/faSyWvx0j+gHcivChXHIoMJrGYjog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, + "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", "@types/graceful-fs": "^4.1.3", @@ -7184,8 +7261,8 @@ "fb-watchman": "^2.0.0", "graceful-fs": "^4.2.9", "jest-regex-util": "^29.6.3", - "jest-util": "^29.6.3", - "jest-worker": "^29.6.4", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "micromatch": "^4.0.4", "walker": "^1.0.8" }, @@ -7210,25 +7287,27 @@ } }, "node_modules/jest-matcher-utils": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.6.4.tgz", - "integrity": "sha512-KSzwyzGvK4HcfnserYqJHYi7sZVqdREJ9DMPAKVbS98JsIAvumihaNUbjrWw0St7p9IY7A9UskCW5MYlGmBQFQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^4.0.0", - "jest-diff": "^29.6.4", + "jest-diff": "^29.7.0", "jest-get-type": "^29.6.3", - "pretty-format": "^29.6.3" + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-message-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.6.3.tgz", - "integrity": "sha512-FtzaEEHzjDpQp51HX4UMkPZjy46ati4T5pEMyM6Ik48ztu4T9LQplZ6OsimHx7EuM9dfEh5HJa6D3trEftu3dA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.12.13", "@jest/types": "^29.6.3", @@ -7236,7 +7315,7 @@ "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^29.6.3", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, @@ -7245,14 +7324,15 @@ } }, "node_modules/jest-mock": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.6.3.tgz", - "integrity": "sha512-Z7Gs/mOyTSR4yPsaZ72a/MtuK6RnC3JYqWONe48oLaoEcYwEDxqvbXz85G4SJrm2Z5Ar9zp6MiHF4AlFlRM4Pg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, + "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", - "jest-util": "^29.6.3" + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -7393,30 +7473,31 @@ } }, "node_modules/jest-snapshot": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.6.4.tgz", - "integrity": "sha512-VC1N8ED7+4uboUKGIDsbvNAZb6LakgIPgAF4RSpF13dN6YaMokfRqO+BaqK4zIh6X3JffgwbzuGqDEjHm/MrvA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/core": "^7.11.6", "@babel/generator": "^7.7.2", "@babel/plugin-syntax-jsx": "^7.7.2", "@babel/plugin-syntax-typescript": "^7.7.2", "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.6.4", - "@jest/transform": "^29.6.4", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^29.6.4", + "expect": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-diff": "^29.6.4", + "jest-diff": "^29.7.0", "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.6.4", - "jest-message-util": "^29.6.3", - "jest-util": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "natural-compare": "^1.4.0", - "pretty-format": "^29.6.3", + "pretty-format": "^29.7.0", "semver": "^7.5.3" }, "engines": { @@ -7437,10 +7518,11 @@ } }, "node_modules/jest-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.3.tgz", - "integrity": "sha512-QUjna/xSy4B32fzcKTSz1w7YYzgiHrjjJjevdRf61HYk998R5vVMMNmrHESYZVDS5DSWs+1srPLPKxXPkeSDOA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, + "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -7502,13 +7584,14 @@ } }, "node_modules/jest-worker": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.4.tgz", - "integrity": "sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*", - "jest-util": "^29.6.3", + "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, @@ -7887,6 +7970,13 @@ "sourcemap-codec": "^1.4.8" } }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "license": "ISC" + }, "node_modules/make-synchronous": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/make-synchronous/-/make-synchronous-0.1.1.tgz", @@ -8973,10 +9063,11 @@ } }, "node_modules/pretty-format": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.3.tgz", - "integrity": "sha512-ZsBgjVhFAj5KeK+nHfF1305/By3lechHQSMWCTl8iHSbfOm2TN5nHEtFc/+W7fAyUeCs2n5iow72gld4gW0xDw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, + "license": "MIT", "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -10315,6 +10406,63 @@ "typescript": ">=4.8.4" } }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -10641,6 +10789,13 @@ "requires-port": "^1.0.0" } }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "license": "MIT" + }, "node_modules/v8-to-istanbul": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", @@ -10966,6 +11121,16 @@ "node": ">=12" } }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -11358,6 +11523,27 @@ "integrity": "sha512-N8uEMrMPL0cu/bdboEWpQYb/0i2K5Qn8eCsxzOmxSggJbbQte7ljMRoXm917AbntqTGOzdTu+vP3KOOzoC70HQ==", "dev": true }, + "@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "dependencies": { + "@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + } + } + }, "@esbuild/aix-ppc64": { "version": "0.25.1", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.1.tgz", @@ -11832,60 +12018,60 @@ } }, "@jest/environment": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.6.4.tgz", - "integrity": "sha512-sQ0SULEjA1XUTHmkBRl7A1dyITM9yb1yb3ZNKPX3KlTd6IG7mWUe3e2yfExtC2Zz1Q+mMckOLHmL/qLiuQJrBQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, "requires": { - "@jest/fake-timers": "^29.6.4", + "@jest/fake-timers": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^29.6.3" + "jest-mock": "^29.7.0" } }, "@jest/expect": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.6.4.tgz", - "integrity": "sha512-Warhsa7d23+3X5bLbrbYvaehcgX5TLYhI03JKoedTiI8uJU4IhqYBWF7OSSgUyz4IgLpUYPkK0AehA5/fRclAA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", "dev": true, "requires": { - "expect": "^29.6.4", - "jest-snapshot": "^29.6.4" + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" } }, "@jest/expect-utils": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.6.4.tgz", - "integrity": "sha512-FEhkJhqtvBwgSpiTrocquJCdXPsyvNKcl/n7A3u7X4pVoF4bswm11c9d4AV+kfq2Gpv/mM8x7E7DsRvH+djkrg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", "dev": true, "requires": { "jest-get-type": "^29.6.3" } }, "@jest/fake-timers": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.6.4.tgz", - "integrity": "sha512-6UkCwzoBK60edXIIWb0/KWkuj7R7Qq91vVInOe3De6DSpaEiqjKcJw4F7XUet24Wupahj9J6PlR09JqJ5ySDHw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, "requires": { "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", - "jest-message-util": "^29.6.3", - "jest-mock": "^29.6.3", - "jest-util": "^29.6.3" + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" } }, "@jest/globals": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.6.4.tgz", - "integrity": "sha512-wVIn5bdtjlChhXAzVXavcY/3PEjf4VqM174BM3eGL5kMxLiZD5CLnbmkEyA1Dwh9q8XjP6E8RwjBsY/iCWrWsA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, "requires": { - "@jest/environment": "^29.6.4", - "@jest/expect": "^29.6.4", + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", "@jest/types": "^29.6.3", - "jest-mock": "^29.6.3" + "jest-mock": "^29.7.0" } }, "@jest/reporters": { @@ -11986,9 +12172,9 @@ } }, "@jest/transform": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.6.4.tgz", - "integrity": "sha512-8thgRSiXUqtr/pPGY/OsyHuMjGyhVnWrFAwoxmIemlBuiMyU1WFs0tXoNxzcr4A4uErs/ABre76SGmrr5ab/AA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "requires": { "@babel/core": "^7.11.6", @@ -11999,9 +12185,9 @@ "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.4", + "jest-haste-map": "^29.7.0", "jest-regex-util": "^29.6.3", - "jest-util": "^29.6.3", + "jest-util": "^29.7.0", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", @@ -12597,6 +12783,30 @@ "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, + "@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, "@types/babel__core": { "version": "7.20.1", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz", @@ -12692,16 +12902,6 @@ "@types/istanbul-lib-report": "*" } }, - "@types/jest": { - "version": "29.5.4", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.4.tgz", - "integrity": "sha512-PhglGmhWeD46FYOVLt3X7TiWjzwuVGW9wG/4qocPevXMjCmrIc5b6db9WjeGE4QYVpUAWMDv3v0IiBwObY289A==", - "dev": true, - "requires": { - "expect": "^29.0.0", - "pretty-format": "^29.0.0" - } - }, "@types/jsdom": { "version": "20.0.1", "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz", @@ -13104,6 +13304,12 @@ "picomatch": "^2.0.4" } }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -13675,6 +13881,12 @@ "meow": "^12.0.1" } }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, "cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -13846,6 +14058,12 @@ "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, "diff-sequences": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", @@ -14519,16 +14737,16 @@ "dev": true }, "expect": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.6.4.tgz", - "integrity": "sha512-F2W2UyQ8XYyftHT57dtfg8Ue3X5qLgm2sSug0ivvLRH/VKNRL/pDxg/TH7zVzbQB0tu80clNFy6LU7OS/VSEKA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, "requires": { - "@jest/expect-utils": "^29.6.4", + "@jest/expect-utils": "^29.7.0", "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.6.4", - "jest-message-util": "^29.6.3", - "jest-util": "^29.6.3" + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" } }, "fast-check": { @@ -15602,15 +15820,15 @@ } }, "jest-diff": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.4.tgz", - "integrity": "sha512-9F48UxR9e4XOEZvoUXEHSWY4qC4zERJaOfrbBg9JpbJOO43R1vN76REt/aMGZoY6GD5g84nnJiBIVlscegefpw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "requires": { "chalk": "^4.0.0", "diff-sequences": "^29.6.3", "jest-get-type": "^29.6.3", - "pretty-format": "^29.6.3" + "pretty-format": "^29.7.0" } }, "jest-docblock": { @@ -15672,9 +15890,9 @@ "dev": true }, "jest-haste-map": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.6.4.tgz", - "integrity": "sha512-12Ad+VNTDHxKf7k+M65sviyynRoZYuL1/GTuhEVb8RYsNSNln71nANRb/faSyWvx0j+gHcivChXHIoMJrGYjog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, "requires": { "@jest/types": "^29.6.3", @@ -15685,8 +15903,8 @@ "fsevents": "^2.3.2", "graceful-fs": "^4.2.9", "jest-regex-util": "^29.6.3", - "jest-util": "^29.6.3", - "jest-worker": "^29.6.4", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "micromatch": "^4.0.4", "walker": "^1.0.8" } @@ -15702,21 +15920,21 @@ } }, "jest-matcher-utils": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.6.4.tgz", - "integrity": "sha512-KSzwyzGvK4HcfnserYqJHYi7sZVqdREJ9DMPAKVbS98JsIAvumihaNUbjrWw0St7p9IY7A9UskCW5MYlGmBQFQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "requires": { "chalk": "^4.0.0", - "jest-diff": "^29.6.4", + "jest-diff": "^29.7.0", "jest-get-type": "^29.6.3", - "pretty-format": "^29.6.3" + "pretty-format": "^29.7.0" } }, "jest-message-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.6.3.tgz", - "integrity": "sha512-FtzaEEHzjDpQp51HX4UMkPZjy46ati4T5pEMyM6Ik48ztu4T9LQplZ6OsimHx7EuM9dfEh5HJa6D3trEftu3dA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "requires": { "@babel/code-frame": "^7.12.13", @@ -15725,20 +15943,20 @@ "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^29.6.3", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" } }, "jest-mock": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.6.3.tgz", - "integrity": "sha512-Z7Gs/mOyTSR4yPsaZ72a/MtuK6RnC3JYqWONe48oLaoEcYwEDxqvbXz85G4SJrm2Z5Ar9zp6MiHF4AlFlRM4Pg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "requires": { "@jest/types": "^29.6.3", "@types/node": "*", - "jest-util": "^29.6.3" + "jest-util": "^29.7.0" } }, "jest-pnp-resolver": { @@ -15853,9 +16071,9 @@ } }, "jest-snapshot": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.6.4.tgz", - "integrity": "sha512-VC1N8ED7+4uboUKGIDsbvNAZb6LakgIPgAF4RSpF13dN6YaMokfRqO+BaqK4zIh6X3JffgwbzuGqDEjHm/MrvA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "requires": { "@babel/core": "^7.11.6", @@ -15863,20 +16081,20 @@ "@babel/plugin-syntax-jsx": "^7.7.2", "@babel/plugin-syntax-typescript": "^7.7.2", "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.6.4", - "@jest/transform": "^29.6.4", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^29.6.4", + "expect": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-diff": "^29.6.4", + "jest-diff": "^29.7.0", "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.6.4", - "jest-message-util": "^29.6.3", - "jest-util": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "natural-compare": "^1.4.0", - "pretty-format": "^29.6.3", + "pretty-format": "^29.7.0", "semver": "^7.5.3" }, "dependencies": { @@ -15889,9 +16107,9 @@ } }, "jest-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.3.tgz", - "integrity": "sha512-QUjna/xSy4B32fzcKTSz1w7YYzgiHrjjJjevdRf61HYk998R5vVMMNmrHESYZVDS5DSWs+1srPLPKxXPkeSDOA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "requires": { "@jest/types": "^29.6.3", @@ -15941,13 +16159,13 @@ } }, "jest-worker": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.4.tgz", - "integrity": "sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "requires": { "@types/node": "*", - "jest-util": "^29.6.3", + "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, @@ -16224,6 +16442,12 @@ "sourcemap-codec": "^1.4.8" } }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, "make-synchronous": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/make-synchronous/-/make-synchronous-0.1.1.tgz", @@ -16938,9 +17162,9 @@ "dev": true }, "pretty-format": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.3.tgz", - "integrity": "sha512-ZsBgjVhFAj5KeK+nHfF1305/By3lechHQSMWCTl8iHSbfOm2TN5nHEtFc/+W7fAyUeCs2n5iow72gld4gW0xDw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "requires": { "@jest/schemas": "^29.6.3", @@ -17874,6 +18098,35 @@ "dev": true, "requires": {} }, + "ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "requires": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "dependencies": { + "acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "dev": true + } + } + }, "tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -18079,6 +18332,12 @@ "requires-port": "^1.0.0" } }, + "v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, "v8-to-istanbul": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", @@ -18313,6 +18572,12 @@ } } }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true + }, "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index 1ca444cd5c..81a29d64cb 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,7 @@ }, "devDependencies": { "@eslint/js": "^9.20.0", + "@jest/globals": "^29.7.0", "@rollup/plugin-buble": "1.0.3", "@rollup/plugin-commonjs": "28.0.2", "@rollup/plugin-json": "6.1.0", @@ -91,7 +92,6 @@ "@rollup/plugin-typescript": "^12.1.2", "@size-limit/esbuild-why": "^11.2.0", "@size-limit/preset-small-lib": "^11.2.0", - "@types/jest": "^29.0.0", "@types/prismjs": "^1.26.3", "@types/random-seed": "0.3.5", "@types/react": "17.0.11", @@ -124,6 +124,7 @@ "rollup": "4.34.8", "size-limit": "^11.2.0", "transducers-js": "0.4.174", + "ts-node": "^10.9.2", "tslib": "^2.8.1", "tstyche": "^3.5", "typescript": "5.7", diff --git a/perf/List.js b/perf/List.js index 6b714a860c..375155e46d 100644 --- a/perf/List.js +++ b/perf/List.js @@ -103,7 +103,7 @@ describe('List', function () { }); describe('some', function () { - it('100 000 items ', () => { + it('100 000 items', () => { const list = Immutable.List(); for (let i = 0; i < 100000; i++) { list.push(i); diff --git a/website/src/MarkdownContent.tsx b/website/src/MarkdownContent.tsx index ccb970d4d3..7f90fca400 100644 --- a/website/src/MarkdownContent.tsx +++ b/website/src/MarkdownContent.tsx @@ -8,6 +8,7 @@ type Props = { className?: string; }; +// eslint-disable-next-line prefer-arrow-callback export const MarkdownContent = memo(function MarkdownContent({ contents, className, From 110acb0dcd10368c90894f2c5599e1eff33881c7 Mon Sep 17 00:00:00 2001 From: Julien Deniau <1398469+jdeniau@users.noreply.github.com> Date: Wed, 2 Apr 2025 20:07:32 +0200 Subject: [PATCH 13/59] Create SECURITY.md --- SECURITY.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..a1fdc82e73 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,17 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +You can send an email to julien@deniau.me to report a security vulnerability. +Please be as specific as possible on how to reproduce and understand the issue. This way, we can fix the issue as fast as possible. + +I will try to reply to you in the following days (it might be sometime longer depending on my personal life). From 7ace62912df4a4b024c3ceeb3cf24e1025d7768f Mon Sep 17 00:00:00 2001 From: Julien Deniau <1398469+jdeniau@users.noreply.github.com> Date: Sun, 6 Apr 2025 18:45:59 +0200 Subject: [PATCH 14/59] Add a playground / repl in the documentation (#2089) * working test page of REPL * Working draft of the REPL * add "/play" page * style * remove debug page * remove wrongly commited file * rename file * fix lint --- .gitignore | 1 + package-lock.json | 400 ++++++++++++++++++ package.json | 7 + website/src/Header.tsx | 1 + .../src/app/docs/[version]/test/page.tsx.bak | 109 ----- website/src/app/play/layout.tsx | 21 + website/src/app/play/page.tsx | 46 ++ website/src/repl/Editor.tsx | 55 +++ website/src/repl/FormatterOutput.tsx | 43 ++ website/src/repl/Repl.tsx | 159 +++++++ website/src/repl/repl.css | 40 ++ website/styles/globals.css | 5 + 12 files changed, 778 insertions(+), 109 deletions(-) delete mode 100644 website/src/app/docs/[version]/test/page.tsx.bak create mode 100644 website/src/app/play/layout.tsx create mode 100644 website/src/app/play/page.tsx create mode 100644 website/src/repl/Editor.tsx create mode 100644 website/src/repl/FormatterOutput.tsx create mode 100644 website/src/repl/Repl.tsx create mode 100644 website/src/repl/repl.css diff --git a/.gitignore b/.gitignore index a7a99033e4..972b88d8e1 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ TODO /gh-pages /npm /dist +/coverage \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c8a9f2df0b..163ed16800 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,11 @@ "version": "5.1.1", "license": "MIT", "devDependencies": { + "@codemirror/commands": "^6.8.1", + "@codemirror/lang-javascript": "^6.2.3", + "@codemirror/state": "^6.5.2", + "@codemirror/theme-one-dark": "^6.1.2", + "@codemirror/view": "^6.36.5", "@eslint/js": "^9.20.0", "@jest/globals": "^29.7.0", "@rollup/plugin-buble": "1.0.3", @@ -22,6 +27,7 @@ "@types/random-seed": "0.3.5", "@types/react": "17.0.11", "benchmark": "2.1.4", + "codemirror": "^6.0.1", "colors": "1.4.0", "cpy-cli": "^5.0.0", "eslint": "^9.20.1", @@ -34,6 +40,7 @@ "globals": "^15.15.0", "jest": "^29.0.0", "jest-environment-jsdom": "^29.6.4", + "jsonml-html": "^1.1.0", "make-synchronous": "0.1.1", "marked": "^11.2.0", "marked-highlight": "^2.1.0", @@ -580,6 +587,122 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@codemirror/autocomplete": { + "version": "6.18.6", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.6.tgz", + "integrity": "sha512-PHHBXFomUs5DF+9tCOM/UoW6XQ4R44lLNNhRaW9PKPTU0D7lIjRg3ElxaJnTwsl/oHiR93WSXDBrekhoUGCPtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@codemirror/commands": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.8.1.tgz", + "integrity": "sha512-KlGVYufHMQzxbdQONiLyGQDUW0itrLZwq3CcY7xpv9ZLRHqzkBSoteocBHtMCoY7/Ci4xhzSrToIeLg7FxHuaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.4.0", + "@codemirror/view": "^6.27.0", + "@lezer/common": "^1.1.0" + } + }, + "node_modules/@codemirror/lang-javascript": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.2.3.tgz", + "integrity": "sha512-8PR3vIWg7pSu7ur8A07pGiYHgy3hHj+mRYRCSG8q+mPIrl0F02rgpGv+DsQTHRTc30rydOsf5PZ7yjKFg2Ackw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/language": "^6.6.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0", + "@lezer/javascript": "^1.0.0" + } + }, + "node_modules/@codemirror/language": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.11.0.tgz", + "integrity": "sha512-A7+f++LodNNc1wGgoRDTt78cOwWm9KVezApgjOMp1W4hM0898nsqBXwF+sbePE7ZRcjN7Sa1Z5m2oN27XkmEjQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.23.0", + "@lezer/common": "^1.1.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0", + "style-mod": "^4.0.0" + } + }, + "node_modules/@codemirror/lint": { + "version": "6.8.5", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.5.tgz", + "integrity": "sha512-s3n3KisH7dx3vsoeGMxsbRAgKe4O1vbrnKBClm99PU0fWxmxsx5rR2PfqQgIt+2MMJBHbiJ5rfIdLYfB9NNvsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.35.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/search": { + "version": "6.5.10", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.10.tgz", + "integrity": "sha512-RMdPdmsrUf53pb2VwflKGHEe1XVM07hI7vV2ntgw1dmqhimpatSJKva4VA9h4TLUDOD4EIF02201oZurpnEFsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/state": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.2.tgz", + "integrity": "sha512-FVqsPqtPWKVVL3dPSxy8wEF/ymIEuVzF1PK3VbUgrxXpJUSHQWWZz4JMToquRxnkw+36LTamCZG2iua2Ptq0fA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@marijn/find-cluster-break": "^1.0.0" + } + }, + "node_modules/@codemirror/theme-one-dark": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@codemirror/theme-one-dark/-/theme-one-dark-6.1.2.tgz", + "integrity": "sha512-F+sH0X16j/qFLMAfbciKTxVOwkdAS336b7AXTKOZhy8BR3eH/RelsnLgLFINrpST63mmN2OuwUt0W2ndUgYwUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/highlight": "^1.0.0" + } + }, + "node_modules/@codemirror/view": { + "version": "6.36.5", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.36.5.tgz", + "integrity": "sha512-cd+FZEUlu3GQCYnguYm3EkhJ8KJVisqqUsCOKedBoAt/d9c76JUUap6U0UrpElln5k6VyrEOYliMuDAKIeDQLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.5.0", + "style-mod": "^4.1.0", + "w3c-keyname": "^2.2.4" + } + }, "node_modules/@corex/deepmerge": { "version": "4.0.43", "resolved": "https://registry.npmjs.org/@corex/deepmerge/-/deepmerge-4.0.43.tgz", @@ -1793,6 +1916,52 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@lezer/common": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.3.tgz", + "integrity": "sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@lezer/highlight": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.1.tgz", + "integrity": "sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@lezer/javascript": { + "version": "1.4.21", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.21.tgz", + "integrity": "sha512-lL+1fcuxWYPURMM/oFZLEDm0XuLN128QPV+VuGtKpeaOGdcl9F2LYC3nh1S9LkPqx9M0mndZFdXCipNAZpzIkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.2.0", + "@lezer/highlight": "^1.1.3", + "@lezer/lr": "^1.3.0" + } + }, + "node_modules/@lezer/lr": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.2.tgz", + "integrity": "sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@marijn/find-cluster-break": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.2.tgz", + "integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==", + "dev": true, + "license": "MIT" + }, "node_modules/@next/env": { "version": "14.2.26", "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.26.tgz", @@ -4105,6 +4274,22 @@ "node": ">= 0.12.0" } }, + "node_modules/codemirror": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz", + "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + } + }, "node_modules/collect-v8-coverage": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", @@ -4275,6 +4460,13 @@ "dev": true, "license": "MIT" }, + "node_modules/crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", + "dev": true, + "license": "MIT" + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -7804,6 +7996,13 @@ "node": ">=6" } }, + "node_modules/jsonml-html": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsonml-html/-/jsonml-html-1.1.0.tgz", + "integrity": "sha512-L3aCxuWRalEKY/8krm1gDhjq9yTfmzoBaoiULgnMY+mAamCiKfeV/ilLcMv+bxdzb8ZgI9VjaSPBwrTTxgpF6Q==", + "dev": true, + "license": "ISC" + }, "node_modules/jsx-ast-utils": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", @@ -10179,6 +10378,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/style-mod": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz", + "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==", + "dev": true, + "license": "MIT" + }, "node_modules/styled-jsx": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", @@ -10820,6 +11026,13 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/w3c-keyname": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", + "dev": true, + "license": "MIT" + }, "node_modules/w3c-xmlserializer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", @@ -11517,6 +11730,113 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "@codemirror/autocomplete": { + "version": "6.18.6", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.6.tgz", + "integrity": "sha512-PHHBXFomUs5DF+9tCOM/UoW6XQ4R44lLNNhRaW9PKPTU0D7lIjRg3ElxaJnTwsl/oHiR93WSXDBrekhoUGCPtg==", + "dev": true, + "requires": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0" + } + }, + "@codemirror/commands": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.8.1.tgz", + "integrity": "sha512-KlGVYufHMQzxbdQONiLyGQDUW0itrLZwq3CcY7xpv9ZLRHqzkBSoteocBHtMCoY7/Ci4xhzSrToIeLg7FxHuaw==", + "dev": true, + "requires": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.4.0", + "@codemirror/view": "^6.27.0", + "@lezer/common": "^1.1.0" + } + }, + "@codemirror/lang-javascript": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.2.3.tgz", + "integrity": "sha512-8PR3vIWg7pSu7ur8A07pGiYHgy3hHj+mRYRCSG8q+mPIrl0F02rgpGv+DsQTHRTc30rydOsf5PZ7yjKFg2Ackw==", + "dev": true, + "requires": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/language": "^6.6.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0", + "@lezer/javascript": "^1.0.0" + } + }, + "@codemirror/language": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.11.0.tgz", + "integrity": "sha512-A7+f++LodNNc1wGgoRDTt78cOwWm9KVezApgjOMp1W4hM0898nsqBXwF+sbePE7ZRcjN7Sa1Z5m2oN27XkmEjQ==", + "dev": true, + "requires": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.23.0", + "@lezer/common": "^1.1.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0", + "style-mod": "^4.0.0" + } + }, + "@codemirror/lint": { + "version": "6.8.5", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.5.tgz", + "integrity": "sha512-s3n3KisH7dx3vsoeGMxsbRAgKe4O1vbrnKBClm99PU0fWxmxsx5rR2PfqQgIt+2MMJBHbiJ5rfIdLYfB9NNvsA==", + "dev": true, + "requires": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.35.0", + "crelt": "^1.0.5" + } + }, + "@codemirror/search": { + "version": "6.5.10", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.10.tgz", + "integrity": "sha512-RMdPdmsrUf53pb2VwflKGHEe1XVM07hI7vV2ntgw1dmqhimpatSJKva4VA9h4TLUDOD4EIF02201oZurpnEFsg==", + "dev": true, + "requires": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "@codemirror/state": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.2.tgz", + "integrity": "sha512-FVqsPqtPWKVVL3dPSxy8wEF/ymIEuVzF1PK3VbUgrxXpJUSHQWWZz4JMToquRxnkw+36LTamCZG2iua2Ptq0fA==", + "dev": true, + "requires": { + "@marijn/find-cluster-break": "^1.0.0" + } + }, + "@codemirror/theme-one-dark": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@codemirror/theme-one-dark/-/theme-one-dark-6.1.2.tgz", + "integrity": "sha512-F+sH0X16j/qFLMAfbciKTxVOwkdAS336b7AXTKOZhy8BR3eH/RelsnLgLFINrpST63mmN2OuwUt0W2ndUgYwUA==", + "dev": true, + "requires": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/highlight": "^1.0.0" + } + }, + "@codemirror/view": { + "version": "6.36.5", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.36.5.tgz", + "integrity": "sha512-cd+FZEUlu3GQCYnguYm3EkhJ8KJVisqqUsCOKedBoAt/d9c76JUUap6U0UrpElln5k6VyrEOYliMuDAKIeDQLg==", + "dev": true, + "requires": { + "@codemirror/state": "^6.5.0", + "style-mod": "^4.1.0", + "w3c-keyname": "^2.2.4" + } + }, "@corex/deepmerge": { "version": "4.0.43", "resolved": "https://registry.npmjs.org/@corex/deepmerge/-/deepmerge-4.0.43.tgz", @@ -12265,6 +12585,47 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "@lezer/common": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.3.tgz", + "integrity": "sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA==", + "dev": true + }, + "@lezer/highlight": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.1.tgz", + "integrity": "sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==", + "dev": true, + "requires": { + "@lezer/common": "^1.0.0" + } + }, + "@lezer/javascript": { + "version": "1.4.21", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.21.tgz", + "integrity": "sha512-lL+1fcuxWYPURMM/oFZLEDm0XuLN128QPV+VuGtKpeaOGdcl9F2LYC3nh1S9LkPqx9M0mndZFdXCipNAZpzIkQ==", + "dev": true, + "requires": { + "@lezer/common": "^1.2.0", + "@lezer/highlight": "^1.1.3", + "@lezer/lr": "^1.3.0" + } + }, + "@lezer/lr": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.2.tgz", + "integrity": "sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==", + "dev": true, + "requires": { + "@lezer/common": "^1.0.0" + } + }, + "@marijn/find-cluster-break": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.2.tgz", + "integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==", + "dev": true + }, "@next/env": { "version": "14.2.26", "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.26.tgz", @@ -13763,6 +14124,21 @@ "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "dev": true }, + "codemirror": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz", + "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==", + "dev": true, + "requires": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + } + }, "collect-v8-coverage": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", @@ -13887,6 +14263,12 @@ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, + "crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", + "dev": true + }, "cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -16322,6 +16704,12 @@ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, + "jsonml-html": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsonml-html/-/jsonml-html-1.1.0.tgz", + "integrity": "sha512-L3aCxuWRalEKY/8krm1gDhjq9yTfmzoBaoiULgnMY+mAamCiKfeV/ilLcMv+bxdzb8ZgI9VjaSPBwrTTxgpF6Q==", + "dev": true + }, "jsx-ast-utils": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", @@ -17951,6 +18339,12 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, + "style-mod": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz", + "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==", + "dev": true + }, "styled-jsx": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", @@ -18359,6 +18753,12 @@ "spdx-expression-parse": "^3.0.0" } }, + "w3c-keyname": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", + "dev": true + }, "w3c-xmlserializer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", diff --git a/package.json b/package.json index 81a29d64cb..d96af9c361 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,11 @@ "trailingComma": "es5" }, "devDependencies": { + "@codemirror/commands": "^6.8.1", + "@codemirror/lang-javascript": "^6.2.3", + "@codemirror/state": "^6.5.2", + "@codemirror/theme-one-dark": "^6.1.2", + "@codemirror/view": "^6.36.5", "@eslint/js": "^9.20.0", "@jest/globals": "^29.7.0", "@rollup/plugin-buble": "1.0.3", @@ -96,6 +101,7 @@ "@types/random-seed": "0.3.5", "@types/react": "17.0.11", "benchmark": "2.1.4", + "codemirror": "^6.0.1", "colors": "1.4.0", "cpy-cli": "^5.0.0", "eslint": "^9.20.1", @@ -108,6 +114,7 @@ "globals": "^15.15.0", "jest": "^29.0.0", "jest-environment-jsdom": "^29.6.4", + "jsonml-html": "^1.1.0", "make-synchronous": "0.1.1", "marked": "^11.2.0", "marked-highlight": "^2.1.0", diff --git a/website/src/Header.tsx b/website/src/Header.tsx index e2ba1584ad..b8e8b67d9e 100644 --- a/website/src/Header.tsx +++ b/website/src/Header.tsx @@ -109,6 +109,7 @@ export function HeaderLinks({ return (
+ Playground ({ version }))]; -} - -export default function Test({ params }: { params: { version: string } }) { - const version = getVersionFromParams(params); - const defs = getTypeDefs(version); - const sidebarLinks = getSidebarLinks(defs); - - return ( - <> - - -
-

Construction

- -
-

- List() -

-
-
-

- Create a new immutable List containing the values of the - provided collection-like. -

-
- - - -
-

Discussion

-
-

- Note:{' '} - - List - {' '} - is a factory function and not a class, and does not use the - - new - {' '} - keyword during construction. -

-
-
- - -
- -

Sandpack !

-
-

- push() -

-
-
-

- Returns a new List with the provided{' '} - - values - {' '} - appended, starting at this List's{' '} - - size - - . -

-
-
-
- - -
-
- - ); -} diff --git a/website/src/app/play/layout.tsx b/website/src/app/play/layout.tsx new file mode 100644 index 0000000000..4f7b7c3a3c --- /dev/null +++ b/website/src/app/play/layout.tsx @@ -0,0 +1,21 @@ +import { DocHeader } from '../../DocHeader'; +import { ImmutableConsole } from '../../ImmutableConsole'; +import { getVersions } from '../../static/getVersions'; + +export default function VersionLayout({ + children, +}: { + children: React.ReactNode; +}) { + const versions = getVersions(); + + return ( +
+ + +
+
{children}
+
+
+ ); +} diff --git a/website/src/app/play/page.tsx b/website/src/app/play/page.tsx new file mode 100644 index 0000000000..94fda0a6e9 --- /dev/null +++ b/website/src/app/play/page.tsx @@ -0,0 +1,46 @@ +import { Metadata } from 'next'; +import { getVersions } from '../../static/getVersions'; +import { getTypeDefs } from '../../static/getTypeDefs'; +import { DocSearch } from '../../DocSearch'; +import { SideBar } from '../../Sidebar'; +import { getSidebarLinks } from '../../getSidebarLinks'; +import dynamic from 'next/dynamic'; + +export async function generateStaticParams() { + return [...getVersions().map((version) => ({ version }))]; +} + +export async function generateMetadata(): Promise { + return { + title: `Playground — Immutable.js`, + }; +} + +const ReplNoSSR = dynamic(() => import('../../repl/Repl'), { ssr: false }); + +export default function OverviewDocPage() { + const versions = getVersions(); + const version = versions[0]; + const defs = getTypeDefs(version); + + const sidebarLinks = getSidebarLinks(defs); + + return ( + <> + +
+ +

Playgroud ({version})

+ + str.charAt(0).toUpperCase() + str.slice(1); + +List(['apple', 'banana', 'coconut']) + .push('dragonfruit') + .map((fruit) => upperFirst(fruit)) +`} + /> +
+ + ); +} diff --git a/website/src/repl/Editor.tsx b/website/src/repl/Editor.tsx new file mode 100644 index 0000000000..e284e14f50 --- /dev/null +++ b/website/src/repl/Editor.tsx @@ -0,0 +1,55 @@ +import { useEffect, useRef } from 'react'; +import { basicSetup } from 'codemirror'; +import { EditorView, keymap } from '@codemirror/view'; +import { defaultKeymap, indentWithTab } from '@codemirror/commands'; +import { EditorState } from '@codemirror/state'; +import { javascript } from '@codemirror/lang-javascript'; +// TODO activate this when we have a dark mode +// import { oneDark } from '@codemirror/theme-one-dark'; + +type Props = { + value: string; + onChange: (value: string) => void; +}; + +export function Editor({ value, onChange }: Props): JSX.Element { + const editor = useRef(null); + + const onUpdate = EditorView.updateListener.of((v) => { + onChange(v.state.doc.toString()); + }); + + useEffect(() => { + if (!editor.current) { + return; + } + const startState = EditorState.create({ + doc: value, + extensions: [ + basicSetup, + keymap.of([...defaultKeymap, indentWithTab]), + javascript(), + // TODO activate this when we have a dark mode + // oneDark, + + onUpdate, + ], + }); + + const view = new EditorView({ + state: startState, + parent: editor.current, + }); + + return () => { + view.destroy(); + }; + }, []); + + return ( +
+ ); +} diff --git a/website/src/repl/FormatterOutput.tsx b/website/src/repl/FormatterOutput.tsx new file mode 100644 index 0000000000..fd0a9b2e2b --- /dev/null +++ b/website/src/repl/FormatterOutput.tsx @@ -0,0 +1,43 @@ +import { toHTML } from 'jsonml-html'; +import { useEffect, useRef } from 'react'; + +/** + * immutable-devtools is a console custom formatter. + * Console formatters does use jsonml format. + * {@see https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html} for a documentation from the Firefox team. + * The `jsonml-html` package can convert jsonml to HTML. + */ +type Props = { + output: { + header: Array; + body?: Array; + }; +}; + +export default function FormatterOutput({ output }: Props): JSX.Element { + const header = useRef(null); + const body = useRef(null); + + const htmlHeader = toHTML(output.header); + + useEffect(() => { + if (header.current && htmlHeader) { + header.current.replaceChildren(htmlHeader); + } + }, [htmlHeader]); + + const htmlBody = output.body ? toHTML(output.body) : null; + + useEffect(() => { + if (body.current) { + body.current.replaceChildren(htmlBody ?? ''); + } + }, [htmlBody]); + + return ( + <> +
+
+ + ); +} diff --git a/website/src/repl/Repl.tsx b/website/src/repl/Repl.tsx new file mode 100644 index 0000000000..b37a5df69f --- /dev/null +++ b/website/src/repl/Repl.tsx @@ -0,0 +1,159 @@ +'use client'; +import React, { useEffect, useRef, useState } from 'react'; +import { Editor } from './Editor'; +import FormatterOutput from './FormatterOutput'; +import './repl.css'; + +type Props = { defaultValue: string }; + +function Repl({ defaultValue }: Props): JSX.Element { + const [code, setCode] = useState(defaultValue); + const [output, setOutput] = useState<{ + header: Array; + body?: Array; + }>({ header: [] }); + const workerRef = useRef(null); + + useEffect(() => { + const workerScript = ` + importScripts('https://cdn.jsdelivr.net/npm/immutable@5.1.1', 'https://cdn.jsdelivr.net/npm/immutable-devtools@0.1.5'); + + // extract all Immutable exports to have them available in the worker automatically + const { + version, + Collection, + Iterable, + Seq, + Map, + OrderedMap, + List, + Stack, + Set, + OrderedSet, + PairSorting, + Record, + Range, + Repeat, + is, + fromJS, + hash, + isImmutable, + isCollection, + isKeyed, + isIndexed, + isAssociative, + isOrdered, + isPlainObject, + isValueObject, + isSeq, + isList, + isMap, + isOrderedMap, + isStack, + isSet, + isOrderedSet, + isRecord, + get, + getIn, + has, + hasIn, + merge, + mergeDeep, + mergeWith, + mergeDeepWith, + remove, + removeIn, + set, + setIn, + update, + updateIn, + } = Immutable; + + immutableDevTools(Immutable); + + // hack to get the formatters from immutable-devtools as they are not exported, but they modify the "global" variable + const immutableFormaters = globalThis.devtoolsFormatters; + + // console.log(immutableFormaters) + + function normalizeResult(result) { + const formatter = immutableFormaters.find((formatter) => formatter.header(result)); + + if (!formatter) { + return undefined; + } + + return { + header: formatter.header(result), + body: formatter.hasBody(result) ? formatter.body(result) : undefined, + } + } + + self.onmessage = function(event) { + let timeoutId = setTimeout(() => { + self.postMessage({ error: "Execution timed out" }); + self.close(); + }, 2000); + + try { + const result = eval(event.data); + clearTimeout(timeoutId); + + self.postMessage({ output: normalizeResult(result) }); + } catch (error) { + console.log(error); + clearTimeout(timeoutId); + self.postMessage({ error: String(error) }); + } + }; + `; + + const workerBlob = new Blob([workerScript], { + type: 'application/javascript', + }); + workerRef.current = new Worker(URL.createObjectURL(workerBlob)); + + return () => { + workerRef.current?.terminate(); + }; + }, []); + + useEffect(() => { + runCode(); + }, []); + + const runCode = () => { + if (workerRef.current) { + workerRef.current.postMessage(code); + workerRef.current.onmessage = (event) => { + if (event.data.error) { + setOutput({ header: ['div', 'Error: ' + event.data.error] }); + } else { + setOutput(event.data.output); + } + }; + } + }; + + return ( +
+

Live example

+ +
+
+ +
+ + +
+ +
+        
+      
+
+ ); +} + +export default Repl; diff --git a/website/src/repl/repl.css b/website/src/repl/repl.css new file mode 100644 index 0000000000..986c25e362 --- /dev/null +++ b/website/src/repl/repl.css @@ -0,0 +1,40 @@ +.repl-editor-container { + display: flex; + align-items: flex-start; + gap: 8px; +} + +textarea { + width: 100%; + height: 100px; + margin-bottom: 10px; + padding: 10px; + font-family: monospace; + font-size: 14px; + border: 1px solid #ccc; + border-radius: 4px; + resize: none; +} + +button { + padding: 10px 15px; + font-size: 14px; + background-color: var(--link-color); + color: white; + border: none; + border-radius: 4px; + cursor: pointer; +} + +button:hover { + background-color: var(--link-hover-color); +} + +pre { + background-color: var(--code-block-bg-color); + padding: 10px; + border: 1px solid #ccc; + border-radius: 4px; + white-space: pre-wrap; + word-wrap: break-word; +} diff --git a/website/styles/globals.css b/website/styles/globals.css index 56158e25a5..cd810eb202 100644 --- a/website/styles/globals.css +++ b/website/styles/globals.css @@ -3,6 +3,7 @@ html, body { --link-color: #4183c4; + --link-hover-color: #2b6db0; --header-color: #212325; --header-bg-color: #6dbcdb; --body-color: #626466; @@ -57,6 +58,10 @@ a { text-decoration: none; } +a:hover { + color: var(--link-hover-color); +} + pre, code { font-family: 'Fira Mono', Menlo, monospace; From 9db72c1e5e0edb3aaa32092a4a1e280e47e4b8ec Mon Sep 17 00:00:00 2001 From: Julien Deniau <1398469+jdeniau@users.noreply.github.com> Date: Sun, 6 Apr 2025 21:43:58 +0200 Subject: [PATCH 15/59] Fix issue with responsive (#2090) --- website/src/repl/Editor.tsx | 7 +------ website/src/repl/Repl.tsx | 4 +--- website/src/repl/repl.css | 7 +++++++ website/styles/globals.css | 10 ++++++++++ 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/website/src/repl/Editor.tsx b/website/src/repl/Editor.tsx index e284e14f50..df566cc748 100644 --- a/website/src/repl/Editor.tsx +++ b/website/src/repl/Editor.tsx @@ -46,10 +46,5 @@ export function Editor({ value, onChange }: Props): JSX.Element { }; }, []); - return ( -
- ); + return
; } diff --git a/website/src/repl/Repl.tsx b/website/src/repl/Repl.tsx index b37a5df69f..e5333f3202 100644 --- a/website/src/repl/Repl.tsx +++ b/website/src/repl/Repl.tsx @@ -140,9 +140,7 @@ function Repl({ defaultValue }: Props): JSX.Element {

Live example

-
- -
+
diff --git a/website/src/repl/Editor.tsx b/website/src/repl/Editor.tsx index df566cc748..aaf0e782e4 100644 --- a/website/src/repl/Editor.tsx +++ b/website/src/repl/Editor.tsx @@ -2,10 +2,11 @@ import { useEffect, useRef } from 'react'; import { basicSetup } from 'codemirror'; import { EditorView, keymap } from '@codemirror/view'; import { defaultKeymap, indentWithTab } from '@codemirror/commands'; -import { EditorState } from '@codemirror/state'; +import { EditorState, Extension } from '@codemirror/state'; import { javascript } from '@codemirror/lang-javascript'; // TODO activate this when we have a dark mode -// import { oneDark } from '@codemirror/theme-one-dark'; +import { oneDark } from '@codemirror/theme-one-dark'; +import useDarkMode from '../useDarkMode'; type Props = { value: string; @@ -14,6 +15,7 @@ type Props = { export function Editor({ value, onChange }: Props): JSX.Element { const editor = useRef(null); + const darkMode = useDarkMode(); const onUpdate = EditorView.updateListener.of((v) => { onChange(v.state.doc.toString()); @@ -29,11 +31,13 @@ export function Editor({ value, onChange }: Props): JSX.Element { basicSetup, keymap.of([...defaultKeymap, indentWithTab]), javascript(), - // TODO activate this when we have a dark mode - // oneDark, + darkMode ? oneDark : undefined, onUpdate, - ], + ].filter( + (value: Extension | undefined): value is Extension => + typeof value !== 'undefined' + ), }); const view = new EditorView({ @@ -44,7 +48,7 @@ export function Editor({ value, onChange }: Props): JSX.Element { return () => { view.destroy(); }; - }, []); + }, [darkMode]); return
; } diff --git a/website/src/repl/Repl.tsx b/website/src/repl/Repl.tsx index e5333f3202..a3b5bc7060 100644 --- a/website/src/repl/Repl.tsx +++ b/website/src/repl/Repl.tsx @@ -16,7 +16,7 @@ function Repl({ defaultValue }: Props): JSX.Element { useEffect(() => { const workerScript = ` - importScripts('https://cdn.jsdelivr.net/npm/immutable@5.1.1', 'https://cdn.jsdelivr.net/npm/immutable-devtools@0.1.5'); + importScripts('https://cdn.jsdelivr.net/npm/immutable@5.1.1', 'https://cdn.jsdelivr.net/npm/@jdeniau/immutable-devtools@0.2.0'); // extract all Immutable exports to have them available in the worker automatically const { diff --git a/website/src/useDarkMode.ts b/website/src/useDarkMode.ts new file mode 100644 index 0000000000..ccaac8d9cc --- /dev/null +++ b/website/src/useDarkMode.ts @@ -0,0 +1,18 @@ +import { useEffect, useState } from 'react'; + +export default function useDarkMode(): boolean { + const darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)'); + const [darkMode, setDarkMode] = useState(darkModeMediaQuery.matches); + + useEffect(() => { + const handleChange = (e: MediaQueryListEvent) => { + setDarkMode(e.matches); + }; + darkModeMediaQuery.addEventListener('change', handleChange); + return () => { + darkModeMediaQuery.removeEventListener('change', handleChange); + }; + }, [darkModeMediaQuery]); + + return darkMode; +} diff --git a/website/styles/globals.css b/website/styles/globals.css index ae382bed13..09e5cef431 100644 --- a/website/styles/globals.css +++ b/website/styles/globals.css @@ -1,5 +1,9 @@ @import url('//code.cdn.mozilla.net/fonts/fira.css'); +:root { + color-scheme: light dark; +} + html, body { --link-color: #4183c4; @@ -8,6 +12,10 @@ body { --header-bg-color: #6dbcdb; --body-color: #626466; --code-block-bg-color: #f4f4f4; + --code-block-color: #484a4c; + + background-color: #ffffff; + color: var(--body-color); -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%; @@ -17,6 +25,21 @@ body { -webkit-font-smoothing: antialiased; } +@media (prefers-color-scheme: dark) { + html, + body { + --link-color: #79a6f6; + --link-hover-color: #5683d4; + --header-color: #e0e0e0; + --header-bg-color: #2b3a42; + --body-color: #c0c0c0; + --code-block-bg-color: #2e2e2e; + --code-block-color: #d1d5da; + + background-color: #121212; + } +} + body, input { color: var(--body-color); @@ -65,8 +88,8 @@ a:hover { pre, code { font-family: 'Fira Mono', Menlo, monospace; - background: #f9f8f7; - color: #484a4c; + background: var(--code-block-bg-color); + color: var(--code-block-color); font-size: 0.9375em; letter-spacing: -0.015em; } @@ -112,67 +135,6 @@ blockquote > :last-child { padding-left: 2ch; } -/* TODO: not random colors */ - -.token.punctuation, -.token.ignore, -.t.interfaceDef, -.t.member, -.t.callSig { - color: #808890; -} - -.token.function, -.token.class-name, -.token.qualifier, -.t.fnQualifier, -.t.fnName { - color: #32308e; -} - -.token.primitive, -.t.primitive { - color: #922; -} - -.token.number, -.t.typeParam { - color: #905; -} - -.t.typeQualifier, -.t.typeName { - color: #013679; -} - -.t.param { - color: #945277; -} - -.t.memberName { - color: teal; -} - -.token.block-keyword, -.token.keyword, -.t.keyword { - color: #a51; -} - -.token.string, -.token.regex { - color: #df5050; -} - -.token.operator { - color: #a67f59; -} - -.token.comment { - color: #998; - font-style: italic; -} - a.try-it { position: absolute; cursor: pointer; @@ -458,6 +420,16 @@ img { color: #141420; } +@media (prefers-color-scheme: dark) { + .toolBar { + color: #bbb; + } + + .toolBar .selected { + color: #fff; + } +} + @media only screen and (max-width: 680px) { .toolBar { display: none; @@ -547,7 +519,7 @@ img { } .typeHeader { - color: #555; + color: light-dark(#555, #fff); font-size: 1.5em; font-weight: normal; margin: 1rem 0; @@ -560,7 +532,7 @@ img { } .infoHeader { - color: #555; + color: light-dark(#555, #fff); font-size: 10px; letter-spacing: 0.25ch; line-height: 16px; diff --git a/website/styles/prism-theme.css b/website/styles/prism-theme.css new file mode 100644 index 0000000000..3a934ab4bd --- /dev/null +++ b/website/styles/prism-theme.css @@ -0,0 +1,270 @@ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ + +code[class*='language-'], +pre[class*='language-'] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 1em; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*='language-']::-moz-selection, +pre[class*='language-'] ::-moz-selection, +code[class*='language-']::-moz-selection, +code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*='language-']::selection, +pre[class*='language-'] ::selection, +code[class*='language-']::selection, +code[class*='language-'] ::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + code[class*='language-'], + pre[class*='language-'] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; +} + +:not(pre) > code[class*='language-'], +pre[class*='language-'] { + background: #f5f2f0; +} + +/* Inline code */ +:not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #999; +} + +.token.namespace { + opacity: 0.7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #9a6e3a; + /* This background color was intended by the author of this theme. */ + background: hsla(0, 0%, 100%, 0.5); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} + +.token.function, +.token.class-name { + color: #dd4a68; +} + +.token.regex, +.token.important, +.token.variable { + color: #e90; +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + +@media (prefers-color-scheme: dark) { + /** + * okaidia theme for JavaScript, CSS and HTML + * Loosely based on Monokai textmate theme by http://www.monokai.nl/ + * @author ocodia + */ + + code[class*='language-'], + pre[class*='language-'] { + color: #f8f8f2; + background: none; + text-shadow: 0 1px rgba(0, 0, 0, 0.3); + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 1em; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; + } + + /* Code blocks */ + pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + border-radius: 0.3em; + } + + :not(pre) > code[class*='language-'], + pre[class*='language-'] { + background: #272822; + } + + /* Inline code */ + :not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #8292a2; + } + + .token.punctuation { + color: #f8f8f2; + } + + .token.namespace { + opacity: 0.7; + } + + .token.property, + .token.tag, + .token.constant, + .token.symbol, + .token.deleted { + color: #f92672; + } + + .token.boolean, + .token.number { + color: #ae81ff; + } + + .token.selector, + .token.attr-name, + .token.string, + .token.char, + .token.builtin, + .token.inserted { + color: #a6e22e; + } + + .token.operator, + .token.entity, + .token.url, + .language-css .token.string, + .style .token.string, + .token.variable { + color: #f8f8f2; + } + + .token.atrule, + .token.attr-value, + .token.function, + .token.class-name { + color: #e6db74; + } + + .token.keyword { + color: #66d9ef; + } + + .token.regex, + .token.important { + color: #fd971f; + } + + .token.important, + .token.bold { + font-weight: bold; + } + .token.italic { + font-style: italic; + } + + .token.entity { + cursor: help; + } +} From 81efe1e832f598f48827a2d2074e3d49b1181151 Mon Sep 17 00:00:00 2001 From: Julien Deniau <1398469+jdeniau@users.noreply.github.com> Date: Sat, 19 Apr 2025 22:24:30 +0200 Subject: [PATCH 17/59] Upgrade doc website to next 15 (#2092) --- package-lock.json | 1119 ++++++++++++++--- package.json | 10 +- website/next-env.d.ts | 2 +- website/src/ArrowDown.tsx | 2 + website/src/Defs.tsx | 11 +- .../src/app/docs/[version]/[type]/page.tsx | 14 +- website/src/app/docs/[version]/layout.tsx | 11 +- website/src/app/docs/[version]/page.tsx | 8 +- website/src/app/not-found.tsx | 13 + website/src/app/play/page.tsx | 6 +- website/src/repl/Editor.tsx | 2 +- website/src/repl/FormatterOutput.tsx | 2 +- website/src/repl/Repl.tsx | 7 +- website/styles/globals.css | 2 +- 14 files changed, 964 insertions(+), 245 deletions(-) create mode 100644 website/src/app/not-found.tsx diff --git a/package-lock.json b/package-lock.json index a7ccb2c8a1..f2b6158e85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@size-limit/preset-small-lib": "^11.2.0", "@types/prismjs": "^1.26.3", "@types/random-seed": "0.3.5", - "@types/react": "17.0.11", + "@types/react": "19.1.0", "benchmark": "2.1.4", "codemirror": "^6.0.1", "colors": "1.4.0", @@ -45,14 +45,14 @@ "marked": "^11.2.0", "marked-highlight": "^2.1.0", "microtime": "3.1.1", - "next": "^14.1.0", + "next": "15.2.4", "next-sitemap": "4.2.3", "npm-run-all": "4.1.5", "prettier": "^3.5.0", "prismjs": "^1.29.0", "random-seed": "0.3.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "19.1.0", + "react-dom": "19.1.0", "rimraf": "2.7.1", "rollup": "4.34.8", "size-limit": "^11.2.0", @@ -733,6 +733,17 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@emnapi/runtime": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.0.tgz", + "integrity": "sha512-64WYIf4UYcdLnbKn/umDlNjQDSS8AgZrI/R9+x5ilkUVFxXcA1Ebl+gQLc/6mERA4407Xof0R7wEyEuj091CVw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.25.1", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.1.tgz", @@ -1448,6 +1459,386 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", + "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", + "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", + "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.5" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", + "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", + "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.2.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", + "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", + "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1963,16 +2354,16 @@ "license": "MIT" }, "node_modules/@next/env": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.26.tgz", - "integrity": "sha512-vO//GJ/YBco+H7xdQhzJxF7ub3SUwft76jwaeOyVVQFHCi5DCnkP16WHB+JBylo4vOKPoZBlR94Z8xBxNBdNJA==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.2.4.tgz", + "integrity": "sha512-+SFtMgoiYP3WoSswuNmxJOCwi06TdWE733D+WPjpXIe4LXGULwEaofiiAy6kbS0+XjM5xF5n3lKuBwN2SnqD9g==", "dev": true, "license": "MIT" }, "node_modules/@next/swc-darwin-arm64": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.26.tgz", - "integrity": "sha512-zDJY8gsKEseGAxG+C2hTMT0w9Nk9N1Sk1qV7vXYz9MEiyRoF5ogQX2+vplyUMIfygnjn9/A04I6yrUTRTuRiyQ==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.2.4.tgz", + "integrity": "sha512-1AnMfs655ipJEDC/FHkSr0r3lXBgpqKo4K1kiwfUf3iE68rDFXZ1TtHdMvf7D0hMItgDZ7Vuq3JgNMbt/+3bYw==", "cpu": [ "arm64" ], @@ -1987,9 +2378,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.26.tgz", - "integrity": "sha512-U0adH5ryLfmTDkahLwG9sUQG2L0a9rYux8crQeC92rPhi3jGQEY47nByQHrVrt3prZigadwj/2HZ1LUUimuSbg==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.2.4.tgz", + "integrity": "sha512-3qK2zb5EwCwxnO2HeO+TRqCubeI/NgCe+kL5dTJlPldV/uwCnUgC7VbEzgmxbfrkbjehL4H9BPztWOEtsoMwew==", "cpu": [ "x64" ], @@ -2004,9 +2395,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.26.tgz", - "integrity": "sha512-SINMl1I7UhfHGM7SoRiw0AbwnLEMUnJ/3XXVmhyptzriHbWvPPbbm0OEVG24uUKhuS1t0nvN/DBvm5kz6ZIqpg==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.2.4.tgz", + "integrity": "sha512-HFN6GKUcrTWvem8AZN7tT95zPb0GUGv9v0d0iyuTb303vbXkkbHDp/DxufB04jNVD+IN9yHy7y/6Mqq0h0YVaQ==", "cpu": [ "arm64" ], @@ -2021,9 +2412,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.26.tgz", - "integrity": "sha512-s6JaezoyJK2DxrwHWxLWtJKlqKqTdi/zaYigDXUJ/gmx/72CrzdVZfMvUc6VqnZ7YEvRijvYo+0o4Z9DencduA==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.2.4.tgz", + "integrity": "sha512-Oioa0SORWLwi35/kVB8aCk5Uq+5/ZIumMK1kJV+jSdazFm2NzPDztsefzdmzzpx5oGCJ6FkUC7vkaUseNTStNA==", "cpu": [ "arm64" ], @@ -2038,9 +2429,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.26.tgz", - "integrity": "sha512-FEXeUQi8/pLr/XI0hKbe0tgbLmHFRhgXOUiPScz2hk0hSmbGiU8aUqVslj/6C6KA38RzXnWoJXo4FMo6aBxjzg==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.2.4.tgz", + "integrity": "sha512-yb5WTRaHdkgOqFOZiu6rHV1fAEK0flVpaIN2HB6kxHVSy/dIajWbThS7qON3W9/SNOH2JWkVCyulgGYekMePuw==", "cpu": [ "x64" ], @@ -2055,9 +2446,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.26.tgz", - "integrity": "sha512-BUsomaO4d2DuXhXhgQCVt2jjX4B4/Thts8nDoIruEJkhE5ifeQFtvW5c9JkdOtYvE5p2G0hcwQ0UbRaQmQwaVg==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.2.4.tgz", + "integrity": "sha512-Dcdv/ix6srhkM25fgXiyOieFUkz+fOYkHlydWCtB0xMST6X9XYI3yPDKBZt1xuhOytONsIFJFB08xXYsxUwJLw==", "cpu": [ "x64" ], @@ -2072,9 +2463,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.26.tgz", - "integrity": "sha512-5auwsMVzT7wbB2CZXQxDctpWbdEnEW/e66DyXO1DcgHxIyhP06awu+rHKshZE+lPLIGiwtjo7bsyeuubewwxMw==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.2.4.tgz", + "integrity": "sha512-dW0i7eukvDxtIhCYkMrZNQfNicPDExt2jPb9AZPpL7cfyUo7QSNl1DjsHjmmKp6qNAqUESyT8YFl/Aw91cNJJg==", "cpu": [ "arm64" ], @@ -2088,27 +2479,10 @@ "node": ">= 10" } }, - "node_modules/@next/swc-win32-ia32-msvc": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.26.tgz", - "integrity": "sha512-GQWg/Vbz9zUGi9X80lOeGsz1rMH/MtFO/XqigDznhhhTfDlDoynCM6982mPCbSlxJ/aveZcKtTlwfAjwhyxDpg==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.26.tgz", - "integrity": "sha512-2rdB3T1/Gp7bv1eQTTm9d1Y1sv9UuJ2LAwOE0Pe2prHKe32UNscj7YS13fRB37d0GAiGNR+Y7ZcW8YjDI8Ns0w==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.2.4.tgz", + "integrity": "sha512-SbnWkJmkS7Xl3kre8SdMF6F/XDh1DTFEhp0jRTj/uB8iPKoU2bb2NDfcu+iifv1+mxQEd1g2vvSxcZbXSKyWiQ==", "cpu": [ "x64" ], @@ -2854,14 +3228,13 @@ "license": "Apache-2.0" }, "node_modules/@swc/helpers": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.5.tgz", - "integrity": "sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==", + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", + "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@swc/counter": "^0.1.3", - "tslib": "^2.4.0" + "tslib": "^2.8.0" } }, "node_modules/@tootallnate/once": { @@ -3035,12 +3408,6 @@ "integrity": "sha512-A0D0aTXvjlqJ5ZILMz3rNfDBOx9hHxLZYv2by47Sm/pqW35zzjusrZTryatjN/Rf8Us2gZrJD+KeHbUSTux1Cw==", "dev": true }, - "node_modules/@types/prop-types": { - "version": "15.7.3", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz", - "integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==", - "dev": true - }, "node_modules/@types/random-seed": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/@types/random-seed/-/random-seed-0.3.5.tgz", @@ -3049,22 +3416,15 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "17.0.11", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.11.tgz", - "integrity": "sha512-yFRQbD+whVonItSk7ZzP/L+gPTJVBkL/7shLEF+i9GC/1cV3JmUxEQz6+9ylhUpWSDuqo1N9qEvqS6vTj4USUA==", + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.0.tgz", + "integrity": "sha512-UaicktuQI+9UKyA4njtDOGBD/67t8YEBt2xdfqu8+gP9hqPUPsiXlNPcpS2gVdjmis5GKPG3fCxbQLVgxsQZ8w==", "dev": true, + "license": "MIT", "dependencies": { - "@types/prop-types": "*", - "@types/scheduler": "*", "csstype": "^3.0.2" } }, - "node_modules/@types/scheduler": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.1.tgz", - "integrity": "sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA==", - "dev": true - }, "node_modules/@types/stack-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", @@ -4207,7 +4567,8 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cliui": { "version": "8.0.1", @@ -4296,6 +4657,21 @@ "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", "dev": true }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -4314,6 +4690,18 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, "node_modules/colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", @@ -4712,6 +5100,17 @@ "node": ">=0.4.0" } }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -8404,42 +8803,43 @@ "license": "MIT" }, "node_modules/next": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/next/-/next-14.2.26.tgz", - "integrity": "sha512-b81XSLihMwCfwiUVRRja3LphLo4uBBMZEzBBWMaISbKTwOmq3wPknIETy/8000tr7Gq4WmbuFYPS7jOYIf+ZJw==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/next/-/next-15.2.4.tgz", + "integrity": "sha512-VwL+LAaPSxEkd3lU2xWbgEOtrM8oedmyhBqaVNmgKB+GvZlCy9rgaEc+y2on0wv+l0oSFqLtYD6dcC1eAedUaQ==", "dev": true, "license": "MIT", "dependencies": { - "@next/env": "14.2.26", - "@swc/helpers": "0.5.5", + "@next/env": "15.2.4", + "@swc/counter": "0.1.3", + "@swc/helpers": "0.5.15", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", - "graceful-fs": "^4.2.11", "postcss": "8.4.31", - "styled-jsx": "5.1.1" + "styled-jsx": "5.1.6" }, "bin": { "next": "dist/bin/next" }, "engines": { - "node": ">=18.17.0" + "node": "^18.18.0 || ^19.8.0 || >= 20.0.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "14.2.26", - "@next/swc-darwin-x64": "14.2.26", - "@next/swc-linux-arm64-gnu": "14.2.26", - "@next/swc-linux-arm64-musl": "14.2.26", - "@next/swc-linux-x64-gnu": "14.2.26", - "@next/swc-linux-x64-musl": "14.2.26", - "@next/swc-win32-arm64-msvc": "14.2.26", - "@next/swc-win32-ia32-msvc": "14.2.26", - "@next/swc-win32-x64-msvc": "14.2.26" + "@next/swc-darwin-arm64": "15.2.4", + "@next/swc-darwin-x64": "15.2.4", + "@next/swc-linux-arm64-gnu": "15.2.4", + "@next/swc-linux-arm64-musl": "15.2.4", + "@next/swc-linux-x64-gnu": "15.2.4", + "@next/swc-linux-x64-musl": "15.2.4", + "@next/swc-win32-arm64-msvc": "15.2.4", + "@next/swc-win32-x64-msvc": "15.2.4", + "sharp": "^0.33.5" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.41.2", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "babel-plugin-react-compiler": "*", + "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "sass": "^1.3.0" }, "peerDependenciesMeta": { @@ -8449,6 +8849,9 @@ "@playwright/test": { "optional": true }, + "babel-plugin-react-compiler": { + "optional": true + }, "sass": { "optional": true } @@ -9411,28 +9814,26 @@ } }, "node_modules/react": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", - "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", + "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", "dev": true, - "dependencies": { - "loose-envify": "^1.1.0" - }, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/react-dom": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", - "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz", + "integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==", "dev": true, + "license": "MIT", "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.0" + "scheduler": "^0.26.0" }, "peerDependencies": { - "react": "^18.2.0" + "react": "^19.1.0" } }, "node_modules/react-is": { @@ -9862,13 +10263,11 @@ } }, "node_modules/scheduler": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", + "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", "dev": true, - "dependencies": { - "loose-envify": "^1.1.0" - } + "license": "MIT" }, "node_modules/semver": { "version": "6.3.1", @@ -9938,6 +10337,61 @@ "node": ">= 0.4" } }, + "node_modules/sharp": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", + "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.3", + "semver": "^7.6.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.33.5", + "@img/sharp-darwin-x64": "0.33.5", + "@img/sharp-libvips-darwin-arm64": "1.0.4", + "@img/sharp-libvips-darwin-x64": "1.0.4", + "@img/sharp-libvips-linux-arm": "1.0.5", + "@img/sharp-libvips-linux-arm64": "1.0.4", + "@img/sharp-libvips-linux-s390x": "1.0.4", + "@img/sharp-libvips-linux-x64": "1.0.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", + "@img/sharp-libvips-linuxmusl-x64": "1.0.4", + "@img/sharp-linux-arm": "0.33.5", + "@img/sharp-linux-arm64": "0.33.5", + "@img/sharp-linux-s390x": "0.33.5", + "@img/sharp-linux-x64": "0.33.5", + "@img/sharp-linuxmusl-arm64": "0.33.5", + "@img/sharp-linuxmusl-x64": "0.33.5", + "@img/sharp-wasm32": "0.33.5", + "@img/sharp-win32-ia32": "0.33.5", + "@img/sharp-win32-x64": "0.33.5" + } + }, + "node_modules/sharp/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -10054,6 +10508,25 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/simple-swizzle/node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true, + "license": "MIT", + "optional": true + }, "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -10386,10 +10859,11 @@ "license": "MIT" }, "node_modules/styled-jsx": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", - "integrity": "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz", + "integrity": "sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==", "dev": true, + "license": "MIT", "dependencies": { "client-only": "0.0.1" }, @@ -10397,7 +10871,7 @@ "node": ">= 12.0.0" }, "peerDependencies": { - "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0" }, "peerDependenciesMeta": { "@babel/core": { @@ -11864,6 +12338,16 @@ } } }, + "@emnapi/runtime": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.0.tgz", + "integrity": "sha512-64WYIf4UYcdLnbKn/umDlNjQDSS8AgZrI/R9+x5ilkUVFxXcA1Ebl+gQLc/6mERA4407Xof0R7wEyEuj091CVw==", + "dev": true, + "optional": true, + "requires": { + "tslib": "^2.4.0" + } + }, "@esbuild/aix-ppc64": { "version": "0.25.1", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.1.tgz", @@ -12223,6 +12707,166 @@ "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", "dev": true }, + "@img/sharp-darwin-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", + "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-darwin-arm64": "1.0.4" + } + }, + "@img/sharp-darwin-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-darwin-x64": "1.0.4" + } + }, + "@img/sharp-libvips-darwin-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", + "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-arm": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-s390x": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", + "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "dev": true, + "optional": true + }, + "@img/sharp-linux-arm": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-arm": "1.0.5" + } + }, + "@img/sharp-linux-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-arm64": "1.0.4" + } + }, + "@img/sharp-linux-s390x": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", + "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-s390x": "1.0.4" + } + }, + "@img/sharp-linux-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-x64": "1.0.4" + } + }, + "@img/sharp-linuxmusl-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + } + }, + "@img/sharp-linuxmusl-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + } + }, + "@img/sharp-wasm32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", + "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "dev": true, + "optional": true, + "requires": { + "@emnapi/runtime": "^1.2.0" + } + }, + "@img/sharp-win32-ia32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", + "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "dev": true, + "optional": true + }, + "@img/sharp-win32-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", + "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", + "dev": true, + "optional": true + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -12627,71 +13271,64 @@ "dev": true }, "@next/env": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.26.tgz", - "integrity": "sha512-vO//GJ/YBco+H7xdQhzJxF7ub3SUwft76jwaeOyVVQFHCi5DCnkP16WHB+JBylo4vOKPoZBlR94Z8xBxNBdNJA==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.2.4.tgz", + "integrity": "sha512-+SFtMgoiYP3WoSswuNmxJOCwi06TdWE733D+WPjpXIe4LXGULwEaofiiAy6kbS0+XjM5xF5n3lKuBwN2SnqD9g==", "dev": true }, "@next/swc-darwin-arm64": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.26.tgz", - "integrity": "sha512-zDJY8gsKEseGAxG+C2hTMT0w9Nk9N1Sk1qV7vXYz9MEiyRoF5ogQX2+vplyUMIfygnjn9/A04I6yrUTRTuRiyQ==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.2.4.tgz", + "integrity": "sha512-1AnMfs655ipJEDC/FHkSr0r3lXBgpqKo4K1kiwfUf3iE68rDFXZ1TtHdMvf7D0hMItgDZ7Vuq3JgNMbt/+3bYw==", "dev": true, "optional": true }, "@next/swc-darwin-x64": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.26.tgz", - "integrity": "sha512-U0adH5ryLfmTDkahLwG9sUQG2L0a9rYux8crQeC92rPhi3jGQEY47nByQHrVrt3prZigadwj/2HZ1LUUimuSbg==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.2.4.tgz", + "integrity": "sha512-3qK2zb5EwCwxnO2HeO+TRqCubeI/NgCe+kL5dTJlPldV/uwCnUgC7VbEzgmxbfrkbjehL4H9BPztWOEtsoMwew==", "dev": true, "optional": true }, "@next/swc-linux-arm64-gnu": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.26.tgz", - "integrity": "sha512-SINMl1I7UhfHGM7SoRiw0AbwnLEMUnJ/3XXVmhyptzriHbWvPPbbm0OEVG24uUKhuS1t0nvN/DBvm5kz6ZIqpg==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.2.4.tgz", + "integrity": "sha512-HFN6GKUcrTWvem8AZN7tT95zPb0GUGv9v0d0iyuTb303vbXkkbHDp/DxufB04jNVD+IN9yHy7y/6Mqq0h0YVaQ==", "dev": true, "optional": true }, "@next/swc-linux-arm64-musl": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.26.tgz", - "integrity": "sha512-s6JaezoyJK2DxrwHWxLWtJKlqKqTdi/zaYigDXUJ/gmx/72CrzdVZfMvUc6VqnZ7YEvRijvYo+0o4Z9DencduA==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.2.4.tgz", + "integrity": "sha512-Oioa0SORWLwi35/kVB8aCk5Uq+5/ZIumMK1kJV+jSdazFm2NzPDztsefzdmzzpx5oGCJ6FkUC7vkaUseNTStNA==", "dev": true, "optional": true }, "@next/swc-linux-x64-gnu": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.26.tgz", - "integrity": "sha512-FEXeUQi8/pLr/XI0hKbe0tgbLmHFRhgXOUiPScz2hk0hSmbGiU8aUqVslj/6C6KA38RzXnWoJXo4FMo6aBxjzg==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.2.4.tgz", + "integrity": "sha512-yb5WTRaHdkgOqFOZiu6rHV1fAEK0flVpaIN2HB6kxHVSy/dIajWbThS7qON3W9/SNOH2JWkVCyulgGYekMePuw==", "dev": true, "optional": true }, "@next/swc-linux-x64-musl": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.26.tgz", - "integrity": "sha512-BUsomaO4d2DuXhXhgQCVt2jjX4B4/Thts8nDoIruEJkhE5ifeQFtvW5c9JkdOtYvE5p2G0hcwQ0UbRaQmQwaVg==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.2.4.tgz", + "integrity": "sha512-Dcdv/ix6srhkM25fgXiyOieFUkz+fOYkHlydWCtB0xMST6X9XYI3yPDKBZt1xuhOytONsIFJFB08xXYsxUwJLw==", "dev": true, "optional": true }, "@next/swc-win32-arm64-msvc": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.26.tgz", - "integrity": "sha512-5auwsMVzT7wbB2CZXQxDctpWbdEnEW/e66DyXO1DcgHxIyhP06awu+rHKshZE+lPLIGiwtjo7bsyeuubewwxMw==", - "dev": true, - "optional": true - }, - "@next/swc-win32-ia32-msvc": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.26.tgz", - "integrity": "sha512-GQWg/Vbz9zUGi9X80lOeGsz1rMH/MtFO/XqigDznhhhTfDlDoynCM6982mPCbSlxJ/aveZcKtTlwfAjwhyxDpg==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.2.4.tgz", + "integrity": "sha512-dW0i7eukvDxtIhCYkMrZNQfNicPDExt2jPb9AZPpL7cfyUo7QSNl1DjsHjmmKp6qNAqUESyT8YFl/Aw91cNJJg==", "dev": true, "optional": true }, "@next/swc-win32-x64-msvc": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.26.tgz", - "integrity": "sha512-2rdB3T1/Gp7bv1eQTTm9d1Y1sv9UuJ2LAwOE0Pe2prHKe32UNscj7YS13fRB37d0GAiGNR+Y7ZcW8YjDI8Ns0w==", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.2.4.tgz", + "integrity": "sha512-SbnWkJmkS7Xl3kre8SdMF6F/XDh1DTFEhp0jRTj/uB8iPKoU2bb2NDfcu+iifv1+mxQEd1g2vvSxcZbXSKyWiQ==", "dev": true, "optional": true }, @@ -13129,13 +13766,12 @@ "dev": true }, "@swc/helpers": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.5.tgz", - "integrity": "sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==", + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", + "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", "dev": true, "requires": { - "@swc/counter": "^0.1.3", - "tslib": "^2.4.0" + "tslib": "^2.8.0" } }, "@tootallnate/once": { @@ -13298,12 +13934,6 @@ "integrity": "sha512-A0D0aTXvjlqJ5ZILMz3rNfDBOx9hHxLZYv2by47Sm/pqW35zzjusrZTryatjN/Rf8Us2gZrJD+KeHbUSTux1Cw==", "dev": true }, - "@types/prop-types": { - "version": "15.7.3", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz", - "integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==", - "dev": true - }, "@types/random-seed": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/@types/random-seed/-/random-seed-0.3.5.tgz", @@ -13311,22 +13941,14 @@ "dev": true }, "@types/react": { - "version": "17.0.11", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.11.tgz", - "integrity": "sha512-yFRQbD+whVonItSk7ZzP/L+gPTJVBkL/7shLEF+i9GC/1cV3JmUxEQz6+9ylhUpWSDuqo1N9qEvqS6vTj4USUA==", + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.0.tgz", + "integrity": "sha512-UaicktuQI+9UKyA4njtDOGBD/67t8YEBt2xdfqu8+gP9hqPUPsiXlNPcpS2gVdjmis5GKPG3fCxbQLVgxsQZ8w==", "dev": true, "requires": { - "@types/prop-types": "*", - "@types/scheduler": "*", "csstype": "^3.0.2" } }, - "@types/scheduler": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.1.tgz", - "integrity": "sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA==", - "dev": true - }, "@types/stack-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", @@ -14145,6 +14767,17 @@ "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", "dev": true }, + "color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dev": true, + "optional": true, + "requires": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + } + }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -14160,6 +14793,17 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dev": true, + "optional": true, + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, "colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", @@ -14434,6 +15078,13 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, + "detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "dev": true, + "optional": true + }, "detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -16990,27 +17641,27 @@ "dev": true }, "next": { - "version": "14.2.26", - "resolved": "https://registry.npmjs.org/next/-/next-14.2.26.tgz", - "integrity": "sha512-b81XSLihMwCfwiUVRRja3LphLo4uBBMZEzBBWMaISbKTwOmq3wPknIETy/8000tr7Gq4WmbuFYPS7jOYIf+ZJw==", - "dev": true, - "requires": { - "@next/env": "14.2.26", - "@next/swc-darwin-arm64": "14.2.26", - "@next/swc-darwin-x64": "14.2.26", - "@next/swc-linux-arm64-gnu": "14.2.26", - "@next/swc-linux-arm64-musl": "14.2.26", - "@next/swc-linux-x64-gnu": "14.2.26", - "@next/swc-linux-x64-musl": "14.2.26", - "@next/swc-win32-arm64-msvc": "14.2.26", - "@next/swc-win32-ia32-msvc": "14.2.26", - "@next/swc-win32-x64-msvc": "14.2.26", - "@swc/helpers": "0.5.5", + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/next/-/next-15.2.4.tgz", + "integrity": "sha512-VwL+LAaPSxEkd3lU2xWbgEOtrM8oedmyhBqaVNmgKB+GvZlCy9rgaEc+y2on0wv+l0oSFqLtYD6dcC1eAedUaQ==", + "dev": true, + "requires": { + "@next/env": "15.2.4", + "@next/swc-darwin-arm64": "15.2.4", + "@next/swc-darwin-x64": "15.2.4", + "@next/swc-linux-arm64-gnu": "15.2.4", + "@next/swc-linux-arm64-musl": "15.2.4", + "@next/swc-linux-x64-gnu": "15.2.4", + "@next/swc-linux-x64-musl": "15.2.4", + "@next/swc-win32-arm64-msvc": "15.2.4", + "@next/swc-win32-x64-msvc": "15.2.4", + "@swc/counter": "0.1.3", + "@swc/helpers": "0.5.15", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", - "graceful-fs": "^4.2.11", "postcss": "8.4.31", - "styled-jsx": "5.1.1" + "sharp": "^0.33.5", + "styled-jsx": "5.1.6" } }, "next-sitemap": { @@ -17650,22 +18301,18 @@ } }, "react": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", - "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", - "dev": true, - "requires": { - "loose-envify": "^1.1.0" - } + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", + "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", + "dev": true }, "react-dom": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", - "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz", + "integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==", "dev": true, "requires": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.0" + "scheduler": "^0.26.0" } }, "react-is": { @@ -17959,13 +18606,10 @@ } }, "scheduler": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", - "dev": true, - "requires": { - "loose-envify": "^1.1.0" - } + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", + "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", + "dev": true }, "semver": { "version": "6.3.1", @@ -18019,6 +18663,46 @@ "es-object-atoms": "^1.0.0" } }, + "sharp": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", + "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-darwin-arm64": "0.33.5", + "@img/sharp-darwin-x64": "0.33.5", + "@img/sharp-libvips-darwin-arm64": "1.0.4", + "@img/sharp-libvips-darwin-x64": "1.0.4", + "@img/sharp-libvips-linux-arm": "1.0.5", + "@img/sharp-libvips-linux-arm64": "1.0.4", + "@img/sharp-libvips-linux-s390x": "1.0.4", + "@img/sharp-libvips-linux-x64": "1.0.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", + "@img/sharp-libvips-linuxmusl-x64": "1.0.4", + "@img/sharp-linux-arm": "0.33.5", + "@img/sharp-linux-arm64": "0.33.5", + "@img/sharp-linux-s390x": "0.33.5", + "@img/sharp-linux-x64": "0.33.5", + "@img/sharp-linuxmusl-arm64": "0.33.5", + "@img/sharp-linuxmusl-x64": "0.33.5", + "@img/sharp-wasm32": "0.33.5", + "@img/sharp-win32-ia32": "0.33.5", + "@img/sharp-win32-x64": "0.33.5", + "color": "^4.2.3", + "detect-libc": "^2.0.3", + "semver": "^7.6.3" + }, + "dependencies": { + "semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "optional": true + } + } + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -18094,6 +18778,25 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dev": true, + "optional": true, + "requires": { + "is-arrayish": "^0.3.1" + }, + "dependencies": { + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true, + "optional": true + } + } + }, "sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -18346,9 +19049,9 @@ "dev": true }, "styled-jsx": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", - "integrity": "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz", + "integrity": "sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==", "dev": true, "requires": { "client-only": "0.0.1" diff --git a/package.json b/package.json index 651a7241c8..baa0b4ab79 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "build:prepare": "./resources/prepare-dist.sh", "build:stats": "node ./resources/dist-stats.mjs", "website:build": "cd website && next build && next-sitemap", - "website:dev": "cd website && next dev", + "website:dev": "cd website && next dev --turbopack", "check-build-output": "node ./resources/check-build-output.mjs", "check-git-clean": "./resources/check-git-clean.sh", "benchmark": "node ./resources/benchmark.js", @@ -99,7 +99,7 @@ "@size-limit/preset-small-lib": "^11.2.0", "@types/prismjs": "^1.26.3", "@types/random-seed": "0.3.5", - "@types/react": "17.0.11", + "@types/react": "19.1.0", "benchmark": "2.1.4", "codemirror": "^6.0.1", "colors": "1.4.0", @@ -119,14 +119,14 @@ "marked": "^11.2.0", "marked-highlight": "^2.1.0", "microtime": "3.1.1", - "next": "^14.1.0", + "next": "15.2.4", "next-sitemap": "4.2.3", "npm-run-all": "4.1.5", "prettier": "^3.5.0", "prismjs": "^1.29.0", "random-seed": "0.3.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "19.1.0", + "react-dom": "19.1.0", "rimraf": "2.7.1", "rollup": "4.34.8", "size-limit": "^11.2.0", diff --git a/website/next-env.d.ts b/website/next-env.d.ts index 40c3d68096..1b3be0840f 100644 --- a/website/next-env.d.ts +++ b/website/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/website/src/ArrowDown.tsx b/website/src/ArrowDown.tsx index 5e03c3339f..662f63466c 100644 --- a/website/src/ArrowDown.tsx +++ b/website/src/ArrowDown.tsx @@ -1,3 +1,5 @@ +import type { JSX } from 'react'; + export function ArrowDown({ isActive }: { isActive: boolean }): JSX.Element { return ( { + (event: MouseEvent | FocusEvent) => { event.stopPropagation(); setIsOver(true); }, @@ -413,15 +413,16 @@ function typeLength(type: Type): number { throw new Error('Type with unknown kind ' + JSON.stringify(type)); } -function interpose( +function interpose( between: ReactNode, array: Array -): Array { - const result = []; +): Array { + const result: Array = []; let i = 0; for (const value of array) { result.push(value, {between}); } result.pop(); + return result; } diff --git a/website/src/app/docs/[version]/[type]/page.tsx b/website/src/app/docs/[version]/[type]/page.tsx index efae446f7a..044775a215 100644 --- a/website/src/app/docs/[version]/[type]/page.tsx +++ b/website/src/app/docs/[version]/[type]/page.tsx @@ -21,10 +21,11 @@ type Params = { }; type Props = { - params: Params; + params: Promise; }; -export async function generateMetadata({ params }: Props) { +export async function generateMetadata(props: Props) { + const params = await props.params; const version = getVersionFromParams(params); const defs = getTypeDefs(version); const def = Object.values(defs.types).find((d) => d.label === params.type); @@ -38,13 +39,8 @@ export async function generateMetadata({ params }: Props) { }; } -export default function TypeDocPage({ - // versions, - // version, - // def, - // sidebarLinks, - params, -}: Props) { +export default async function TypeDocPage(props: Props) { + const params = await props.params; const version = getVersionFromParams(params); const defs = getTypeDefs(version); diff --git a/website/src/app/docs/[version]/layout.tsx b/website/src/app/docs/[version]/layout.tsx index 94317c27f5..ab824ad184 100644 --- a/website/src/app/docs/[version]/layout.tsx +++ b/website/src/app/docs/[version]/layout.tsx @@ -3,13 +3,14 @@ import { ImmutableConsole } from '../../../ImmutableConsole'; import { getVersions } from '../../../static/getVersions'; import { getVersionFromParams } from '../../getVersionFromParams'; -export default function VersionLayout({ - children, - params, -}: { +export default async function VersionLayout(props: { children: React.ReactNode; - params: { version: string }; + params: Promise<{ version: string }>; }) { + const params = await props.params; + + const { children } = props; + const versions = getVersions(); const version = getVersionFromParams(params); diff --git a/website/src/app/docs/[version]/page.tsx b/website/src/app/docs/[version]/page.tsx index bce11ae1ff..aaaa1c535c 100644 --- a/website/src/app/docs/[version]/page.tsx +++ b/website/src/app/docs/[version]/page.tsx @@ -16,10 +16,11 @@ type Params = { }; type Props = { - params: Params; + params: Promise; }; -export async function generateMetadata({ params }: Props): Promise { +export async function generateMetadata(props: Props): Promise { + const params = await props.params; const version = getVersionFromParams(params); return { @@ -27,7 +28,8 @@ export async function generateMetadata({ params }: Props): Promise { }; } -export default function OverviewDocPage({ params }: Props) { +export default async function OverviewDocPage(props: Props) { + const params = await props.params; const version = getVersionFromParams(params); const defs = getTypeDefs(version); const overviewData = getOverviewData(defs); diff --git a/website/src/app/not-found.tsx b/website/src/app/not-found.tsx new file mode 100644 index 0000000000..10d4886a05 --- /dev/null +++ b/website/src/app/not-found.tsx @@ -0,0 +1,13 @@ +import Link from 'next/link'; + +export default function NotFound() { + return ( + <> +
+

Not Found

+

Could not find requested resource

+ Return Home +
+ + ); +} diff --git a/website/src/app/play/page.tsx b/website/src/app/play/page.tsx index c4dc240259..bdee9f1cf6 100644 --- a/website/src/app/play/page.tsx +++ b/website/src/app/play/page.tsx @@ -4,7 +4,7 @@ import { getTypeDefs } from '../../static/getTypeDefs'; import { DocSearch } from '../../DocSearch'; import { SideBar } from '../../Sidebar'; import { getSidebarLinks } from '../../getSidebarLinks'; -import dynamic from 'next/dynamic'; +import Repl from '../../repl/Repl'; export async function generateStaticParams() { return [...getVersions().map((version) => ({ version }))]; @@ -16,8 +16,6 @@ export async function generateMetadata(): Promise { }; } -const ReplNoSSR = dynamic(() => import('../../repl/Repl'), { ssr: false }); - export default function OverviewDocPage() { const versions = getVersions(); const version = versions[0]; @@ -49,7 +47,7 @@ List([ */} - typeof str === 'string' ? str.charAt(0).toUpperCase() + str.slice(1) : str; diff --git a/website/src/repl/Editor.tsx b/website/src/repl/Editor.tsx index aaf0e782e4..532de7aff4 100644 --- a/website/src/repl/Editor.tsx +++ b/website/src/repl/Editor.tsx @@ -1,4 +1,4 @@ -import { useEffect, useRef } from 'react'; +import { useEffect, useRef, type JSX } from 'react'; import { basicSetup } from 'codemirror'; import { EditorView, keymap } from '@codemirror/view'; import { defaultKeymap, indentWithTab } from '@codemirror/commands'; diff --git a/website/src/repl/FormatterOutput.tsx b/website/src/repl/FormatterOutput.tsx index fd0a9b2e2b..3d96966ec1 100644 --- a/website/src/repl/FormatterOutput.tsx +++ b/website/src/repl/FormatterOutput.tsx @@ -1,5 +1,5 @@ import { toHTML } from 'jsonml-html'; -import { useEffect, useRef } from 'react'; +import { useEffect, useRef, type JSX } from 'react'; /** * immutable-devtools is a console custom formatter. diff --git a/website/src/repl/Repl.tsx b/website/src/repl/Repl.tsx index a3b5bc7060..8764f75f92 100644 --- a/website/src/repl/Repl.tsx +++ b/website/src/repl/Repl.tsx @@ -1,5 +1,6 @@ 'use client'; -import React, { useEffect, useRef, useState } from 'react'; +import dynamic from 'next/dynamic'; +import React, { useEffect, useRef, useState, type JSX } from 'react'; import { Editor } from './Editor'; import FormatterOutput from './FormatterOutput'; import './repl.css'; @@ -154,4 +155,6 @@ function Repl({ defaultValue }: Props): JSX.Element { ); } -export default Repl; +export default dynamic(() => Promise.resolve(Repl), { + ssr: false, +}); diff --git a/website/styles/globals.css b/website/styles/globals.css index 09e5cef431..b1efab8675 100644 --- a/website/styles/globals.css +++ b/website/styles/globals.css @@ -1,4 +1,4 @@ -@import url('//code.cdn.mozilla.net/fonts/fira.css'); +@import url('https://code.cdn.mozilla.net/fonts/fira.css'); :root { color-scheme: light dark; From d1136cd4046a85626dc116a9f879bd6cfccf15e9 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Sat, 19 Apr 2025 23:25:56 +0300 Subject: [PATCH 18/59] chore: update type tests (#2093) --- type-definitions/ts-tests/from-js.ts | 5 ++-- type-definitions/ts-tests/functional.ts | 4 ++-- type-definitions/ts-tests/list.ts | 4 ++-- type-definitions/ts-tests/map.ts | 30 ++++++++++++------------ type-definitions/ts-tests/ordered-map.ts | 2 +- type-definitions/ts-tests/record.ts | 6 ++--- 6 files changed, 26 insertions(+), 25 deletions(-) diff --git a/type-definitions/ts-tests/from-js.ts b/type-definitions/ts-tests/from-js.ts index 0ccc8ab5c4..f04a1e78f8 100644 --- a/type-definitions/ts-tests/from-js.ts +++ b/type-definitions/ts-tests/from-js.ts @@ -7,7 +7,7 @@ test('fromJS', () => { Collection >(); - expect(fromJS('abc')).type.toBeString(); + expect(fromJS('abc')).type.toBe(); expect(fromJS([0, 1, 2])).type.toBe>(); @@ -36,7 +36,8 @@ test('fromJS in an array of function', () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any const create = [(data: any) => data, fromJS][1]; - expect(create({ a: 'A' })).type.toBeAny(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + expect(create({ a: 'A' })).type.toBe(); // eslint-disable-next-line @typescript-eslint/no-explicit-any const createConst = ([(data: any) => data, fromJS] as const)[1]; diff --git a/type-definitions/ts-tests/functional.ts b/type-definitions/ts-tests/functional.ts index 3db5efcd09..01a8636c50 100644 --- a/type-definitions/ts-tests/functional.ts +++ b/type-definitions/ts-tests/functional.ts @@ -80,9 +80,9 @@ test('getIn', () => { }); test('has', () => { - expect(has([1, 2, 3], 0)).type.toBeBoolean(); + expect(has([1, 2, 3], 0)).type.toBe(); - expect(has({ x: 10, y: 20 }, 'x')).type.toBeBoolean(); + expect(has({ x: 10, y: 20 }, 'x')).type.toBe(); }); test('hasIn', () => { diff --git a/type-definitions/ts-tests/list.ts b/type-definitions/ts-tests/list.ts index d5014f9849..2b86dca369 100644 --- a/type-definitions/ts-tests/list.ts +++ b/type-definitions/ts-tests/list.ts @@ -179,7 +179,7 @@ test('#shift', () => { }); test('#update', () => { - expect(List().update((v) => 1)).type.toBeNumber(); + expect(List().update((v) => 1)).type.toBe(); expect( List().update((v: List | undefined) => v) @@ -398,6 +398,6 @@ test('for of loops', () => { const list = List([1, 2, 3, 4]); for (const val of list) { - expect(val).type.toBeNumber(); + expect(val).type.toBe(); } }); diff --git a/type-definitions/ts-tests/map.ts b/type-definitions/ts-tests/map.ts index 4503733ba2..59f39eb36c 100644 --- a/type-definitions/ts-tests/map.ts +++ b/type-definitions/ts-tests/map.ts @@ -55,21 +55,21 @@ test('#get', () => { expect(Map().get(4, 'a')).type.toRaiseError(); - expect(Map({ a: 4, b: true }).get('a')).type.toBeNumber(); + expect(Map({ a: 4, b: true }).get('a')).type.toBe(); - expect(Map({ a: 4, b: true }).get('b')).type.toBeBoolean(); + expect(Map({ a: 4, b: true }).get('b')).type.toBe(); expect( Map({ a: Map({ b: true }) }) .get('a') .get('b') - ).type.toBeBoolean(); + ).type.toBe(); expect(Map({ a: 4 }).get('b')).type.toRaiseError(); - expect(Map({ a: 4 }).get('b', undefined)).type.toBeUndefined(); + expect(Map({ a: 4 }).get('b', undefined)).type.toBe(); - expect(Map({ 1: 4 }).get(1)).type.toBeNumber(); + expect(Map({ 1: 4 }).get(1)).type.toBe(); expect(Map({ 1: 4 }).get(2)).type.toRaiseError(); @@ -77,7 +77,7 @@ test('#get', () => { const s1 = Symbol('s1'); - expect(Map({ [s1]: 4 }).get(s1)).type.toBeNumber(); + expect(Map({ [s1]: 4 }).get(s1)).type.toBe(); const s2 = Symbol('s2'); @@ -87,9 +87,9 @@ test('#get', () => { test('#getIn', () => { const result = Map({ a: 4, b: true }).getIn(['a']); - expect(result).type.toBeNumber(); + expect(result).type.toBe(); - expect(Map({ a: 4, b: true }).getIn(['a' as const])).type.toBeNumber(); + expect(Map({ a: 4, b: true }).getIn(['a' as const])).type.toBe(); expect( Map({ a: Map({ b: Map({ c: Map({ d: 4 }) }) }) }).getIn([ @@ -98,11 +98,11 @@ test('#getIn', () => { 'c' as const, 'd' as const, ]) - ).type.toBeNumber(); + ).type.toBe(); - expect(Map({ a: [1] }).getIn(['a' as const, 0])).type.toBeNumber(); + expect(Map({ a: [1] }).getIn(['a' as const, 0])).type.toBe(); - expect(Map({ a: List([1]) }).getIn(['a' as const, 0])).type.toBeNumber(); + expect(Map({ a: List([1]) }).getIn(['a' as const, 0])).type.toBe(); }); test('#set', () => { @@ -132,7 +132,7 @@ test('#set', () => { expect( Map<{ a: number; b?: string }>({ a: 1 }).set('b', 'b').get('a') - ).type.toBeNumber(); + ).type.toBe(); expect( Map<{ a: number; b?: string }>({ a: 1 }).set('b', 'b').get('b') @@ -154,7 +154,7 @@ test('#delete', () => { expect(Map().delete('a')).type.toRaiseError(); - expect(Map({ a: 1, b: 'b' }).delete('b')).type.toBeNever(); + expect(Map({ a: 1, b: 'b' }).delete('b')).type.toBe(); expect( Map<{ a: number; b?: string }>({ a: 1, b: 'b' }).delete('b') @@ -166,7 +166,7 @@ test('#delete', () => { expect( Map<{ a: number; b?: string }>({ a: 1, b: 'b' }).remove('b').get('a') - ).type.toBeNumber(); + ).type.toBe(); expect( Map<{ a: number; b?: string }>({ a: 1, b: 'b' }).remove('b').get('b') @@ -206,7 +206,7 @@ test('#clear', () => { }); test('#update', () => { - expect(Map().update((v) => 1)).type.toBeNumber(); + expect(Map().update((v) => 1)).type.toBe(); expect( Map().update((v: Map | undefined) => v) diff --git a/type-definitions/ts-tests/ordered-map.ts b/type-definitions/ts-tests/ordered-map.ts index e72d669495..56341ff76e 100644 --- a/type-definitions/ts-tests/ordered-map.ts +++ b/type-definitions/ts-tests/ordered-map.ts @@ -108,7 +108,7 @@ test('#clear', () => { }); test('#update', () => { - expect(OrderedMap().update((v) => 1)).type.toBeNumber(); + expect(OrderedMap().update((v) => 1)).type.toBe(); expect( OrderedMap().update( diff --git a/type-definitions/ts-tests/record.ts b/type-definitions/ts-tests/record.ts index 233caeeef0..bb2db4ee3a 100644 --- a/type-definitions/ts-tests/record.ts +++ b/type-definitions/ts-tests/record.ts @@ -34,9 +34,9 @@ test('Factory', () => { expect(point).type.toBe(); - expect(point.x).type.toBeNumber(); + expect(point.x).type.toBe(); - expect(point.y).type.toBeNumber(); + expect(point.y).type.toBe(); expect(point.setX(10)).type.toBe(); @@ -50,7 +50,7 @@ test('Factory', () => { test('.getDescriptiveName', () => { const PointXY = Record({ x: 0, y: 0 }); - expect(Record.getDescriptiveName(PointXY())).type.toBeString(); + expect(Record.getDescriptiveName(PointXY())).type.toBe(); expect(Record.getDescriptiveName({})).type.toRaiseError(); }); From c81ea7968f2815bf251de91674463a74828c127c Mon Sep 17 00:00:00 2001 From: Julien Deniau <1398469+jdeniau@users.noreply.github.com> Date: Sun, 20 Apr 2025 23:30:08 +0200 Subject: [PATCH 19/59] Encode code to / decode code from the URL hash. (#2096) --- website/src/app/play/Playground.tsx | 62 +++++++++++++++++++++++++++++ website/src/app/play/encoder.ts | 20 ++++++++++ website/src/app/play/page.tsx | 36 ++--------------- website/src/repl/Repl.tsx | 10 ++++- 4 files changed, 93 insertions(+), 35 deletions(-) create mode 100644 website/src/app/play/Playground.tsx create mode 100644 website/src/app/play/encoder.ts diff --git a/website/src/app/play/Playground.tsx b/website/src/app/play/Playground.tsx new file mode 100644 index 0000000000..8a6f346d7f --- /dev/null +++ b/website/src/app/play/Playground.tsx @@ -0,0 +1,62 @@ +'use client'; + +import Repl from '../../repl/Repl'; +import { stringToBytes, bytesToString } from './encoder'; + +export default function Playground() { + { + /* +Debug with: + +List([ + 'apple', + 'banana', + 'coconut', + 123, + null, + undefined, + new Date() +]) + .push('dragonfruit') + .map((fruit) => upperFirst(fruit)) + +*/ + } + + let decodedHash: string | null = null; + + try { + decodedHash = window.location.hash + ? bytesToString(window.location.hash.slice(1)) + : null; + } catch (e) { + console.warn('Error decoding hash', e); + } + + const defaultValue = + decodedHash ?? + `const upperFirst = (str) => typeof str === 'string' +? str.charAt(0).toUpperCase() + str.slice(1) +: str; + +List([ +'apple', +'banana', +'coconut', +]) +.push('dragonfruit') +.map((fruit) => upperFirst(fruit)) +`; + + return ( + { + const bytes = stringToBytes(code); + + // adds bytes as url hash + window.location.hash = bytes; + }} + /> + ); +} diff --git a/website/src/app/play/encoder.ts b/website/src/app/play/encoder.ts new file mode 100644 index 0000000000..d58c41aad3 --- /dev/null +++ b/website/src/app/play/encoder.ts @@ -0,0 +1,20 @@ +// taken from https://developer.mozilla.org/en-US/docs/Web/API/Window/btoa#unicode_strings +function base64ToBytes(base64: string): Uint8Array { + const binString = atob(base64); + return Uint8Array.from(binString, (m: string) => m.codePointAt(0) ?? 0); +} + +function bytesToBase64(bytes: Uint8Array): string { + const binString = Array.from(bytes, (byte) => + String.fromCodePoint(byte) + ).join(''); + return btoa(binString); +} + +export function stringToBytes(str: string): string { + return bytesToBase64(new TextEncoder().encode(str)); +} + +export function bytesToString(bytes: string): string { + return new TextDecoder().decode(base64ToBytes(bytes)); +} diff --git a/website/src/app/play/page.tsx b/website/src/app/play/page.tsx index bdee9f1cf6..b5599d9723 100644 --- a/website/src/app/play/page.tsx +++ b/website/src/app/play/page.tsx @@ -4,7 +4,7 @@ import { getTypeDefs } from '../../static/getTypeDefs'; import { DocSearch } from '../../DocSearch'; import { SideBar } from '../../Sidebar'; import { getSidebarLinks } from '../../getSidebarLinks'; -import Repl from '../../repl/Repl'; +import Playground from './Playground'; export async function generateStaticParams() { return [...getVersions().map((version) => ({ version }))]; @@ -29,38 +29,8 @@ export default function OverviewDocPage() {

Playgroud ({version})

- - {/* -Debug with: - -List([ - 'apple', - 'banana', - 'coconut', - 123, - null, - undefined, - new Date() -]) - .push('dragonfruit') - .map((fruit) => upperFirst(fruit)) - -*/} - - typeof str === 'string' - ? str.charAt(0).toUpperCase() + str.slice(1) - : str; - -List([ - 'apple', - 'banana', - 'coconut', -]) - .push('dragonfruit') - .map((fruit) => upperFirst(fruit)) -`} - /> + You can share or bookmark the url to get access to this playground. +
); diff --git a/website/src/repl/Repl.tsx b/website/src/repl/Repl.tsx index 8764f75f92..3c3c4b41a9 100644 --- a/website/src/repl/Repl.tsx +++ b/website/src/repl/Repl.tsx @@ -5,9 +5,9 @@ import { Editor } from './Editor'; import FormatterOutput from './FormatterOutput'; import './repl.css'; -type Props = { defaultValue: string }; +type Props = { defaultValue: string; onRun?: (code: string) => void }; -function Repl({ defaultValue }: Props): JSX.Element { +function Repl({ defaultValue, onRun }: Props): JSX.Element { const [code, setCode] = useState(defaultValue); const [output, setOutput] = useState<{ header: Array; @@ -125,6 +125,12 @@ function Repl({ defaultValue }: Props): JSX.Element { const runCode = () => { if (workerRef.current) { + // notify parent + if (onRun) { + onRun(code); + } + + // send message to worker workerRef.current.postMessage(code); workerRef.current.onmessage = (event) => { if (event.data.error) { From 96bb20388a6d2c8ce5809f18a017b57ef735d997 Mon Sep 17 00:00:00 2001 From: Julien Deniau <1398469+jdeniau@users.noreply.github.com> Date: Mon, 21 Apr 2025 23:58:49 +0200 Subject: [PATCH 20/59] extract repl worker script to a proper file (#2097) --- website/src/repl/Repl.tsx | 101 +------------------------- website/src/worker/index.ts | 99 +++++++++++++++++++++++++ website/src/worker/jsonml-types.ts | 29 ++++++++ website/src/worker/normalizeResult.ts | 36 +++++++++ 4 files changed, 168 insertions(+), 97 deletions(-) create mode 100644 website/src/worker/index.ts create mode 100644 website/src/worker/jsonml-types.ts create mode 100644 website/src/worker/normalizeResult.ts diff --git a/website/src/repl/Repl.tsx b/website/src/repl/Repl.tsx index 3c3c4b41a9..8b3c29d2b9 100644 --- a/website/src/repl/Repl.tsx +++ b/website/src/repl/Repl.tsx @@ -16,103 +16,10 @@ function Repl({ defaultValue, onRun }: Props): JSX.Element { const workerRef = useRef(null); useEffect(() => { - const workerScript = ` - importScripts('https://cdn.jsdelivr.net/npm/immutable@5.1.1', 'https://cdn.jsdelivr.net/npm/@jdeniau/immutable-devtools@0.2.0'); - - // extract all Immutable exports to have them available in the worker automatically - const { - version, - Collection, - Iterable, - Seq, - Map, - OrderedMap, - List, - Stack, - Set, - OrderedSet, - PairSorting, - Record, - Range, - Repeat, - is, - fromJS, - hash, - isImmutable, - isCollection, - isKeyed, - isIndexed, - isAssociative, - isOrdered, - isPlainObject, - isValueObject, - isSeq, - isList, - isMap, - isOrderedMap, - isStack, - isSet, - isOrderedSet, - isRecord, - get, - getIn, - has, - hasIn, - merge, - mergeDeep, - mergeWith, - mergeDeepWith, - remove, - removeIn, - set, - setIn, - update, - updateIn, - } = Immutable; - - immutableDevTools(Immutable); - - // hack to get the formatters from immutable-devtools as they are not exported, but they modify the "global" variable - const immutableFormaters = globalThis.devtoolsFormatters; - - // console.log(immutableFormaters) - - function normalizeResult(result) { - const formatter = immutableFormaters.find((formatter) => formatter.header(result)); - - if (!formatter) { - return undefined; - } - - return { - header: formatter.header(result), - body: formatter.hasBody(result) ? formatter.body(result) : undefined, - } - } - - self.onmessage = function(event) { - let timeoutId = setTimeout(() => { - self.postMessage({ error: "Execution timed out" }); - self.close(); - }, 2000); - - try { - const result = eval(event.data); - clearTimeout(timeoutId); - - self.postMessage({ output: normalizeResult(result) }); - } catch (error) { - console.log(error); - clearTimeout(timeoutId); - self.postMessage({ error: String(error) }); - } - }; - `; - - const workerBlob = new Blob([workerScript], { - type: 'application/javascript', - }); - workerRef.current = new Worker(URL.createObjectURL(workerBlob)); + // Create a worker from the external worker.js file + workerRef.current = new Worker( + new URL('../worker/index.ts', import.meta.url) + ); return () => { workerRef.current?.terminate(); diff --git a/website/src/worker/index.ts b/website/src/worker/index.ts new file mode 100644 index 0000000000..a668d3a19b --- /dev/null +++ b/website/src/worker/index.ts @@ -0,0 +1,99 @@ +/// +import type * as ImmutableModule from '../../../type-definitions/immutable.js'; +import normalizeResult, { DevToolsFormatter } from './normalizeResult'; + +// Declare Immutable and immutableDevTools as they come from external scripts +declare const Immutable: typeof ImmutableModule; + +declare function immutableDevTools(immutable: typeof ImmutableModule): void; + +// Declare globalThis.devtoolsFormatters +declare global { + // eslint-disable-next-line no-var + var devtoolsFormatters: DevToolsFormatter[]; +} + +importScripts( + 'https://cdn.jsdelivr.net/npm/immutable@5.1.1', + 'https://cdn.jsdelivr.net/npm/@jdeniau/immutable-devtools@0.2.0' +); + +// extract all Immutable exports to have them available in the worker automatically +/* eslint-disable @typescript-eslint/no-unused-vars */ +const { + // @ts-expect-error type is not exported but runtime is OK + version, + Collection, + // @ts-expect-error type is not exported but runtime is OK + // Note: Iterable is deprecated, alias for Collection + Iterable, + Seq, + Map, + OrderedMap, + List, + Stack, + Set, + OrderedSet, + PairSorting, + Record, + Range, + Repeat, + is, + fromJS, + hash, + isImmutable, + isCollection, + isKeyed, + isIndexed, + isAssociative, + isOrdered, + // @ts-expect-error type is not exported but runtime is OK + isPlainObject, + isValueObject, + isSeq, + isList, + isMap, + isOrderedMap, + isStack, + isSet, + isOrderedSet, + isRecord, + get, + getIn, + has, + hasIn, + merge, + mergeDeep, + mergeWith, + mergeDeepWith, + remove, + removeIn, + set, + setIn, + update, + updateIn, +} = Immutable; +/* eslint-enable @typescript-eslint/no-unused-vars */ + +immutableDevTools(Immutable); + +// hack to get the formatters from immutable-devtools as they are not exported, but they modify the "global" variable +const immutableFormaters = globalThis.devtoolsFormatters; + +self.onmessage = function (event) { + const timeoutId = setTimeout(() => { + self.postMessage({ error: 'Execution timed out' }); + self.close(); + }, 2000); + + try { + const result = eval(event.data); + clearTimeout(timeoutId); + + self.postMessage({ output: normalizeResult(immutableFormaters, result) }); + } catch (error) { + console.log(error); + clearTimeout(timeoutId); + self.postMessage({ error: String(error) }); + } +}; diff --git a/website/src/worker/jsonml-types.ts b/website/src/worker/jsonml-types.ts new file mode 100644 index 0000000000..4fe7b0c6bb --- /dev/null +++ b/website/src/worker/jsonml-types.ts @@ -0,0 +1,29 @@ +/** + * TypeScript types representing a JsonML grammar + * + * This represents a JSON-based markup language where elements are represented as arrays: + * - First element is the tag name + * - Second element (optional) is an attributes object + * - Remaining elements are children + */ + +// Basic types +type TagName = string; +type AttributeName = string; +type AttributeValue = string | number | boolean | null; + +// Attributes +// type Attribute = [AttributeName, AttributeValue]; +// type AttributeList = Attribute[]; +export type Attributes = Record; + +// Elements +export type Element = + | [TagName, Attributes, ...Element[]] // [tag-name, attributes, element-list] + | [TagName, Attributes] // [tag-name, attributes] + | [TagName, ...Element[]] // [tag-name, element-list] + | [TagName] // [tag-name] + | string; // string + +// Element list is just a list of elements +export type JsonMLElementList = Element[]; diff --git a/website/src/worker/normalizeResult.ts b/website/src/worker/normalizeResult.ts new file mode 100644 index 0000000000..6ae1453cad --- /dev/null +++ b/website/src/worker/normalizeResult.ts @@ -0,0 +1,36 @@ +import { JsonMLElementList } from './jsonml-types'; + +export interface DevToolsFormatter { + header: (obj: unknown) => JsonMLElementList | null; + hasBody: (obj: unknown) => boolean; + body: (obj: unknown) => JsonMLElementList | null; +} + +export interface ObjectForConsole { + header: JsonMLElementList | null; + body: JsonMLElementList | null; +} + +// console.log(immutableFormaters) +export default function normalizeResult( + immutableFormaters: Array, + result: unknown +): ObjectForConsole { + const formatter = immutableFormaters.find((formatter) => + formatter.header(result) + ); + + if (!formatter) { + return { + header: ['span', JSON.stringify(result)], + body: null, + }; + } + + const body = formatter.hasBody(result) ? formatter.body(result) : null; + + return { + header: formatter.header(result), + body, + }; +} From 8561fcbb90a769269e3265bc8868e306cb8d7f82 Mon Sep 17 00:00:00 2001 From: Julien Deniau <1398469+jdeniau@users.noreply.github.com> Date: Mon, 28 Apr 2025 08:58:29 +0200 Subject: [PATCH 21/59] Deep formatter in playground (#2099) --- eslint.config.mjs | 2 +- jest.config.mjs | 2 +- package-lock.json | 14 +++ package.json | 1 + website/src/repl/FormatterOutput.tsx | 24 +---- website/src/repl/Repl.tsx | 16 +-- website/src/worker/jsonml-types.test.ts | 104 ++++++++++++++++++ website/src/worker/jsonml-types.ts | 55 +++++++++- website/src/worker/normalizeResult.test.ts | 117 +++++++++++++++++++++ website/src/worker/normalizeResult.ts | 90 ++++++++++++---- 10 files changed, 375 insertions(+), 50 deletions(-) create mode 100644 website/src/worker/jsonml-types.test.ts create mode 100644 website/src/worker/normalizeResult.test.ts diff --git a/eslint.config.mjs b/eslint.config.mjs index 5f9dcd489b..f75f25580e 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -112,7 +112,7 @@ export default tseslint.config( }, { - files: ['__tests__/**/*', 'perf/*'], + files: ['__tests__/**/*', 'website/**/*.test.ts', 'perf/*'], languageOptions: { globals: pluginJest.environments.globals.globals, }, diff --git a/jest.config.mjs b/jest.config.mjs index 1aaace83c6..4bbd44198b 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -5,7 +5,7 @@ const config = { transform: { '^.+\\.(js|ts)$': '/resources/jestPreprocessor.js', }, - testRegex: '/__tests__/.*\\.(ts|js)$', + testRegex: ['/__tests__/.*\\.(ts|js)$', '/website/.*\\.test\\.(ts|js)$'], testPathIgnorePatterns: ['/__tests__/ts-utils.ts'], }; diff --git a/package-lock.json b/package-lock.json index f2b6158e85..3fd7f4fc65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "@codemirror/theme-one-dark": "^6.1.2", "@codemirror/view": "^6.36.5", "@eslint/js": "^9.20.0", + "@jdeniau/immutable-devtools": "^0.2.0", "@jest/globals": "^29.7.0", "@rollup/plugin-buble": "1.0.3", "@rollup/plugin-commonjs": "28.0.2", @@ -1925,6 +1926,13 @@ "node": ">=8" } }, + "node_modules/@jdeniau/immutable-devtools": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@jdeniau/immutable-devtools/-/immutable-devtools-0.2.0.tgz", + "integrity": "sha512-kncZLhyszWkGz0wAr8eoHFvhczuZz5Ud71OiLIhe5PFQ05nnLgsFdr520Qy+eHhMSL6roJYFrZ73ZJTv48/fUg==", + "dev": true, + "license": "BSD" + }, "node_modules/@jest/console": { "version": "29.6.4", "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.6.4.tgz", @@ -12931,6 +12939,12 @@ "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true }, + "@jdeniau/immutable-devtools": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@jdeniau/immutable-devtools/-/immutable-devtools-0.2.0.tgz", + "integrity": "sha512-kncZLhyszWkGz0wAr8eoHFvhczuZz5Ud71OiLIhe5PFQ05nnLgsFdr520Qy+eHhMSL6roJYFrZ73ZJTv48/fUg==", + "dev": true + }, "@jest/console": { "version": "29.6.4", "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.6.4.tgz", diff --git a/package.json b/package.json index baa0b4ab79..64c465f074 100644 --- a/package.json +++ b/package.json @@ -89,6 +89,7 @@ "@codemirror/theme-one-dark": "^6.1.2", "@codemirror/view": "^6.36.5", "@eslint/js": "^9.20.0", + "@jdeniau/immutable-devtools": "^0.2.0", "@jest/globals": "^29.7.0", "@rollup/plugin-buble": "1.0.3", "@rollup/plugin-commonjs": "28.0.2", diff --git a/website/src/repl/FormatterOutput.tsx b/website/src/repl/FormatterOutput.tsx index 3d96966ec1..a27b9d44d1 100644 --- a/website/src/repl/FormatterOutput.tsx +++ b/website/src/repl/FormatterOutput.tsx @@ -1,5 +1,6 @@ import { toHTML } from 'jsonml-html'; import { useEffect, useRef, type JSX } from 'react'; +import { Element, JsonMLElementList } from '../worker/jsonml-types'; /** * immutable-devtools is a console custom formatter. @@ -8,17 +9,13 @@ import { useEffect, useRef, type JSX } from 'react'; * The `jsonml-html` package can convert jsonml to HTML. */ type Props = { - output: { - header: Array; - body?: Array; - }; + output: JsonMLElementList | Element; }; export default function FormatterOutput({ output }: Props): JSX.Element { const header = useRef(null); - const body = useRef(null); - const htmlHeader = toHTML(output.header); + const htmlHeader = toHTML(output); useEffect(() => { if (header.current && htmlHeader) { @@ -26,18 +23,5 @@ export default function FormatterOutput({ output }: Props): JSX.Element { } }, [htmlHeader]); - const htmlBody = output.body ? toHTML(output.body) : null; - - useEffect(() => { - if (body.current) { - body.current.replaceChildren(htmlBody ?? ''); - } - }, [htmlBody]); - - return ( - <> -
-
- - ); + return
; } diff --git a/website/src/repl/Repl.tsx b/website/src/repl/Repl.tsx index 8b3c29d2b9..dc5f7868ec 100644 --- a/website/src/repl/Repl.tsx +++ b/website/src/repl/Repl.tsx @@ -4,15 +4,13 @@ import React, { useEffect, useRef, useState, type JSX } from 'react'; import { Editor } from './Editor'; import FormatterOutput from './FormatterOutput'; import './repl.css'; +import { Element, JsonMLElementList } from '../worker/jsonml-types'; type Props = { defaultValue: string; onRun?: (code: string) => void }; function Repl({ defaultValue, onRun }: Props): JSX.Element { const [code, setCode] = useState(defaultValue); - const [output, setOutput] = useState<{ - header: Array; - body?: Array; - }>({ header: [] }); + const [output, setOutput] = useState([]); const workerRef = useRef(null); useEffect(() => { @@ -41,9 +39,15 @@ function Repl({ defaultValue, onRun }: Props): JSX.Element { workerRef.current.postMessage(code); workerRef.current.onmessage = (event) => { if (event.data.error) { - setOutput({ header: ['div', 'Error: ' + event.data.error] }); + setOutput(['div', 'Error: ' + event.data.error]); } else { - setOutput(event.data.output); + const { output } = event.data; + + if (typeof output === 'object' && !Array.isArray(output)) { + setOutput(['div', { object: output }]); + } else { + setOutput(output); + } } }; } diff --git a/website/src/worker/jsonml-types.test.ts b/website/src/worker/jsonml-types.test.ts new file mode 100644 index 0000000000..07426d8c42 --- /dev/null +++ b/website/src/worker/jsonml-types.test.ts @@ -0,0 +1,104 @@ +import { describe, it, expect } from '@jest/globals'; +import { Element, explodeElement } from './jsonml-types'; + +describe('explodeElement', () => { + it('should explode an element', () => { + expect(explodeElement(['div'])).toEqual({ + tagName: 'div', + attributes: undefined, + children: [], + }); + }); + + it('should explode an element with attributes', () => { + expect(explodeElement(['div', { id: 'test' }])).toEqual({ + tagName: 'div', + attributes: { id: 'test' }, + children: [], + }); + }); + + it('should explode an element with children', () => { + expect(explodeElement(['div', { id: 'test' }, 'Hello'])).toEqual({ + tagName: 'div', + attributes: { id: 'test' }, + children: ['Hello'], + }); + }); + + it('should explode an element with multiple children', () => { + expect(explodeElement(['div', { id: 'test' }, 'Hello', 'World'])).toEqual({ + tagName: 'div', + attributes: { id: 'test' }, + children: ['Hello', 'World'], + }); + }); + + it('should explode an element without attributes with multiple children', () => { + expect(explodeElement(['div', 'Hello', 'World'])).toEqual({ + tagName: 'div', + attributes: undefined, + children: ['Hello', 'World'], + }); + }); + + it('should explode an element with a nested element', () => { + expect(explodeElement(['div', { id: 'test' }, ['span', 'Hello']])).toEqual({ + tagName: 'div', + attributes: { id: 'test' }, + children: [['span', 'Hello']], + }); + }); + + it('should explode an element with a nested element with attributes', () => { + expect( + explodeElement([ + 'div', + { id: 'test' }, + ['span', { class: 'test' }, 'Hello'], + ]) + ).toEqual({ + tagName: 'div', + attributes: { id: 'test' }, + children: [['span', { class: 'test' }, 'Hello']], + }); + }); + + it('should explode an element with a nested element with multiple children', () => { + expect( + explodeElement([ + 'div', + { id: 'test' }, + ['span', 'Hello'], + ['span', { id: 'world' }, 'World'], + ]) + ).toEqual({ + tagName: 'div', + attributes: { id: 'test' }, + children: [ + ['span', 'Hello'], + ['span', { id: 'world' }, 'World'], + ], + }); + }); + + it('should handle immutable list jsonml', () => { + const spanElement: Element = [ + 'span', + { style: 'color: light-dark( #881391, #D48CE6)' }, + '0: ', + ]; + const objectElement: Element = ['object', { object: ['a'] }]; + + const element: Element = ['li', spanElement, objectElement]; + + expect(explodeElement(element)).toEqual({ + tagName: 'li', + attributes: undefined, + children: [ + ['span', { style: 'color: light-dark( #881391, #D48CE6)' }, '0: '], + ['object', { object: ['a'] }], + ], + }); + }); +}); diff --git a/website/src/worker/jsonml-types.ts b/website/src/worker/jsonml-types.ts index 4fe7b0c6bb..1eadcef8e6 100644 --- a/website/src/worker/jsonml-types.ts +++ b/website/src/worker/jsonml-types.ts @@ -10,20 +10,67 @@ // Basic types type TagName = string; type AttributeName = string; -type AttributeValue = string | number | boolean | null; +type AttributeValue = string | number | boolean | null | object; // Attributes // type Attribute = [AttributeName, AttributeValue]; // type AttributeList = Attribute[]; export type Attributes = Record; +type ElementWithAttributes = + | [TagName, Attributes, ...Element[]] // [tag-name, attributes, element-list] + | [TagName, Attributes]; // [tag-name, attributes] + // Elements export type Element = - | [TagName, Attributes, ...Element[]] // [tag-name, attributes, element-list] - | [TagName, Attributes] // [tag-name, attributes] + | ElementWithAttributes | [TagName, ...Element[]] // [tag-name, element-list] | [TagName] // [tag-name] | string; // string // Element list is just a list of elements -export type JsonMLElementList = Element[]; +export type JsonMLElementList = Array; + +export function isElement(maybeElement: unknown): maybeElement is Element { + return ( + typeof maybeElement === 'string' || + (Array.isArray(maybeElement) && + maybeElement.length >= 1 && + typeof maybeElement[0] === 'string') + ); +} + +function hasAttributes( + maybeElementWithAttributes: Element +): maybeElementWithAttributes is ElementWithAttributes { + return ( + Array.isArray(maybeElementWithAttributes) && + typeof maybeElementWithAttributes[1] === 'object' && + !Array.isArray(maybeElementWithAttributes[1]) + ); +} + +type ExplodedElement = { + tagName: TagName; + attributes?: Attributes; + children: Element[]; +}; + +export function explodeElement(element: Element): ExplodedElement { + if (typeof element === 'string') { + return { tagName: element, children: [] }; + } + + if (hasAttributes(element)) { + const [tagName, attributes, ...children] = element; + + return { tagName, attributes, children }; + } + + const [tagName, attributes, ...children] = element; + + return { + tagName, + children: [attributes, ...children].filter(isElement), + }; +} diff --git a/website/src/worker/normalizeResult.test.ts b/website/src/worker/normalizeResult.test.ts new file mode 100644 index 0000000000..c46f512204 --- /dev/null +++ b/website/src/worker/normalizeResult.test.ts @@ -0,0 +1,117 @@ +import { describe, it, expect } from '@jest/globals'; +// @ts-expect-error immutable is loaded automatically +import * as Immutable from 'immutable'; +import normalizeResult from './normalizeResult'; + +// eslint-disable-next-line @typescript-eslint/no-require-imports -- import does not work +const installDevTools = require('@jdeniau/immutable-devtools'); + +installDevTools(Immutable); + +// hack to get the formatters from immutable-devtools as they are not exported, but they modify the "global" variable +const immutableFormaters = globalThis.devtoolsFormatters; + +describe('normalizeResult', () => { + it('should return the correct object', () => { + const result = normalizeResult(immutableFormaters, { a: 1, b: 2 }); + + expect(result).toEqual(JSON.stringify({ a: 1, b: 2 })); + }); + + it('should return the correct object for a list', () => { + const result = normalizeResult(immutableFormaters, Immutable.List(['a'])); + + expect(result).toEqual([ + 'span', + [ + 'span', + [ + 'span', + { + style: + 'color: light-dark(rgb(232,98,0), rgb(255, 150, 50)); position: relative', + }, + 'List', + ], + ['span', '[1]'], + ], + [ + 'ol', + { + style: + 'list-style-type: none; padding: 0; margin: 0 0 0 12px; font-style: normal; position: relative', + }, + [ + 'li', + ['span', { style: 'color: light-dark( #881391, #D48CE6)' }, '0: '], + ['object', { object: 'a', config: undefined }], + ], + ], + ]); + }); + + it('should return the correct object for a deep list', () => { + const result = normalizeResult( + immutableFormaters, + Immutable.List([Immutable.List(['a'])]) + ); + + expect(result).toEqual([ + 'span', + [ + 'span', + [ + 'span', + { + style: + 'color: light-dark(rgb(232,98,0), rgb(255, 150, 50)); position: relative', + }, + 'List', + ], + ['span', '[1]'], + ], + [ + 'ol', + { + style: + 'list-style-type: none; padding: 0; margin: 0 0 0 12px; font-style: normal; position: relative', + }, + [ + 'li', + ['span', { style: 'color: light-dark( #881391, #D48CE6)' }, '0: '], + [ + 'span', + [ + 'span', + [ + 'span', + { + style: + 'color: light-dark(rgb(232,98,0), rgb(255, 150, 50)); position: relative', + }, + 'List', + ], + ['span', '[1]'], + ], + [ + 'ol', + { + style: + 'list-style-type: none; padding: 0; margin: 0 0 0 12px; font-style: normal; position: relative', + }, + [ + 'li', + [ + 'span', + { style: 'color: light-dark( #881391, #D48CE6)' }, + '0: ', + ], + ['object', { object: 'a', config: undefined }], + ], + ], + ], + ], + ], + ]); + }); +}); diff --git a/website/src/worker/normalizeResult.ts b/website/src/worker/normalizeResult.ts index 6ae1453cad..f341ed4de7 100644 --- a/website/src/worker/normalizeResult.ts +++ b/website/src/worker/normalizeResult.ts @@ -1,4 +1,9 @@ -import { JsonMLElementList } from './jsonml-types'; +import { + Element, + explodeElement, + isElement, + JsonMLElementList, +} from './jsonml-types'; export interface DevToolsFormatter { header: (obj: unknown) => JsonMLElementList | null; @@ -6,31 +11,80 @@ export interface DevToolsFormatter { body: (obj: unknown) => JsonMLElementList | null; } -export interface ObjectForConsole { - header: JsonMLElementList | null; - body: JsonMLElementList | null; +function getFormatter( + immutableFormaters: Array, + result: unknown +) { + return immutableFormaters.find((formatter) => formatter.header(result)); } -// console.log(immutableFormaters) export default function normalizeResult( immutableFormaters: Array, result: unknown -): ObjectForConsole { - const formatter = immutableFormaters.find((formatter) => - formatter.header(result) - ); +): JsonMLElementList | Element { + const formatter = getFormatter(immutableFormaters, result); if (!formatter) { - return { - header: ['span', JSON.stringify(result)], - body: null, - }; + if (Array.isArray(result) && result[0] === 'object' && result[1]?.object) { + // handle special case for deep objects + const objectFormatter = getFormatter( + immutableFormaters, + result[1].object + ); + + if (objectFormatter) { + return normalizeResult(immutableFormaters, result[1].object); + } + } + + if (typeof result !== 'string' && isElement(result)) { + return normalizeElement(immutableFormaters, result); + } + + if (typeof result === 'string') { + return result; + } + + return JSON.stringify(result); + } + + const header = formatter.header(result) ?? []; + + let body: JsonMLElementList | null = formatter.hasBody(result) + ? formatter.body(result) + : null; + + if (body) { + body = body.map((item) => normalizeElement(immutableFormaters, item)); } - const body = formatter.hasBody(result) ? formatter.body(result) : null; + return ['span', header, body ?? []]; +} + +function normalizeElement( + immutableFormaters: Array, + item: Element | JsonMLElementList +): Element | JsonMLElementList { + if (!Array.isArray(item)) { + return item; + } + + if (!isElement(item)) { + return item; + } + + const explodedItem = explodeElement(item); + + const { tagName, attributes, children } = explodedItem; + + const normalizedChildren = children.map((child) => + normalizeResult(immutableFormaters, child) + ); + + if (attributes) { + // @ts-expect-error type is not perfect here because of self-reference + return [tagName, attributes, ...normalizedChildren]; + } - return { - header: formatter.header(result), - body, - }; + return [tagName, ...normalizedChildren]; } From 009229d4d7670f06a73c33a2d6eb0ea142aeb1c9 Mon Sep 17 00:00:00 2001 From: Christoph Gruber Date: Wed, 30 Apr 2025 11:14:13 +0200 Subject: [PATCH 22/59] Revert previous assertion as it introduced a regression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems reasonable to assert that keys shouldn't be undefined, since keys are supposed to be of type PropertyKey (string | number | symbol). But in practice, JavaScript allows undefined as a key by implicitly converting it to the string "undefined". This caused a regression specifically in the `groupBy` function, where the grouper callback can return undefined for some items. That behavior was previously supported and is now broken by the assertion. Long-term, it probably makes sense to tighten this up and only allow real PropertyKeys, but that’ll need a more careful cleanup. --- __tests__/groupBy.ts | 7 +++++++ src/functional/updateIn.ts | 14 +++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/__tests__/groupBy.ts b/__tests__/groupBy.ts index 020a5d373a..bfaba132df 100644 --- a/__tests__/groupBy.ts +++ b/__tests__/groupBy.ts @@ -75,6 +75,13 @@ describe('groupBy', () => { expect(group.toJS()).toEqual({ odd: [1, 3, 5], even: [2, 4, 6] }); }); + it('allows `undefined` as a key', () => { + const group = Seq([1, 2, 3, 4, 5, 6]).groupBy((x) => + x % 2 ? undefined : 'even' + ); + expect(group.toJS()).toEqual({ undefined: [1, 3, 5], even: [2, 4, 6] }); + }); + it('groups indexed sequences, maintaining indicies when keyed sequences', () => { const group = Seq([1, 2, 3, 4, 5, 6]).groupBy((x) => x % 2); diff --git a/src/functional/updateIn.ts b/src/functional/updateIn.ts index eab7df0b00..3bc8e9d7a5 100644 --- a/src/functional/updateIn.ts +++ b/src/functional/updateIn.ts @@ -180,13 +180,11 @@ function updateInDeeply< } const key = keyPath[i]; - if (typeof key === 'undefined') { - throw new TypeError( - 'Index can not be undefined in updateIn(). This should not happen' - ); - } + const nextExisting = wasNotSet + ? NOT_SET + : // @ts-expect-error key might be undefined which is not allowed in the type but works in practice + get(existing, key, NOT_SET); - const nextExisting = wasNotSet ? NOT_SET : get(existing, key, NOT_SET); const nextUpdated = updateInDeeply( nextExisting === NOT_SET ? inImmutable : isImmutable(nextExisting), // @ts-expect-error mixed type @@ -196,10 +194,12 @@ function updateInDeeply< notSetValue, updater ); + return nextUpdated === nextExisting ? existing : nextUpdated === NOT_SET - ? remove(existing, key) + ? // @ts-expect-error key might be undefined which is not allowed in the type but works in practice + remove(existing, key) : set( wasNotSet ? (inImmutable ? emptyMap() : {}) : existing, key, From 435adeebd673b7acd545bc14b0063cf2f627368a Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Mon, 5 May 2025 21:33:18 +0000 Subject: [PATCH 23/59] Use "unknown" as type for key path instead of "PropertyKey" --- src/functional/get.ts | 4 +-- src/functional/remove.ts | 6 +++-- src/functional/updateIn.ts | 47 ++++++++++----------------------- type-definitions/immutable.d.ts | 2 +- 4 files changed, 21 insertions(+), 38 deletions(-) diff --git a/src/functional/get.ts b/src/functional/get.ts index 94171ccb55..e6306b8f58 100644 --- a/src/functional/get.ts +++ b/src/functional/get.ts @@ -49,12 +49,12 @@ export function get( key: string, notSetValue: NSV ): V | NSV; -export function get( +export function get( collection: Collection | Array | { [key: string]: V }, key: K, notSetValue?: NSV ): V | NSV; -export function get( +export function get( collection: Collection | Array | { [key: string]: V }, key: K, notSetValue?: NSV diff --git a/src/functional/remove.ts b/src/functional/remove.ts index a562864b82..60aff0fa36 100644 --- a/src/functional/remove.ts +++ b/src/functional/remove.ts @@ -39,13 +39,13 @@ export function remove< K extends keyof C, >(collection: C, key: K): C; export function remove< - K extends PropertyKey, + K, C extends | Collection | Array | { [key: PropertyKey]: unknown }, >(collection: C, key: K): C; -export function remove( +export function remove( collection: | Collection | Array @@ -67,6 +67,7 @@ export function remove( // @ts-expect-error weird "remove" here, return collection.remove(key); } + // @ts-expect-error assert that key is a string, a number or a symbol here if (!hasOwnProperty.call(collection, key)) { return collection; } @@ -75,6 +76,7 @@ export function remove( // @ts-expect-error assert that key is a number here collectionCopy.splice(key, 1); } else { + // @ts-expect-error assert that key is a string, a number or a symbol here delete collectionCopy[key]; } return collectionCopy; diff --git a/src/functional/updateIn.ts b/src/functional/updateIn.ts index 3bc8e9d7a5..99eed7980e 100644 --- a/src/functional/updateIn.ts +++ b/src/functional/updateIn.ts @@ -36,24 +36,19 @@ export type PossibleCollection = | Record | Array; -type UpdaterFunction = ( +type UpdaterFunction = ( value: RetrievePath> | undefined ) => unknown | undefined; -type UpdaterFunctionWithNSV = ( +type UpdaterFunctionWithNSV = ( value: RetrievePath> | NSV ) => unknown; -export function updateIn>( +export function updateIn>( collection: C, keyPath: KeyPath, updater: UpdaterFunction ): C; -export function updateIn< - K extends PropertyKey, - V, - C extends Collection, - NSV, ->( +export function updateIn, NSV>( collection: C, keyPath: KeyPath, notSetValue: NSV, @@ -75,43 +70,34 @@ export function updateIn< notSetValue: NSV, updater: UpdaterFunctionWithNSV ): C; -export function updateIn>( +export function updateIn>( collection: C, keyPath: KeyPath, updater: UpdaterFunction ): Array; -export function updateIn, NSV>( +export function updateIn, NSV>( collection: C, keyPath: KeyPath, notSetValue: NSV, updater: UpdaterFunctionWithNSV ): Array; -export function updateIn( +export function updateIn( object: C, keyPath: KeyPath, updater: UpdaterFunction ): C; -export function updateIn( +export function updateIn( object: C, keyPath: KeyPath, notSetValue: NSV, updater: UpdaterFunctionWithNSV ): C; -export function updateIn< - K extends PropertyKey, - V, - C extends { [key: PropertyKey]: V }, ->( +export function updateIn( collection: C, keyPath: KeyPath, updater: UpdaterFunction ): { [key: PropertyKey]: V }; -export function updateIn< - K extends PropertyKey, - V, - C extends { [key: PropertyKey]: V }, - NSV, ->( +export function updateIn( collection: C, keyPath: KeyPath, notSetValue: NSV, @@ -119,7 +105,7 @@ export function updateIn< ): { [key: PropertyKey]: V }; export function updateIn< - K extends PropertyKey, + K, V, TProps extends object, C extends PossibleCollection, @@ -150,7 +136,7 @@ export function updateIn< } function updateInDeeply< - K extends PropertyKey, + K, TProps extends object, C extends PossibleCollection, NSV, @@ -180,11 +166,7 @@ function updateInDeeply< } const key = keyPath[i]; - const nextExisting = wasNotSet - ? NOT_SET - : // @ts-expect-error key might be undefined which is not allowed in the type but works in practice - get(existing, key, NOT_SET); - + const nextExisting = wasNotSet ? NOT_SET : get(existing, key, NOT_SET); const nextUpdated = updateInDeeply( nextExisting === NOT_SET ? inImmutable : isImmutable(nextExisting), // @ts-expect-error mixed type @@ -198,8 +180,7 @@ function updateInDeeply< return nextUpdated === nextExisting ? existing : nextUpdated === NOT_SET - ? // @ts-expect-error key might be undefined which is not allowed in the type but works in practice - remove(existing, key) + ? remove(existing, key) : set( wasNotSet ? (inImmutable ? emptyMap() : {}) : existing, key, diff --git a/type-definitions/immutable.d.ts b/type-definitions/immutable.d.ts index 622fb01cfa..331dc2c6a8 100644 --- a/type-definitions/immutable.d.ts +++ b/type-definitions/immutable.d.ts @@ -949,7 +949,7 @@ declare namespace Immutable { never; /** @ignore */ - type RetrievePath> = P extends [] + type RetrievePath> = P extends [] ? P : RetrievePathReducer, Tail

>; From d51af778d4370286e3b6109c33cb042d515ae061 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Mon, 5 May 2025 22:11:52 +0000 Subject: [PATCH 24/59] Merge should work with empty record --- __tests__/merge.ts | 17 +++++++++++++++++ src/methods/merge.js | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/__tests__/merge.ts b/__tests__/merge.ts index 00254a4be7..14e934b4c0 100644 --- a/__tests__/merge.ts +++ b/__tests__/merge.ts @@ -329,4 +329,21 @@ describe('merge', () => { const b = Map({ a: Map([[0, Map({ y: 2 })]]) }); expect(mergeDeep(a, b)).toEqual({ a: Map([[0, Map({ y: 2 })]]) }); }); + + it('works with an empty Record', () => { + class MyRecord extends Record({ a: 1 }) {} + + const myRecord = new MyRecord(); + expect(merge(myRecord, { a: 4 })).toEqual( + new MyRecord({ + a: 4, + }) + ); + + class MyEmptyRecord extends Record({}) {} + + const myEmptyRecord = new MyEmptyRecord(); + // merging with an empty record should return the same empty record instance + expect(merge(myEmptyRecord, { a: 4 })).toBe(myEmptyRecord); + }); }); diff --git a/src/methods/merge.js b/src/methods/merge.js index bf627eaaa8..427f7c466c 100644 --- a/src/methods/merge.js +++ b/src/methods/merge.js @@ -1,6 +1,7 @@ import { KeyedCollection } from '../Collection'; import { NOT_SET } from '../TrieUtils'; import { update } from '../functional/update'; +import { isRecord } from '../predicates/isRecord'; export function merge(...iters) { return mergeIntoKeyedWith(this, iters); @@ -29,7 +30,9 @@ function mergeIntoKeyedWith(collection, collections, merger) { !collection.__ownerID && iters.length === 1 ) { - return collection.constructor(iters[0]); + return isRecord(collection) + ? collection // Record is empty and will not be updated: return the same instance + : collection.constructor(iters[0]); } return collection.withMutations((collection) => { const mergeIntoCollection = merger From d5bae7677bbc853e025984b5d0ca57603c86946f Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Mon, 5 May 2025 22:23:07 +0000 Subject: [PATCH 25/59] changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c54b7d1d9b..9df8e0fce0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ Dates are formatted as YYYY-MM-DD. ## Unreleased +## 5.1.2 + +- Revert previous assertion as it introduced a regression [#2102](https://github.com/immutable-js/immutable-js/pull/2102) by [@giggo1604](https://github.com/giggo1604) +- Merge should work with empty record [#2103](https://github.com/immutable-js/immutable-js/pull/2103) by [@jdeniau](https://github.com/jdeniau) + ## 5.1.1 - Fix type copying From e8106161fea7256d6f390dc646a2920473c2fd7b Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Mon, 5 May 2025 22:24:25 +0000 Subject: [PATCH 26/59] 5.1.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3fd7f4fc65..8e728752a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "immutable", - "version": "5.1.1", + "version": "5.1.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "immutable", - "version": "5.1.1", + "version": "5.1.2", "license": "MIT", "devDependencies": { "@codemirror/commands": "^6.8.1", diff --git a/package.json b/package.json index 64c465f074..e773736d96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "immutable", - "version": "5.1.1", + "version": "5.1.2", "description": "Immutable Data Collections", "license": "MIT", "homepage": "https://immutable-js.com", From 21de70105306f28edfdeb044b885c3b2cabc7064 Mon Sep 17 00:00:00 2001 From: Julien Deniau <1398469+jdeniau@users.noreply.github.com> Date: Fri, 23 May 2025 23:47:52 +0200 Subject: [PATCH 27/59] Doc as mdx instead of export from .d.ts file (#2104) --- package-lock.json | 5402 +++++++++++++---- package.json | 11 +- type-definitions/immutable.d.ts | 2 - website/docs/Collection.Indexed.mdx | 793 +++ website/docs/Collection.Keyed.mdx | 883 +++ website/docs/Collection.Set.mdx | 765 +++ website/docs/Collection.mdx | 817 +++ website/docs/Intro.mdx | 90 + website/docs/List.mdx | 1277 ++++ website/docs/Map.mdx | 1320 ++++ website/docs/OrderedCollection.mdx | 22 + website/docs/OrderedSet.mdx | 38 + website/docs/OrdererMap.mdx | 49 + website/docs/Range().mdx | 17 + website/docs/Record.Factory.mdx | 46 + website/docs/Record.mdx | 303 + website/docs/Repeat().mdx | 16 + website/docs/Seq.Indexed.mdx | 789 +++ website/docs/Seq.Keyed.mdx | 889 +++ website/docs/Seq.Set.mdx | 744 +++ website/docs/Seq.mdx | 996 +++ website/docs/Set.mdx | 860 +++ website/docs/Stack.mdx | 847 +++ website/docs/ValueObject.mdx | 49 + website/docs/fromJS().mdx | 80 + website/docs/get().mdx | 16 + website/docs/getIn().mdx | 15 + website/docs/has().mdx | 15 + website/docs/hasIn().mdx | 13 + website/docs/hash().mdx | 27 + website/docs/is().mdx | 30 + website/docs/isAssociative().mdx | 19 + website/docs/isCollection().mdx | 18 + website/docs/isImmutable().mdx | 20 + website/docs/isIndexed().mdx | 19 + website/docs/isKeyed().mdx | 17 + website/docs/isList().mdx | 8 + website/docs/isMap().mdx | 10 + website/docs/isOrdered().mdx | 19 + website/docs/isOrderedMap().mdx | 8 + website/docs/isOrderedSet().mdx | 8 + website/docs/isRecord().mdx | 8 + website/docs/isSeq().mdx | 8 + website/docs/isSet().mdx | 10 + website/docs/isStack().mdx | 8 + website/docs/isValueObject().mdx | 10 + website/docs/merge().mdx | 17 + website/docs/mergeDeep().mdx | 26 + website/docs/mergeDeepWith().mdx | 28 + website/docs/mergeWith().mdx | 17 + website/docs/remove().mdx | 20 + website/docs/removeIn().mdx | 15 + website/docs/set().mdx | 20 + website/docs/setIn().mdx | 15 + website/docs/update().mdx | 20 + website/docs/updateIn().mdx | 12 + website/next.config.js | 6 - website/next.config.mjs | 18 + website/src/Sidebar.tsx | 5 +- website/src/TypeDocumentation.tsx | 4 +- .../src/app/docs/[version]/[type]/page.tsx | 4 +- website/src/app/docs/[version]/page.tsx | 6 +- website/src/app/docs/currentVersion.tsx | 261 + website/src/app/docs/v5/[type]/page.tsx | 38 + website/src/app/docs/v5/layout.tsx | 32 + website/src/app/docs/v5/page.tsx | 36 + website/src/app/play/page.tsx | 16 +- website/src/mdx-components.tsx | 78 + website/src/mdx-components/CodeLink.tsx | 18 + website/src/repl/Editor.tsx | 23 +- website/src/repl/FormatterOutput.tsx | 4 +- website/src/repl/Repl.tsx | 34 +- website/src/repl/repl.css | 8 +- website/src/static/genMarkdownDoc.ts | 21 +- website/src/static/getVersions.js | 48 +- website/src/utils/doc.tsx | 26 + website/src/worker/index.ts | 41 +- website/styles/globals.css | 44 +- website/tsconfig.json | 5 + 79 files changed, 17125 insertions(+), 1252 deletions(-) create mode 100644 website/docs/Collection.Indexed.mdx create mode 100644 website/docs/Collection.Keyed.mdx create mode 100644 website/docs/Collection.Set.mdx create mode 100644 website/docs/Collection.mdx create mode 100644 website/docs/Intro.mdx create mode 100644 website/docs/List.mdx create mode 100644 website/docs/Map.mdx create mode 100644 website/docs/OrderedCollection.mdx create mode 100644 website/docs/OrderedSet.mdx create mode 100644 website/docs/OrdererMap.mdx create mode 100644 website/docs/Range().mdx create mode 100644 website/docs/Record.Factory.mdx create mode 100644 website/docs/Record.mdx create mode 100644 website/docs/Repeat().mdx create mode 100644 website/docs/Seq.Indexed.mdx create mode 100644 website/docs/Seq.Keyed.mdx create mode 100644 website/docs/Seq.Set.mdx create mode 100644 website/docs/Seq.mdx create mode 100644 website/docs/Set.mdx create mode 100644 website/docs/Stack.mdx create mode 100644 website/docs/ValueObject.mdx create mode 100644 website/docs/fromJS().mdx create mode 100644 website/docs/get().mdx create mode 100644 website/docs/getIn().mdx create mode 100644 website/docs/has().mdx create mode 100644 website/docs/hasIn().mdx create mode 100644 website/docs/hash().mdx create mode 100644 website/docs/is().mdx create mode 100644 website/docs/isAssociative().mdx create mode 100644 website/docs/isCollection().mdx create mode 100644 website/docs/isImmutable().mdx create mode 100644 website/docs/isIndexed().mdx create mode 100644 website/docs/isKeyed().mdx create mode 100644 website/docs/isList().mdx create mode 100644 website/docs/isMap().mdx create mode 100644 website/docs/isOrdered().mdx create mode 100644 website/docs/isOrderedMap().mdx create mode 100644 website/docs/isOrderedSet().mdx create mode 100644 website/docs/isRecord().mdx create mode 100644 website/docs/isSeq().mdx create mode 100644 website/docs/isSet().mdx create mode 100644 website/docs/isStack().mdx create mode 100644 website/docs/isValueObject().mdx create mode 100644 website/docs/merge().mdx create mode 100644 website/docs/mergeDeep().mdx create mode 100644 website/docs/mergeDeepWith().mdx create mode 100644 website/docs/mergeWith().mdx create mode 100644 website/docs/remove().mdx create mode 100644 website/docs/removeIn().mdx create mode 100644 website/docs/set().mdx create mode 100644 website/docs/setIn().mdx create mode 100644 website/docs/update().mdx create mode 100644 website/docs/updateIn().mdx delete mode 100644 website/next.config.js create mode 100644 website/next.config.mjs create mode 100644 website/src/app/docs/currentVersion.tsx create mode 100644 website/src/app/docs/v5/[type]/page.tsx create mode 100644 website/src/app/docs/v5/layout.tsx create mode 100644 website/src/app/docs/v5/page.tsx create mode 100644 website/src/mdx-components.tsx create mode 100644 website/src/mdx-components/CodeLink.tsx create mode 100644 website/src/utils/doc.tsx diff --git a/package-lock.json b/package-lock.json index 8e728752a6..803ef38aaf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,9 @@ "@eslint/js": "^9.20.0", "@jdeniau/immutable-devtools": "^0.2.0", "@jest/globals": "^29.7.0", + "@mdx-js/loader": "^3.1.0", + "@mdx-js/react": "^3.1.0", + "@next/mdx": "^15.3.2", "@rollup/plugin-buble": "1.0.3", "@rollup/plugin-commonjs": "28.0.2", "@rollup/plugin-json": "6.1.0", @@ -24,6 +27,8 @@ "@rollup/plugin-typescript": "^12.1.2", "@size-limit/esbuild-why": "^11.2.0", "@size-limit/preset-small-lib": "^11.2.0", + "@types/mdx": "^2.0.13", + "@types/node": "^22.15.17", "@types/prismjs": "^1.26.3", "@types/random-seed": "0.3.5", "@types/react": "19.1.0", @@ -32,7 +37,7 @@ "colors": "1.4.0", "cpy-cli": "^5.0.0", "eslint": "^9.20.1", - "eslint-import-resolver-typescript": "^3.7.0", + "eslint-import-resolver-typescript": "^4.3.4", "eslint-plugin-import": "^2.31.0", "eslint-plugin-jest": "^28.11.0", "eslint-plugin-react": "^7.37.4", @@ -46,7 +51,7 @@ "marked": "^11.2.0", "marked-highlight": "^2.1.0", "microtime": "3.1.1", - "next": "15.2.4", + "next": "^15.3.2", "next-sitemap": "4.2.3", "npm-run-all": "4.1.5", "prettier": "^3.5.0", @@ -145,31 +150,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@babel/core/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/@babel/core/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/@babel/generator": { "version": "7.26.8", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.8.tgz", @@ -533,24 +513,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/traverse/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/@babel/traverse/node_modules/globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -561,13 +523,6 @@ "node": ">=4" } }, - "node_modules/@babel/traverse/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/@babel/types": { "version": "7.26.10", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz", @@ -734,10 +689,33 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@emnapi/core": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.3.tgz", + "integrity": "sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.0.2", + "tslib": "^2.4.0" + } + }, "node_modules/@emnapi/runtime": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.0.tgz", - "integrity": "sha512-64WYIf4UYcdLnbKn/umDlNjQDSS8AgZrI/R9+x5ilkUVFxXcA1Ebl+gQLc/6mERA4407Xof0R7wEyEuj091CVw==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.3.tgz", + "integrity": "sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.0.2.tgz", + "integrity": "sha512-5n3nTJblwRi8LlXkJ9eBzu+kZR8Yxcc7ubakyQTFzPMtIhFpUBRbsnc2Dv88IZDIbCDlBiWrknhB4Lsz7mg6BA==", "dev": true, "license": "MIT", "optional": true, @@ -1227,31 +1205,6 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@eslint/config-array/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/@eslint/config-array/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/@eslint/core": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.11.0.tgz", @@ -1296,24 +1249,6 @@ "dev": true, "license": "Python-2.0" }, - "node_modules/@eslint/eslintrc/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "14.0.0", "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", @@ -1340,13 +1275,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@eslint/eslintrc/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/@eslint/js": { "version": "9.20.0", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.20.0.tgz", @@ -1461,9 +1389,9 @@ } }, "node_modules/@img/sharp-darwin-arm64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", - "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.1.tgz", + "integrity": "sha512-pn44xgBtgpEbZsu+lWf2KNb6OAf70X68k+yk69Ic2Xz11zHR/w24/U49XT7AeRwJ0Px+mhALhU5LPci1Aymk7A==", "cpu": [ "arm64" ], @@ -1480,13 +1408,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.0.4" + "@img/sharp-libvips-darwin-arm64": "1.1.0" } }, "node_modules/@img/sharp-darwin-x64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", - "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.1.tgz", + "integrity": "sha512-VfuYgG2r8BpYiOUN+BfYeFo69nP/MIwAtSJ7/Zpxc5QF3KS22z8Pvg3FkrSFJBPNQ7mmcUcYQFBmEQp7eu1F8Q==", "cpu": [ "x64" ], @@ -1503,13 +1431,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-x64": "1.0.4" + "@img/sharp-libvips-darwin-x64": "1.1.0" } }, "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", - "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.1.0.tgz", + "integrity": "sha512-HZ/JUmPwrJSoM4DIQPv/BfNh9yrOA8tlBbqbLz4JZ5uew2+o22Ik+tHQJcih7QJuSa0zo5coHTfD5J8inqj9DA==", "cpu": [ "arm64" ], @@ -1524,9 +1452,9 @@ } }, "node_modules/@img/sharp-libvips-darwin-x64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", - "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.1.0.tgz", + "integrity": "sha512-Xzc2ToEmHN+hfvsl9wja0RlnXEgpKNmftriQp6XzY/RaSfwD9th+MSh0WQKzUreLKKINb3afirxW7A0fz2YWuQ==", "cpu": [ "x64" ], @@ -1541,9 +1469,9 @@ } }, "node_modules/@img/sharp-libvips-linux-arm": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", - "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.1.0.tgz", + "integrity": "sha512-s8BAd0lwUIvYCJyRdFqvsj+BJIpDBSxs6ivrOPm/R7piTs5UIwY5OjXrP2bqXC9/moGsyRa37eYWYCOGVXxVrA==", "cpu": [ "arm" ], @@ -1558,9 +1486,9 @@ } }, "node_modules/@img/sharp-libvips-linux-arm64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", - "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.1.0.tgz", + "integrity": "sha512-IVfGJa7gjChDET1dK9SekxFFdflarnUB8PwW8aGwEoF3oAsSDuNUTYS+SKDOyOJxQyDC1aPFMuRYLoDInyV9Ew==", "cpu": [ "arm64" ], @@ -1574,10 +1502,27 @@ "url": "https://opencollective.com/libvips" } }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.1.0.tgz", + "integrity": "sha512-tiXxFZFbhnkWE2LA8oQj7KYR+bWBkiV2nilRldT7bqoEZ4HiDOcePr9wVDAZPi/Id5fT1oY9iGnDq20cwUz8lQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, "node_modules/@img/sharp-libvips-linux-s390x": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", - "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.1.0.tgz", + "integrity": "sha512-xukSwvhguw7COyzvmjydRb3x/09+21HykyapcZchiCUkTThEQEOMtBj9UhkaBRLuBrgLFzQ2wbxdeCCJW/jgJA==", "cpu": [ "s390x" ], @@ -1592,9 +1537,9 @@ } }, "node_modules/@img/sharp-libvips-linux-x64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", - "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.1.0.tgz", + "integrity": "sha512-yRj2+reB8iMg9W5sULM3S74jVS7zqSzHG3Ol/twnAAkAhnGQnpjj6e4ayUz7V+FpKypwgs82xbRdYtchTTUB+Q==", "cpu": [ "x64" ], @@ -1609,9 +1554,9 @@ } }, "node_modules/@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", - "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.1.0.tgz", + "integrity": "sha512-jYZdG+whg0MDK+q2COKbYidaqW/WTz0cc1E+tMAusiDygrM4ypmSCjOJPmFTvHHJ8j/6cAGyeDWZOsK06tP33w==", "cpu": [ "arm64" ], @@ -1626,9 +1571,9 @@ } }, "node_modules/@img/sharp-libvips-linuxmusl-x64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", - "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.1.0.tgz", + "integrity": "sha512-wK7SBdwrAiycjXdkPnGCPLjYb9lD4l6Ze2gSdAGVZrEL05AOUJESWU2lhlC+Ffn5/G+VKuSm6zzbQSzFX/P65A==", "cpu": [ "x64" ], @@ -1643,9 +1588,9 @@ } }, "node_modules/@img/sharp-linux-arm": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", - "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.1.tgz", + "integrity": "sha512-anKiszvACti2sGy9CirTlNyk7BjjZPiML1jt2ZkTdcvpLU1YH6CXwRAZCA2UmRXnhiIftXQ7+Oh62Ji25W72jA==", "cpu": [ "arm" ], @@ -1662,13 +1607,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm": "1.0.5" + "@img/sharp-libvips-linux-arm": "1.1.0" } }, "node_modules/@img/sharp-linux-arm64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", - "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.1.tgz", + "integrity": "sha512-kX2c+vbvaXC6vly1RDf/IWNXxrlxLNpBVWkdpRq5Ka7OOKj6nr66etKy2IENf6FtOgklkg9ZdGpEu9kwdlcwOQ==", "cpu": [ "arm64" ], @@ -1685,13 +1630,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm64": "1.0.4" + "@img/sharp-libvips-linux-arm64": "1.1.0" } }, "node_modules/@img/sharp-linux-s390x": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", - "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.1.tgz", + "integrity": "sha512-7s0KX2tI9mZI2buRipKIw2X1ufdTeaRgwmRabt5bi9chYfhur+/C1OXg3TKg/eag1W+6CCWLVmSauV1owmRPxA==", "cpu": [ "s390x" ], @@ -1708,13 +1653,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-s390x": "1.0.4" + "@img/sharp-libvips-linux-s390x": "1.1.0" } }, "node_modules/@img/sharp-linux-x64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", - "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.1.tgz", + "integrity": "sha512-wExv7SH9nmoBW3Wr2gvQopX1k8q2g5V5Iag8Zk6AVENsjwd+3adjwxtp3Dcu2QhOXr8W9NusBU6XcQUohBZ5MA==", "cpu": [ "x64" ], @@ -1731,13 +1676,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-x64": "1.0.4" + "@img/sharp-libvips-linux-x64": "1.1.0" } }, "node_modules/@img/sharp-linuxmusl-arm64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", - "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.1.tgz", + "integrity": "sha512-DfvyxzHxw4WGdPiTF0SOHnm11Xv4aQexvqhRDAoD00MzHekAj9a/jADXeXYCDFH/DzYruwHbXU7uz+H+nWmSOQ==", "cpu": [ "arm64" ], @@ -1754,13 +1699,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + "@img/sharp-libvips-linuxmusl-arm64": "1.1.0" } }, "node_modules/@img/sharp-linuxmusl-x64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", - "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.1.tgz", + "integrity": "sha512-pax/kTR407vNb9qaSIiWVnQplPcGU8LRIJpDT5o8PdAx5aAA7AS3X9PS8Isw1/WfqgQorPotjrZL3Pqh6C5EBg==", "cpu": [ "x64" ], @@ -1777,13 +1722,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + "@img/sharp-libvips-linuxmusl-x64": "1.1.0" } }, "node_modules/@img/sharp-wasm32": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", - "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.1.tgz", + "integrity": "sha512-YDybQnYrLQfEpzGOQe7OKcyLUCML4YOXl428gOOzBgN6Gw0rv8dpsJ7PqTHxBnXnwXr8S1mYFSLSa727tpz0xg==", "cpu": [ "wasm32" ], @@ -1791,7 +1736,7 @@ "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", "optional": true, "dependencies": { - "@emnapi/runtime": "^1.2.0" + "@emnapi/runtime": "^1.4.0" }, "engines": { "node": "^18.17.0 || ^20.3.0 || >=21.0.0" @@ -1801,9 +1746,9 @@ } }, "node_modules/@img/sharp-win32-ia32": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", - "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.1.tgz", + "integrity": "sha512-WKf/NAZITnonBf3U1LfdjoMgNO5JYRSlhovhRhMxXVdvWYveM4kM3L8m35onYIdh75cOMCo1BexgVQcCDzyoWw==", "cpu": [ "ia32" ], @@ -1821,9 +1766,9 @@ } }, "node_modules/@img/sharp-win32-x64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", - "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.1.tgz", + "integrity": "sha512-hw1iIAHpNE8q3uMIRCgGOeDoz9KtFNarFLQclLxr/LK1VBkj8nby18RjFvr6aP7USRYAjTZW6yisnBWMX571Tw==", "cpu": [ "x64" ], @@ -2361,17 +2306,170 @@ "dev": true, "license": "MIT" }, + "node_modules/@mdx-js/loader": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@mdx-js/loader/-/loader-3.1.0.tgz", + "integrity": "sha512-xU/lwKdOyfXtQGqn3VnJjlDrmKXEvMi1mgYxVmukEUtVycIz1nh7oQ40bKTd4cA7rLStqu0740pnhGYxGoqsCg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@mdx-js/mdx": "^3.0.0", + "source-map": "^0.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "webpack": ">=5" + }, + "peerDependenciesMeta": { + "webpack": { + "optional": true + } + } + }, + "node_modules/@mdx-js/loader/node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@mdx-js/mdx": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.1.0.tgz", + "integrity": "sha512-/QxEhPAvGwbQmy1Px8F899L5Uc2KZ6JtXwlCgJmjSTBedwOZkByYcBG4GceIGPXRDsmfxhHazuS+hlOShRLeDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdx": "^2.0.0", + "collapse-white-space": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "estree-util-scope": "^1.0.0", + "estree-walker": "^3.0.0", + "hast-util-to-jsx-runtime": "^2.0.0", + "markdown-extensions": "^2.0.0", + "recma-build-jsx": "^1.0.0", + "recma-jsx": "^1.0.0", + "recma-stringify": "^1.0.0", + "rehype-recma": "^1.0.0", + "remark-mdx": "^3.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "source-map": "^0.7.0", + "unified": "^11.0.0", + "unist-util-position-from-estree": "^2.0.0", + "unist-util-stringify-position": "^4.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@mdx-js/mdx/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/@mdx-js/mdx/node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@mdx-js/react": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-3.1.0.tgz", + "integrity": "sha512-QjHtSaoameoalGnKDT3FoIl4+9RwyTmo9ZJGBdLOks/YOiWHoRDI3PUwEzOE7kEmGcV3AFcp9K6dYu9rEuKLAQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdx": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "@types/react": ">=16", + "react": ">=16" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.9.tgz", + "integrity": "sha512-OKRBiajrrxB9ATokgEQoG87Z25c67pCpYcCwmXYX8PBftC9pBfN18gnm/fh1wurSLEKIAt+QRFLFCQISrb66Jg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.4.0", + "@emnapi/runtime": "^1.4.0", + "@tybys/wasm-util": "^0.9.0" + } + }, "node_modules/@next/env": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/env/-/env-15.2.4.tgz", - "integrity": "sha512-+SFtMgoiYP3WoSswuNmxJOCwi06TdWE733D+WPjpXIe4LXGULwEaofiiAy6kbS0+XjM5xF5n3lKuBwN2SnqD9g==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.3.2.tgz", + "integrity": "sha512-xURk++7P7qR9JG1jJtLzPzf0qEvqCN0A/T3DXf8IPMKo9/6FfjxtEffRJIIew/bIL4T3C2jLLqBor8B/zVlx6g==", "dev": true, "license": "MIT" }, + "node_modules/@next/mdx": { + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/mdx/-/mdx-15.3.2.tgz", + "integrity": "sha512-D6lSSbVzn1EiPwrBKG5QzXClcgdqiNCL8a3/6oROinzgZnYSxbVmnfs0UrqygtGSOmgW7sdJJSEOy555DoAwvw==", + "dev": true, + "license": "MIT", + "dependencies": { + "source-map": "^0.7.0" + }, + "peerDependencies": { + "@mdx-js/loader": ">=0.15.0", + "@mdx-js/react": ">=0.15.0" + }, + "peerDependenciesMeta": { + "@mdx-js/loader": { + "optional": true + }, + "@mdx-js/react": { + "optional": true + } + } + }, + "node_modules/@next/mdx/node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 8" + } + }, "node_modules/@next/swc-darwin-arm64": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.2.4.tgz", - "integrity": "sha512-1AnMfs655ipJEDC/FHkSr0r3lXBgpqKo4K1kiwfUf3iE68rDFXZ1TtHdMvf7D0hMItgDZ7Vuq3JgNMbt/+3bYw==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.3.2.tgz", + "integrity": "sha512-2DR6kY/OGcokbnCsjHpNeQblqCZ85/1j6njYSkzRdpLn5At7OkSdmk7WyAmB9G0k25+VgqVZ/u356OSoQZ3z0g==", "cpu": [ "arm64" ], @@ -2386,9 +2484,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.2.4.tgz", - "integrity": "sha512-3qK2zb5EwCwxnO2HeO+TRqCubeI/NgCe+kL5dTJlPldV/uwCnUgC7VbEzgmxbfrkbjehL4H9BPztWOEtsoMwew==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.3.2.tgz", + "integrity": "sha512-ro/fdqaZWL6k1S/5CLv1I0DaZfDVJkWNaUU3un8Lg6m0YENWlDulmIWzV96Iou2wEYyEsZq51mwV8+XQXqMp3w==", "cpu": [ "x64" ], @@ -2403,9 +2501,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.2.4.tgz", - "integrity": "sha512-HFN6GKUcrTWvem8AZN7tT95zPb0GUGv9v0d0iyuTb303vbXkkbHDp/DxufB04jNVD+IN9yHy7y/6Mqq0h0YVaQ==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.3.2.tgz", + "integrity": "sha512-covwwtZYhlbRWK2HlYX9835qXum4xYZ3E2Mra1mdQ+0ICGoMiw1+nVAn4d9Bo7R3JqSmK1grMq/va+0cdh7bJA==", "cpu": [ "arm64" ], @@ -2420,9 +2518,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.2.4.tgz", - "integrity": "sha512-Oioa0SORWLwi35/kVB8aCk5Uq+5/ZIumMK1kJV+jSdazFm2NzPDztsefzdmzzpx5oGCJ6FkUC7vkaUseNTStNA==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.3.2.tgz", + "integrity": "sha512-KQkMEillvlW5Qk5mtGA/3Yz0/tzpNlSw6/3/ttsV1lNtMuOHcGii3zVeXZyi4EJmmLDKYcTcByV2wVsOhDt/zg==", "cpu": [ "arm64" ], @@ -2437,9 +2535,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.2.4.tgz", - "integrity": "sha512-yb5WTRaHdkgOqFOZiu6rHV1fAEK0flVpaIN2HB6kxHVSy/dIajWbThS7qON3W9/SNOH2JWkVCyulgGYekMePuw==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.3.2.tgz", + "integrity": "sha512-uRBo6THWei0chz+Y5j37qzx+BtoDRFIkDzZjlpCItBRXyMPIg079eIkOCl3aqr2tkxL4HFyJ4GHDes7W8HuAUg==", "cpu": [ "x64" ], @@ -2454,9 +2552,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.2.4.tgz", - "integrity": "sha512-Dcdv/ix6srhkM25fgXiyOieFUkz+fOYkHlydWCtB0xMST6X9XYI3yPDKBZt1xuhOytONsIFJFB08xXYsxUwJLw==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.3.2.tgz", + "integrity": "sha512-+uxFlPuCNx/T9PdMClOqeE8USKzj8tVz37KflT3Kdbx/LOlZBRI2yxuIcmx1mPNK8DwSOMNCr4ureSet7eyC0w==", "cpu": [ "x64" ], @@ -2471,9 +2569,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.2.4.tgz", - "integrity": "sha512-dW0i7eukvDxtIhCYkMrZNQfNicPDExt2jPb9AZPpL7cfyUo7QSNl1DjsHjmmKp6qNAqUESyT8YFl/Aw91cNJJg==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.3.2.tgz", + "integrity": "sha512-LLTKmaI5cfD8dVzh5Vt7+OMo+AIOClEdIU/TSKbXXT2iScUTSxOGoBhfuv+FU8R9MLmrkIL1e2fBMkEEjYAtPQ==", "cpu": [ "arm64" ], @@ -2488,9 +2586,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.2.4.tgz", - "integrity": "sha512-SbnWkJmkS7Xl3kre8SdMF6F/XDh1DTFEhp0jRTj/uB8iPKoU2bb2NDfcu+iifv1+mxQEd1g2vvSxcZbXSKyWiQ==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.3.2.tgz", + "integrity": "sha512-aW5B8wOPioJ4mBdMDXkt5f3j8pUr9W8AnlX0Df35uRWNT1Y6RIybxjnSUe+PhM+M1bwgyY8PHLmXZC6zT1o5tA==", "cpu": [ "x64" ], @@ -2539,16 +2637,6 @@ "node": ">= 8" } }, - "node_modules/@nolyfill/is-core-module": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", - "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.4.0" - } - }, "node_modules/@rollup/plugin-buble": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@rollup/plugin-buble/-/plugin-buble-1.0.3.tgz", @@ -3282,6 +3370,17 @@ "dev": true, "license": "MIT" }, + "node_modules/@tybys/wasm-util": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.9.0.tgz", + "integrity": "sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@types/babel__core": { "version": "7.20.1", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz", @@ -3332,6 +3431,16 @@ "magic-string": "^0.25.0" } }, + "node_modules/@types/debug": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/ms": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -3339,6 +3448,16 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/estree-jsx": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", + "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, "node_modules/@types/gensync": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.4.tgz", @@ -3355,6 +3474,16 @@ "@types/node": "*" } }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", @@ -3404,15 +3533,43 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/node": { - "version": "14.17.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.3.tgz", - "integrity": "sha512-e6ZowgGJmTuXa3GyaPbTGxX17tnThl2aSSizrFthQ7m9uLGZBXiGhgE55cjRZTF5kjZvYn9EOPOMljdjwbflxw==", - "dev": true + "node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } }, - "node_modules/@types/prismjs": { - "version": "1.26.3", - "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.3.tgz", + "node_modules/@types/mdx": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/@types/mdx/-/mdx-2.0.13.tgz", + "integrity": "sha512-+OWZQfAYyio6YkJb3HLxDrvnx6SWWDbC0zVPfBRzUk0/nqoDyf6dNxQi3eArPe8rJ473nobTMQ/8Zk+LxJ+Yuw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.15.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.17.tgz", + "integrity": "sha512-wIX2aSZL5FE+MR0JlvF87BNVrtFWf6AE6rxSE9X7OwnVvoyCQjpzSRJ+M87se/4QCkCiebQAqrJ0y6fwIyi7nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/prismjs": { + "version": "1.26.3", + "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.3.tgz", "integrity": "sha512-A0D0aTXvjlqJ5ZILMz3rNfDBOx9hHxLZYv2by47Sm/pqW35zzjusrZTryatjN/Rf8Us2gZrJD+KeHbUSTux1Cw==", "dev": true }, @@ -3445,6 +3602,13 @@ "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", "dev": true }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/yargs": { "version": "17.0.24", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", @@ -3515,31 +3679,6 @@ "typescript": ">=4.8.4 <5.8.0" } }, - "node_modules/@typescript-eslint/parser/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/@typescript-eslint/scope-manager": { "version": "8.24.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.24.0.tgz", @@ -3582,31 +3721,6 @@ "typescript": ">=4.8.4 <5.8.0" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/@typescript-eslint/types": { "version": "8.24.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.24.0.tgz", @@ -3658,24 +3772,6 @@ "balanced-match": "^1.0.0" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -3692,13 +3788,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { "version": "7.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", @@ -3754,122 +3843,345 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/abab": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", - "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", - "dev": true + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "dev": true, + "license": "ISC" }, - "node_modules/acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "node_modules/@unrs/resolver-binding-darwin-arm64": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.7.2.tgz", + "integrity": "sha512-vxtBno4xvowwNmO/ASL0Y45TpHqmNkAaDtz4Jqb+clmcVSSl8XCG/PNFFkGsXXXS6AMjP+ja/TtNCFFa1QwLRg==", + "cpu": [ + "arm64" + ], "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] }, - "node_modules/acorn-dynamic-import": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", - "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", + "node_modules/@unrs/resolver-binding-darwin-x64": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.7.2.tgz", + "integrity": "sha512-qhVa8ozu92C23Hsmv0BF4+5Dyyd5STT1FolV4whNgbY6mj3kA0qsrGPe35zNR3wAN7eFict3s4Rc2dDTPBTuFQ==", + "cpu": [ + "x64" + ], "dev": true, - "peerDependencies": { - "acorn": "^6.0.0" - } + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] }, - "node_modules/acorn-globals": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", - "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", + "node_modules/@unrs/resolver-binding-freebsd-x64": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.7.2.tgz", + "integrity": "sha512-zKKdm2uMXqLFX6Ac7K5ElnnG5VIXbDlFWzg4WJ8CGUedJryM5A3cTgHuGMw1+P5ziV8CRhnSEgOnurTI4vpHpg==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "acorn": "^8.1.0", - "acorn-walk": "^8.0.2" - } + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] }, - "node_modules/acorn-globals/node_modules/acorn": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", - "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "node_modules/@unrs/resolver-binding-linux-arm-gnueabihf": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.7.2.tgz", + "integrity": "sha512-8N1z1TbPnHH+iDS/42GJ0bMPLiGK+cUqOhNbMKtWJ4oFGzqSJk/zoXFzcQkgtI63qMcUI7wW1tq2usZQSb2jxw==", + "cpu": [ + "arm" + ], "dev": true, "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "node_modules/@unrs/resolver-binding-linux-arm-musleabihf": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.7.2.tgz", + "integrity": "sha512-tjYzI9LcAXR9MYd9rO45m1s0B/6bJNuZ6jeOxo1pq1K6OBuRMMmfyvJYval3s9FPPGmrldYA3mi4gWDlWuTFGA==", + "cpu": [ + "arm" + ], "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "node_modules/@unrs/resolver-binding-linux-arm64-gnu": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.7.2.tgz", + "integrity": "sha512-jon9M7DKRLGZ9VYSkFMflvNqu9hDtOCEnO2QAryFWgT6o6AXU8du56V7YqnaLKr6rAbZBWYsYpikF226v423QA==", + "cpu": [ + "arm64" + ], "dev": true, - "engines": { - "node": ">=0.4.0" - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "node_modules/@unrs/resolver-binding-linux-arm64-musl": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.7.2.tgz", + "integrity": "sha512-c8Cg4/h+kQ63pL43wBNaVMmOjXI/X62wQmru51qjfTvI7kmCy5uHTJvK/9LrF0G8Jdx8r34d019P1DVJmhXQpA==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/agent-base/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "node_modules/@unrs/resolver-binding-linux-ppc64-gnu": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.7.2.tgz", + "integrity": "sha512-A+lcwRFyrjeJmv3JJvhz5NbcCkLQL6Mk16kHTNm6/aGNc4FwPHPE4DR9DwuCvCnVHvF5IAd9U4VIs/VvVir5lg==", + "cpu": [ + "ppc64" + ], "dev": true, "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/agent-base/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "node_modules/@unrs/resolver-binding-linux-riscv64-gnu": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.7.2.tgz", + "integrity": "sha512-hQQ4TJQrSQW8JlPm7tRpXN8OCNP9ez7PajJNjRD1ZTHQAy685OYqPrKjfaMw/8LiHCt8AZ74rfUVHP9vn0N69Q==", + "cpu": [ + "riscv64" + ], "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/aggregate-error": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", - "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "node_modules/@unrs/resolver-binding-linux-riscv64-musl": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.7.2.tgz", + "integrity": "sha512-NoAGbiqrxtY8kVooZ24i70CjLDlUFI7nDj3I9y54U94p+3kPxwd2L692YsdLa+cqQ0VoqMWoehDFp21PKRUoIQ==", + "cpu": [ + "riscv64" + ], "dev": true, "license": "MIT", - "dependencies": { - "clean-stack": "^4.0.0", - "indent-string": "^5.0.0" - }, - "engines": { + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-s390x-gnu": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.7.2.tgz", + "integrity": "sha512-KaZByo8xuQZbUhhreBTW+yUnOIHUsv04P8lKjQ5otiGoSJ17ISGYArc+4vKdLEpGaLbemGzr4ZeUbYQQsLWFjA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-x64-gnu": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.7.2.tgz", + "integrity": "sha512-dEidzJDubxxhUCBJ/SHSMJD/9q7JkyfBMT77Px1npl4xpg9t0POLvnWywSk66BgZS/b2Hy9Y1yFaoMTFJUe9yg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-x64-musl": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.7.2.tgz", + "integrity": "sha512-RvP+Ux3wDjmnZDT4XWFfNBRVG0fMsc+yVzNFUqOflnDfZ9OYujv6nkh+GOr+watwrW4wdp6ASfG/e7bkDradsw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-wasm32-wasi": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.7.2.tgz", + "integrity": "sha512-y797JBmO9IsvXVRCKDXOxjyAE4+CcZpla2GSoBQ33TVb3ILXuFnMrbR/QQZoauBYeOFuu4w3ifWLw52sdHGz6g==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^0.2.9" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@unrs/resolver-binding-win32-arm64-msvc": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.7.2.tgz", + "integrity": "sha512-gtYTh4/VREVSLA+gHrfbWxaMO/00y+34htY7XpioBTy56YN2eBjkPrY1ML1Zys89X3RJDKVaogzwxlM1qU7egg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@unrs/resolver-binding-win32-ia32-msvc": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.7.2.tgz", + "integrity": "sha512-Ywv20XHvHTDRQs12jd3MY8X5C8KLjDbg/jyaal/QLKx3fAShhJyD4blEANInsjxW3P7isHx1Blt56iUDDJO3jg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@unrs/resolver-binding-win32-x64-msvc": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.7.2.tgz", + "integrity": "sha512-friS8NEQfHaDbkThxopGk+LuE5v3iY0StruifjQEt7SLbA46OnfgMO15sOTkbpJkol6RB+1l1TYPXh0sCddpvA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/abab": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", + "dev": true + }, + "node_modules/acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-dynamic-import": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", + "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0" + } + }, + "node_modules/acorn-globals": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", + "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", + "dev": true, + "dependencies": { + "acorn": "^8.1.0", + "acorn-walk": "^8.0.2" + } + }, + "node_modules/acorn-globals/node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "dev": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + }, + "engines": { "node": ">=12" }, "funding": { @@ -4143,6 +4455,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/astring": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/astring/-/astring-1.9.0.tgz", + "integrity": "sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==", + "dev": true, + "license": "MIT", + "bin": { + "astring": "bin/astring" + } + }, "node_modules/async-function": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", @@ -4266,6 +4588,17 @@ "@babel/core": "^7.0.0" } }, + "node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -4479,6 +4812,17 @@ ], "license": "CC-BY-4.0" }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -4505,6 +4849,50 @@ "node": ">=10" } }, + "node_modules/character-entities": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/chokidar": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", @@ -4659,6 +5047,17 @@ "@codemirror/view": "^6.0.0" } }, + "node_modules/collapse-white-space": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-2.1.0.tgz", + "integrity": "sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/collect-v8-coverage": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", @@ -4731,6 +5130,17 @@ "node": ">= 0.8" } }, + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -4985,12 +5395,44 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/decimal.js": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", "dev": true }, + "node_modules/decode-named-character-reference": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.1.0.tgz", + "integrity": "sha512-Wy+JTSbFThEOXQIR2L6mxJvEs+veIzpmqD7ynWxMXGpnk3smkHQOp6forLdHsKpAMW9iJpaBBIxz285t1n1C3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/dedent": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", @@ -5108,10 +5550,20 @@ "node": ">=0.4.0" } }, - "node_modules/detect-libc": { + "node_modules/dequal": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", - "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/detect-libc": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", + "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==", "dev": true, "license": "Apache-2.0", "optional": true, @@ -5128,6 +5580,20 @@ "node": ">=8" } }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -5219,20 +5685,6 @@ "url": "https://github.com/sindresorhus/emittery?sponsor=1" } }, - "node_modules/enhanced-resolve": { - "version": "5.18.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz", - "integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - }, - "engines": { - "node": ">=10.13.0" - } - }, "node_modules/entities": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", @@ -5428,6 +5880,53 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/esast-util-from-estree": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/esast-util-from-estree/-/esast-util-from-estree-2.0.0.tgz", + "integrity": "sha512-4CyanoAudUSBAn5K13H4JhsMH6L9ZP7XbLVe/dKybkxMO7eDyLsT8UHl9TRNrU2Gr9nz+FovfSIjuXWJ81uVwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "devlop": "^1.0.0", + "estree-util-visit": "^2.0.0", + "unist-util-position-from-estree": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/esast-util-from-js": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esast-util-from-js/-/esast-util-from-js-2.0.1.tgz", + "integrity": "sha512-8Ja+rNJ0Lt56Pcf3TAmpBZjmx8ZcK5Ts4cAzIOjsjevg9oSXJnl6SUQ2EevU8tv3h6ZLWmoKL5H4fgWvdvfETw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "acorn": "^8.0.0", + "esast-util-from-estree": "^2.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/esast-util-from-js/node_modules/acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/esbuild": { "version": "0.25.1", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.1.tgz", @@ -5683,34 +6182,25 @@ "ms": "^2.1.1" } }, - "node_modules/eslint-import-resolver-node/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/eslint-import-resolver-typescript": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.7.0.tgz", - "integrity": "sha512-Vrwyi8HHxY97K5ebydMtffsWAn1SCR9eol49eCd5fJS4O1WV7PaAjbcjmbfJJSMz/t4Mal212Uz/fQZrOB8mow==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-4.3.4.tgz", + "integrity": "sha512-buzw5z5VtiQMysYLH9iW9BV04YyZebsw+gPi+c4FCjfS9i6COYOrEWw9t3m3wA9PFBfqcBCqWf32qrXLbwafDw==", "dev": true, "license": "ISC", "dependencies": { - "@nolyfill/is-core-module": "1.0.39", - "debug": "^4.3.7", - "enhanced-resolve": "^5.15.0", - "fast-glob": "^3.3.2", - "get-tsconfig": "^4.7.5", - "is-bun-module": "^1.0.2", - "is-glob": "^4.0.3", - "stable-hash": "^0.0.4" + "debug": "^4.4.0", + "get-tsconfig": "^4.10.0", + "is-bun-module": "^2.0.0", + "stable-hash": "^0.0.5", + "tinyglobby": "^0.2.13", + "unrs-resolver": "^1.6.3" }, "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": "^16.17.0 || >=18.6.0" }, "funding": { - "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + "url": "https://opencollective.com/eslint-import-resolver-typescript" }, "peerDependencies": { "eslint": "*", @@ -5726,31 +6216,6 @@ } } }, - "node_modules/eslint-import-resolver-typescript/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/eslint-import-resolver-typescript/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/eslint-module-utils": { "version": "2.12.0", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", @@ -5779,13 +6244,6 @@ "ms": "^2.1.1" } }, - "node_modules/eslint-module-utils/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/eslint-plugin-import": { "version": "2.31.0", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", @@ -5830,13 +6288,6 @@ "ms": "^2.1.1" } }, - "node_modules/eslint-plugin-import/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/eslint-plugin-jest": { "version": "28.11.0", "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.11.0.tgz", @@ -5944,24 +6395,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/eslint/node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -5975,13 +6408,6 @@ "node": ">=10.13.0" } }, - "node_modules/eslint/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/espree": { "version": "10.3.0", "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", @@ -6061,6 +6487,114 @@ "node": ">=4.0" } }, + "node_modules/estree-util-attach-comments": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/estree-util-attach-comments/-/estree-util-attach-comments-3.0.0.tgz", + "integrity": "sha512-cKUwm/HUcTDsYh/9FgnuFqpfquUbwIqwKM26BVCGDPVgvaCl/nDCCjUfiLlx6lsEZ3Z4RFxNbOQ60pkaEwFxGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-build-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/estree-util-build-jsx/-/estree-util-build-jsx-3.0.1.tgz", + "integrity": "sha512-8U5eiL6BTrPxp/CHbs2yMgP8ftMhR5ww1eIKoWRMlqvltHF8fZn5LRDvTKuxD3DUn+shRbLGqXemcP51oFCsGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "estree-walker": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-build-jsx/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/estree-util-is-identifier-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz", + "integrity": "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-scope": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/estree-util-scope/-/estree-util-scope-1.0.0.tgz", + "integrity": "sha512-2CAASclonf+JFWBNJPndcOpA8EMJwa0Q8LUFJEKqXLW6+qBvbFZuF5gItbQOs/umBUkjviCSDCbBwU2cXbmrhQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-to-js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/estree-util-to-js/-/estree-util-to-js-2.0.0.tgz", + "integrity": "sha512-WDF+xj5rRWmD5tj6bIqRi6CkLIXbbNQUcxQHzGysQzvHmdYG2G7p/Tf0J0gpxGgkeMZNTIjT/AoSvC9Xehcgdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "astring": "^1.8.0", + "source-map": "^0.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-to-js/node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 8" + } + }, + "node_modules/estree-util-visit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/estree-util-visit/-/estree-util-visit-2.0.0.tgz", + "integrity": "sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", @@ -6126,6 +6660,13 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true, + "license": "MIT" + }, "node_modules/fast-check": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.0.0.tgz", @@ -6653,6 +7194,77 @@ "node": ">= 0.4" } }, + "node_modules/hast-util-to-estree": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hast-util-to-estree/-/hast-util-to-estree-3.1.3.tgz", + "integrity": "sha512-48+B/rJWAp0jamNbAAf9M7Uf//UVqAoMmgXhBdxTDJLGKY+LRnZ99qcG+Qjl5HfMpYNzS5v4EAwVEF34LeAj7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-attach-comments": "^3.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-js": "^1.0.0", + "unist-util-position": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-jsx-runtime": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz", + "integrity": "sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-js": "^1.0.0", + "unist-util-position": "^5.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", @@ -6691,31 +7303,6 @@ "node": ">= 6" } }, - "node_modules/http-proxy-agent/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/http-proxy-agent/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", @@ -6729,35 +7316,10 @@ "node": ">= 6" } }, - "node_modules/https-proxy-agent/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/https-proxy-agent/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, "engines": { "node": ">=10.17.0" @@ -6923,6 +7485,13 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, + "node_modules/inline-style-parser": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.4.tgz", + "integrity": "sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q==", + "dev": true, + "license": "MIT" + }, "node_modules/internal-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", @@ -6938,6 +7507,32 @@ "node": ">= 0.4" } }, + "node_modules/is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-array-buffer": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", @@ -7016,13 +7611,13 @@ } }, "node_modules/is-bun-module": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-1.3.0.tgz", - "integrity": "sha512-DgXeu5UWI0IsMQundYb5UAOzm6G2eVnarJ0byP6Tm55iZNKceD59LNPA2L4VvsScTtHcw0yEkVwSf7PC+QoLSA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-2.0.0.tgz", + "integrity": "sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ==", "dev": true, "license": "MIT", "dependencies": { - "semver": "^7.6.3" + "semver": "^7.7.1" } }, "node_modules/is-bun-module/node_modules/semver": { @@ -7101,6 +7696,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-docker": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", @@ -7192,6 +7798,17 @@ "node": ">=0.10.0" } }, + "node_modules/is-hexadecimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", + "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-inside-container": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", @@ -7250,6 +7867,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", @@ -7525,31 +8155,6 @@ "node": ">=10" } }, - "node_modules/istanbul-lib-source-maps/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/istanbul-lib-source-maps/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/istanbul-reports": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", @@ -8554,6 +9159,17 @@ "dev": true, "license": "MIT" }, + "node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -8620,6 +9236,19 @@ "tmpl": "1.0.5" } }, + "node_modules/markdown-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz", + "integrity": "sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/marked": { "version": "11.2.0", "resolved": "https://registry.npmjs.org/marked/-/marked-11.2.0.tgz", @@ -8651,6 +9280,185 @@ "node": ">= 0.4" } }, + "node_modules/mdast-util-from-markdown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.2.tgz", + "integrity": "sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-3.0.0.tgz", + "integrity": "sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w==", + "dev": true, + "license": "MIT", + "dependencies": { + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz", + "integrity": "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.2.0.tgz", + "integrity": "sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdxjs-esm": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz", + "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-hast": { + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz", + "integrity": "sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-markdown": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz", + "integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/memorystream": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", @@ -8679,14 +9487,651 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromark": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", + "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-core-commonmark": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", + "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-mdx-expression": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-3.0.1.tgz", + "integrity": "sha512-dD/ADLJ1AeMvSAKBwO22zG22N4ybhe7kFIZ3LsDI0GlsNr2A3KYxb0LdC1u5rj4Nw+CHKY0RVdnHX8vj8ejm4Q==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-mdx-expression": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-mdx-jsx": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-3.0.2.tgz", + "integrity": "sha512-e5+q1DjMh62LZAJOnDraSSbDMvGJ8x3cbjygy2qFEi7HCeUT4BDKCvMozPozcD6WmOt6sVvYDNBKhFSz3kjOVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "micromark-factory-mdx-expression": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdx-md": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-md/-/micromark-extension-mdx-md-2.0.0.tgz", + "integrity": "sha512-EpAiszsB3blw4Rpba7xTOUptcFeBFi+6PY8VnJ2hhimH+vCQDirWgsMpz7w1XcZE7LVrSAUGb9VJpG9ghlYvYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdxjs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs/-/micromark-extension-mdxjs-3.0.0.tgz", + "integrity": "sha512-A873fJfhnJ2siZyUrJ31l34Uqwy4xIFmvPY1oj+Ean5PHcPBYzEsvqvWGaWcfEIr11O5Dlw3p2y0tZWpKHDejQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.0.0", + "acorn-jsx": "^5.0.0", + "micromark-extension-mdx-expression": "^3.0.0", + "micromark-extension-mdx-jsx": "^3.0.0", + "micromark-extension-mdx-md": "^2.0.0", + "micromark-extension-mdxjs-esm": "^3.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdxjs-esm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs-esm/-/micromark-extension-mdxjs-esm-3.0.0.tgz", + "integrity": "sha512-DJFl4ZqkErRpq/dAPyeWp15tGrcrrJho1hKK5uBS70BCtfrIFg81sqcTVu3Ta+KD1Tk5vAtBNElWxtAa+m8K9A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-position-from-estree": "^2.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdxjs/node_modules/acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/micromark-factory-destination": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", + "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-label": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz", + "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-mdx-expression": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-2.0.3.tgz", + "integrity": "sha512-kQnEtA3vzucU2BkrIa8/VaSAsP+EJ3CKOvhMuJgOEGg9KDC6OAY6nSnNDVRiVNRqj7Y4SlSzcStaH/5jge8JdQ==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-position-from-estree": "^2.0.0", + "vfile-message": "^4.0.0" + } + }, + "node_modules/micromark-factory-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", + "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-title": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz", + "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz", + "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-character": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", + "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-chunked": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz", + "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-classify-character": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz", + "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-combine-extensions": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz", + "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz", + "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-string": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz", + "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-encode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", + "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-events-to-acorn": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-util-events-to-acorn/-/micromark-util-events-to-acorn-2.0.3.tgz", + "integrity": "sha512-jmsiEIiZ1n7X1Rr5k8wVExBQCg5jy4UXVADItHmNk1zkwEVhBuIUKRu3fqv+hs4nxLISi2DQGlqIOGiFxgbfHg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "estree-util-visit": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "vfile-message": "^4.0.0" + } + }, + "node_modules/micromark-util-html-tag-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz", + "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-normalize-identifier": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz", + "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-resolve-all": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz", + "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-sanitize-uri": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", + "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-subtokenize": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", + "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-symbol": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", + "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", + "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", "dev": true, - "engines": { - "node": ">= 8" - } + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" }, "node_modules/micromatch": { "version": "4.0.8", @@ -8768,6 +10213,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, "node_modules/nanoid": { "version": "3.3.10", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.10.tgz", @@ -8797,6 +10249,22 @@ "picocolors": "^1.1.1" } }, + "node_modules/napi-postinstall": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.2.3.tgz", + "integrity": "sha512-Mi7JISo/4Ij2tDZ2xBE2WH+/KvVlkhA6juEjpEeRAVPNCpN3nxJo/5FhDNKgBcdmcmhaH6JjgST4xY/23ZYK0w==", + "dev": true, + "license": "MIT", + "bin": { + "napi-postinstall": "lib/cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/napi-postinstall" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -8811,13 +10279,13 @@ "license": "MIT" }, "node_modules/next": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/next/-/next-15.2.4.tgz", - "integrity": "sha512-VwL+LAaPSxEkd3lU2xWbgEOtrM8oedmyhBqaVNmgKB+GvZlCy9rgaEc+y2on0wv+l0oSFqLtYD6dcC1eAedUaQ==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/next/-/next-15.3.2.tgz", + "integrity": "sha512-CA3BatMyHkxZ48sgOCLdVHjFU36N7TF1HhqAHLFOkV6buwZnvMI84Cug8xD56B9mCuKrqXnLn94417GrZ/jjCQ==", "dev": true, "license": "MIT", "dependencies": { - "@next/env": "15.2.4", + "@next/env": "15.3.2", "@swc/counter": "0.1.3", "@swc/helpers": "0.5.15", "busboy": "1.6.0", @@ -8832,15 +10300,15 @@ "node": "^18.18.0 || ^19.8.0 || >= 20.0.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "15.2.4", - "@next/swc-darwin-x64": "15.2.4", - "@next/swc-linux-arm64-gnu": "15.2.4", - "@next/swc-linux-arm64-musl": "15.2.4", - "@next/swc-linux-x64-gnu": "15.2.4", - "@next/swc-linux-x64-musl": "15.2.4", - "@next/swc-win32-arm64-msvc": "15.2.4", - "@next/swc-win32-x64-msvc": "15.2.4", - "sharp": "^0.33.5" + "@next/swc-darwin-arm64": "15.3.2", + "@next/swc-darwin-x64": "15.3.2", + "@next/swc-linux-arm64-gnu": "15.3.2", + "@next/swc-linux-arm64-musl": "15.3.2", + "@next/swc-linux-x64-gnu": "15.3.2", + "@next/swc-linux-x64-musl": "15.3.2", + "@next/swc-win32-arm64-msvc": "15.3.2", + "@next/swc-win32-x64-msvc": "15.3.2", + "sharp": "^0.34.1" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", @@ -9484,6 +10952,33 @@ "node": ">=6" } }, + "node_modules/parse-entities": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz", + "integrity": "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse-entities/node_modules/@types/unist": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "dev": true, + "license": "MIT" + }, "node_modules/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", @@ -9741,6 +11236,17 @@ "react-is": "^16.13.1" } }, + "node_modules/property-information": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.0.0.tgz", + "integrity": "sha512-7D/qOz/+Y4X/rzSB6jKxKUsQnphO046ei8qxG59mtM3RG3DHgTK81HrxrmoDVINJb8NKT5ZsRbwHvQ6B68Iyhg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -9892,6 +11398,74 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/recma-build-jsx": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/recma-build-jsx/-/recma-build-jsx-1.0.0.tgz", + "integrity": "sha512-8GtdyqaBcDfva+GUKDr3nev3VpKAhup1+RvkMvUxURHpW7QyIvk9F5wz7Vzo06CEMSilw6uArgRqhpiUcWp8ew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-util-build-jsx": "^3.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/recma-jsx": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/recma-jsx/-/recma-jsx-1.0.0.tgz", + "integrity": "sha512-5vwkv65qWwYxg+Atz95acp8DMu1JDSqdGkA2Of1j6rCreyFUE/gp15fC8MnGEuG1W68UKjM6x6+YTWIh7hZM/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn-jsx": "^5.0.0", + "estree-util-to-js": "^2.0.0", + "recma-parse": "^1.0.0", + "recma-stringify": "^1.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/recma-parse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/recma-parse/-/recma-parse-1.0.0.tgz", + "integrity": "sha512-OYLsIGBB5Y5wjnSnQW6t3Xg7q3fQ7FWbw/vcXtORTnyaSFscOtABg+7Pnz6YZ6c27fG1/aN8CjfwoUEUIdwqWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "esast-util-from-js": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/recma-stringify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/recma-stringify/-/recma-stringify-1.0.0.tgz", + "integrity": "sha512-cjwII1MdIIVloKvC9ErQ+OgAtwHBmcZ0Bg4ciz78FtbT8In39aAYbaA7zvxQ61xVMSPE8WxhLwLbhif4Js2C+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-util-to-js": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", @@ -9981,6 +11555,72 @@ "jsesc": "bin/jsesc" } }, + "node_modules/rehype-recma": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/rehype-recma/-/rehype-recma-1.0.0.tgz", + "integrity": "sha512-lqA4rGUf1JmacCNWWZx0Wv1dHqMwxzsDWYMTowuplHF3xH0N/MmrZ/G3BDZnzAkRmxDadujCjaKM2hqYdCBOGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "hast-util-to-estree": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-mdx": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.1.0.tgz", + "integrity": "sha512-Ngl/H3YXyBV9RcRNdlYsZujAmhsxwzxpDzpDEhFBVAGthS4GDgnctpDjgFl/ULx5UEDzqtW1cyBSNKqYYrqLBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "mdast-util-mdx": "^3.0.0", + "micromark-extension-mdxjs": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-parse": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.2.tgz", + "integrity": "sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-to-hast": "^13.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -10346,9 +11986,9 @@ } }, "node_modules/sharp": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", - "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.1.tgz", + "integrity": "sha512-1j0w61+eVxu7DawFJtnfYcvSv6qPFvfTaqzTQ2BLknVhHTwGS8sc63ZBF4rzkWMBVKybo4S5OBtDdZahh2A1xg==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", @@ -10356,7 +11996,7 @@ "dependencies": { "color": "^4.2.3", "detect-libc": "^2.0.3", - "semver": "^7.6.3" + "semver": "^7.7.1" }, "engines": { "node": "^18.17.0 || ^20.3.0 || >=21.0.0" @@ -10365,25 +12005,26 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-darwin-arm64": "0.33.5", - "@img/sharp-darwin-x64": "0.33.5", - "@img/sharp-libvips-darwin-arm64": "1.0.4", - "@img/sharp-libvips-darwin-x64": "1.0.4", - "@img/sharp-libvips-linux-arm": "1.0.5", - "@img/sharp-libvips-linux-arm64": "1.0.4", - "@img/sharp-libvips-linux-s390x": "1.0.4", - "@img/sharp-libvips-linux-x64": "1.0.4", - "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", - "@img/sharp-libvips-linuxmusl-x64": "1.0.4", - "@img/sharp-linux-arm": "0.33.5", - "@img/sharp-linux-arm64": "0.33.5", - "@img/sharp-linux-s390x": "0.33.5", - "@img/sharp-linux-x64": "0.33.5", - "@img/sharp-linuxmusl-arm64": "0.33.5", - "@img/sharp-linuxmusl-x64": "0.33.5", - "@img/sharp-wasm32": "0.33.5", - "@img/sharp-win32-ia32": "0.33.5", - "@img/sharp-win32-x64": "0.33.5" + "@img/sharp-darwin-arm64": "0.34.1", + "@img/sharp-darwin-x64": "0.34.1", + "@img/sharp-libvips-darwin-arm64": "1.1.0", + "@img/sharp-libvips-darwin-x64": "1.1.0", + "@img/sharp-libvips-linux-arm": "1.1.0", + "@img/sharp-libvips-linux-arm64": "1.1.0", + "@img/sharp-libvips-linux-ppc64": "1.1.0", + "@img/sharp-libvips-linux-s390x": "1.1.0", + "@img/sharp-libvips-linux-x64": "1.1.0", + "@img/sharp-libvips-linuxmusl-arm64": "1.1.0", + "@img/sharp-libvips-linuxmusl-x64": "1.1.0", + "@img/sharp-linux-arm": "0.34.1", + "@img/sharp-linux-arm64": "0.34.1", + "@img/sharp-linux-s390x": "0.34.1", + "@img/sharp-linux-x64": "0.34.1", + "@img/sharp-linuxmusl-arm64": "0.34.1", + "@img/sharp-linuxmusl-x64": "0.34.1", + "@img/sharp-wasm32": "0.34.1", + "@img/sharp-win32-ia32": "0.34.1", + "@img/sharp-win32-x64": "0.34.1" } }, "node_modules/sharp/node_modules/semver": { @@ -10613,6 +12254,17 @@ "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "dev": true }, + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -10652,9 +12304,9 @@ "dev": true }, "node_modules/stable-hash": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.4.tgz", - "integrity": "sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==", + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.5.tgz", + "integrity": "sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA==", "dev": true, "license": "MIT" }, @@ -10816,6 +12468,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/stringify-entities": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "dev": true, + "license": "MIT", + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -10866,6 +12533,26 @@ "dev": true, "license": "MIT" }, + "node_modules/style-to-js": { + "version": "1.1.16", + "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.16.tgz", + "integrity": "sha512-/Q6ld50hKYPH3d/r6nr117TZkHR0w0kGGIVfpG9N6D8NymRPM9RqCUv4pRpJ62E5DqOYx2AFpbZMyCPnjQCnOw==", + "dev": true, + "license": "MIT", + "dependencies": { + "style-to-object": "1.0.8" + } + }, + "node_modules/style-to-object": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.8.tgz", + "integrity": "sha512-xT47I/Eo0rwJmaXC4oilDGDWLohVhR6o/xAQcPQN8q6QBuZVL8qMYL85kLmST5cPjAorwvqIA4qXTRQoYHaL6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "inline-style-parser": "0.2.4" + } + }, "node_modules/styled-jsx": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz", @@ -10942,16 +12629,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "node_modules/tapable": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/terser": { "version": "5.19.2", "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.2.tgz", @@ -10998,13 +12675,13 @@ } }, "node_modules/tinyglobby": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", - "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz", + "integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==", "dev": true, "license": "MIT", "dependencies": { - "fdir": "^6.4.3", + "fdir": "^6.4.4", "picomatch": "^4.0.2" }, "engines": { @@ -11015,9 +12692,9 @@ } }, "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", - "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", + "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", "dev": true, "license": "MIT", "peerDependencies": { @@ -11081,6 +12758,28 @@ "node": ">= 0.10.0" } }, + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/trough": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", + "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/ts-api-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", @@ -11371,59 +13070,206 @@ "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unified": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", + "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "dependencies": { + "crypto-random-string": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/unist-util-is": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", + "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/unicode-canonical-property-names-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "node_modules/unist-util-position-from-estree": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position-from-estree/-/unist-util-position-from-estree-2.0.0.tgz", + "integrity": "sha512-KaFVRjoqLyF6YXCbVLNad/eS4+OfPQQn2yOd7zF/h5T/CSL2v8NpN6a5TPvtbXthAGw5nG+PuTtq+DdIZr+cRQ==", "dev": true, - "engines": { - "node": ">=4" + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/unicode-match-property-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, + "license": "MIT", "dependencies": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" + "@types/unist": "^3.0.0" }, - "engines": { - "node": ">=4" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/unicode-match-property-value-ecmascript": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", "dev": true, - "engines": { - "node": ">=4" + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/unicode-property-aliases-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "node_modules/unist-util-visit-parents": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", + "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", "dev": true, - "engines": { - "node": ">=4" + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/unique-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", - "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "node_modules/unrs-resolver": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.7.2.tgz", + "integrity": "sha512-BBKpaylOW8KbHsu378Zky/dGh4ckT/4NW/0SHRABdqRLcQJ2dAOjDo9g97p04sWflm0kqPqpUatxReNV/dqI5A==", "dev": true, + "hasInstallScript": true, + "license": "MIT", "dependencies": { - "crypto-random-string": "^2.0.0" + "napi-postinstall": "^0.2.2" }, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/sponsors/JounQin" + }, + "optionalDependencies": { + "@unrs/resolver-binding-darwin-arm64": "1.7.2", + "@unrs/resolver-binding-darwin-x64": "1.7.2", + "@unrs/resolver-binding-freebsd-x64": "1.7.2", + "@unrs/resolver-binding-linux-arm-gnueabihf": "1.7.2", + "@unrs/resolver-binding-linux-arm-musleabihf": "1.7.2", + "@unrs/resolver-binding-linux-arm64-gnu": "1.7.2", + "@unrs/resolver-binding-linux-arm64-musl": "1.7.2", + "@unrs/resolver-binding-linux-ppc64-gnu": "1.7.2", + "@unrs/resolver-binding-linux-riscv64-gnu": "1.7.2", + "@unrs/resolver-binding-linux-riscv64-musl": "1.7.2", + "@unrs/resolver-binding-linux-s390x-gnu": "1.7.2", + "@unrs/resolver-binding-linux-x64-gnu": "1.7.2", + "@unrs/resolver-binding-linux-x64-musl": "1.7.2", + "@unrs/resolver-binding-wasm32-wasi": "1.7.2", + "@unrs/resolver-binding-win32-arm64-msvc": "1.7.2", + "@unrs/resolver-binding-win32-ia32-msvc": "1.7.2", + "@unrs/resolver-binding-win32-x64-msvc": "1.7.2" } }, "node_modules/update-browserslist-db": { @@ -11508,6 +13354,36 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/w3c-keyname": { "version": "2.2.8", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", @@ -11837,6 +13713,17 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } } }, "dependencies": { @@ -11896,21 +13783,6 @@ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true - }, - "debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true } } }, @@ -12173,26 +14045,11 @@ "globals": "^11.1.0" }, "dependencies": { - "debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true } } }, @@ -12346,10 +14203,31 @@ } } }, + "@emnapi/core": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.3.tgz", + "integrity": "sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g==", + "dev": true, + "optional": true, + "requires": { + "@emnapi/wasi-threads": "1.0.2", + "tslib": "^2.4.0" + } + }, "@emnapi/runtime": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.0.tgz", - "integrity": "sha512-64WYIf4UYcdLnbKn/umDlNjQDSS8AgZrI/R9+x5ilkUVFxXcA1Ebl+gQLc/6mERA4407Xof0R7wEyEuj091CVw==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.3.tgz", + "integrity": "sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ==", + "dev": true, + "optional": true, + "requires": { + "tslib": "^2.4.0" + } + }, + "@emnapi/wasi-threads": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.0.2.tgz", + "integrity": "sha512-5n3nTJblwRi8LlXkJ9eBzu+kZR8Yxcc7ubakyQTFzPMtIhFpUBRbsnc2Dv88IZDIbCDlBiWrknhB4Lsz7mg6BA==", "dev": true, "optional": true, "requires": { @@ -12563,23 +14441,6 @@ "@eslint/object-schema": "^2.1.6", "debug": "^4.3.1", "minimatch": "^3.1.2" - }, - "dependencies": { - "debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - } } }, "@eslint/core": { @@ -12614,15 +14475,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, "globals": { "version": "14.0.0", "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", @@ -12637,12 +14489,6 @@ "requires": { "argparse": "^2.0.1" } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true } } }, @@ -12716,162 +14562,169 @@ "dev": true }, "@img/sharp-darwin-arm64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", - "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.1.tgz", + "integrity": "sha512-pn44xgBtgpEbZsu+lWf2KNb6OAf70X68k+yk69Ic2Xz11zHR/w24/U49XT7AeRwJ0Px+mhALhU5LPci1Aymk7A==", "dev": true, "optional": true, "requires": { - "@img/sharp-libvips-darwin-arm64": "1.0.4" + "@img/sharp-libvips-darwin-arm64": "1.1.0" } }, "@img/sharp-darwin-x64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", - "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.1.tgz", + "integrity": "sha512-VfuYgG2r8BpYiOUN+BfYeFo69nP/MIwAtSJ7/Zpxc5QF3KS22z8Pvg3FkrSFJBPNQ7mmcUcYQFBmEQp7eu1F8Q==", "dev": true, "optional": true, "requires": { - "@img/sharp-libvips-darwin-x64": "1.0.4" + "@img/sharp-libvips-darwin-x64": "1.1.0" } }, "@img/sharp-libvips-darwin-arm64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", - "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.1.0.tgz", + "integrity": "sha512-HZ/JUmPwrJSoM4DIQPv/BfNh9yrOA8tlBbqbLz4JZ5uew2+o22Ik+tHQJcih7QJuSa0zo5coHTfD5J8inqj9DA==", "dev": true, "optional": true }, "@img/sharp-libvips-darwin-x64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", - "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.1.0.tgz", + "integrity": "sha512-Xzc2ToEmHN+hfvsl9wja0RlnXEgpKNmftriQp6XzY/RaSfwD9th+MSh0WQKzUreLKKINb3afirxW7A0fz2YWuQ==", "dev": true, "optional": true }, "@img/sharp-libvips-linux-arm": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", - "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.1.0.tgz", + "integrity": "sha512-s8BAd0lwUIvYCJyRdFqvsj+BJIpDBSxs6ivrOPm/R7piTs5UIwY5OjXrP2bqXC9/moGsyRa37eYWYCOGVXxVrA==", "dev": true, "optional": true }, "@img/sharp-libvips-linux-arm64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", - "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.1.0.tgz", + "integrity": "sha512-IVfGJa7gjChDET1dK9SekxFFdflarnUB8PwW8aGwEoF3oAsSDuNUTYS+SKDOyOJxQyDC1aPFMuRYLoDInyV9Ew==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-ppc64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.1.0.tgz", + "integrity": "sha512-tiXxFZFbhnkWE2LA8oQj7KYR+bWBkiV2nilRldT7bqoEZ4HiDOcePr9wVDAZPi/Id5fT1oY9iGnDq20cwUz8lQ==", "dev": true, "optional": true }, "@img/sharp-libvips-linux-s390x": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", - "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.1.0.tgz", + "integrity": "sha512-xukSwvhguw7COyzvmjydRb3x/09+21HykyapcZchiCUkTThEQEOMtBj9UhkaBRLuBrgLFzQ2wbxdeCCJW/jgJA==", "dev": true, "optional": true }, "@img/sharp-libvips-linux-x64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", - "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.1.0.tgz", + "integrity": "sha512-yRj2+reB8iMg9W5sULM3S74jVS7zqSzHG3Ol/twnAAkAhnGQnpjj6e4ayUz7V+FpKypwgs82xbRdYtchTTUB+Q==", "dev": true, "optional": true }, "@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", - "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.1.0.tgz", + "integrity": "sha512-jYZdG+whg0MDK+q2COKbYidaqW/WTz0cc1E+tMAusiDygrM4ypmSCjOJPmFTvHHJ8j/6cAGyeDWZOsK06tP33w==", "dev": true, "optional": true }, "@img/sharp-libvips-linuxmusl-x64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", - "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.1.0.tgz", + "integrity": "sha512-wK7SBdwrAiycjXdkPnGCPLjYb9lD4l6Ze2gSdAGVZrEL05AOUJESWU2lhlC+Ffn5/G+VKuSm6zzbQSzFX/P65A==", "dev": true, "optional": true }, "@img/sharp-linux-arm": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", - "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.1.tgz", + "integrity": "sha512-anKiszvACti2sGy9CirTlNyk7BjjZPiML1jt2ZkTdcvpLU1YH6CXwRAZCA2UmRXnhiIftXQ7+Oh62Ji25W72jA==", "dev": true, "optional": true, "requires": { - "@img/sharp-libvips-linux-arm": "1.0.5" + "@img/sharp-libvips-linux-arm": "1.1.0" } }, "@img/sharp-linux-arm64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", - "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.1.tgz", + "integrity": "sha512-kX2c+vbvaXC6vly1RDf/IWNXxrlxLNpBVWkdpRq5Ka7OOKj6nr66etKy2IENf6FtOgklkg9ZdGpEu9kwdlcwOQ==", "dev": true, "optional": true, "requires": { - "@img/sharp-libvips-linux-arm64": "1.0.4" + "@img/sharp-libvips-linux-arm64": "1.1.0" } }, "@img/sharp-linux-s390x": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", - "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.1.tgz", + "integrity": "sha512-7s0KX2tI9mZI2buRipKIw2X1ufdTeaRgwmRabt5bi9chYfhur+/C1OXg3TKg/eag1W+6CCWLVmSauV1owmRPxA==", "dev": true, "optional": true, "requires": { - "@img/sharp-libvips-linux-s390x": "1.0.4" + "@img/sharp-libvips-linux-s390x": "1.1.0" } }, "@img/sharp-linux-x64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", - "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.1.tgz", + "integrity": "sha512-wExv7SH9nmoBW3Wr2gvQopX1k8q2g5V5Iag8Zk6AVENsjwd+3adjwxtp3Dcu2QhOXr8W9NusBU6XcQUohBZ5MA==", "dev": true, "optional": true, "requires": { - "@img/sharp-libvips-linux-x64": "1.0.4" + "@img/sharp-libvips-linux-x64": "1.1.0" } }, "@img/sharp-linuxmusl-arm64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", - "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.1.tgz", + "integrity": "sha512-DfvyxzHxw4WGdPiTF0SOHnm11Xv4aQexvqhRDAoD00MzHekAj9a/jADXeXYCDFH/DzYruwHbXU7uz+H+nWmSOQ==", "dev": true, "optional": true, "requires": { - "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + "@img/sharp-libvips-linuxmusl-arm64": "1.1.0" } }, "@img/sharp-linuxmusl-x64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", - "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.1.tgz", + "integrity": "sha512-pax/kTR407vNb9qaSIiWVnQplPcGU8LRIJpDT5o8PdAx5aAA7AS3X9PS8Isw1/WfqgQorPotjrZL3Pqh6C5EBg==", "dev": true, "optional": true, "requires": { - "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + "@img/sharp-libvips-linuxmusl-x64": "1.1.0" } }, "@img/sharp-wasm32": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", - "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.1.tgz", + "integrity": "sha512-YDybQnYrLQfEpzGOQe7OKcyLUCML4YOXl428gOOzBgN6Gw0rv8dpsJ7PqTHxBnXnwXr8S1mYFSLSa727tpz0xg==", "dev": true, "optional": true, "requires": { - "@emnapi/runtime": "^1.2.0" + "@emnapi/runtime": "^1.4.0" } }, "@img/sharp-win32-ia32": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", - "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.1.tgz", + "integrity": "sha512-WKf/NAZITnonBf3U1LfdjoMgNO5JYRSlhovhRhMxXVdvWYveM4kM3L8m35onYIdh75cOMCo1BexgVQcCDzyoWw==", "dev": true, "optional": true }, "@img/sharp-win32-x64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", - "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.1.tgz", + "integrity": "sha512-hw1iIAHpNE8q3uMIRCgGOeDoz9KtFNarFLQclLxr/LK1VBkj8nby18RjFvr6aP7USRYAjTZW6yisnBWMX571Tw==", "dev": true, "optional": true }, @@ -13284,65 +15137,170 @@ "integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==", "dev": true }, + "@mdx-js/loader": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@mdx-js/loader/-/loader-3.1.0.tgz", + "integrity": "sha512-xU/lwKdOyfXtQGqn3VnJjlDrmKXEvMi1mgYxVmukEUtVycIz1nh7oQ40bKTd4cA7rLStqu0740pnhGYxGoqsCg==", + "dev": true, + "requires": { + "@mdx-js/mdx": "^3.0.0", + "source-map": "^0.7.0" + }, + "dependencies": { + "source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true + } + } + }, + "@mdx-js/mdx": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.1.0.tgz", + "integrity": "sha512-/QxEhPAvGwbQmy1Px8F899L5Uc2KZ6JtXwlCgJmjSTBedwOZkByYcBG4GceIGPXRDsmfxhHazuS+hlOShRLeDw==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdx": "^2.0.0", + "collapse-white-space": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "estree-util-scope": "^1.0.0", + "estree-walker": "^3.0.0", + "hast-util-to-jsx-runtime": "^2.0.0", + "markdown-extensions": "^2.0.0", + "recma-build-jsx": "^1.0.0", + "recma-jsx": "^1.0.0", + "recma-stringify": "^1.0.0", + "rehype-recma": "^1.0.0", + "remark-mdx": "^3.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "source-map": "^0.7.0", + "unified": "^11.0.0", + "unist-util-position-from-estree": "^2.0.0", + "unist-util-stringify-position": "^4.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "dependencies": { + "estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0" + } + }, + "source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true + } + } + }, + "@mdx-js/react": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-3.1.0.tgz", + "integrity": "sha512-QjHtSaoameoalGnKDT3FoIl4+9RwyTmo9ZJGBdLOks/YOiWHoRDI3PUwEzOE7kEmGcV3AFcp9K6dYu9rEuKLAQ==", + "dev": true, + "requires": { + "@types/mdx": "^2.0.0" + } + }, + "@napi-rs/wasm-runtime": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.9.tgz", + "integrity": "sha512-OKRBiajrrxB9ATokgEQoG87Z25c67pCpYcCwmXYX8PBftC9pBfN18gnm/fh1wurSLEKIAt+QRFLFCQISrb66Jg==", + "dev": true, + "optional": true, + "requires": { + "@emnapi/core": "^1.4.0", + "@emnapi/runtime": "^1.4.0", + "@tybys/wasm-util": "^0.9.0" + } + }, "@next/env": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/env/-/env-15.2.4.tgz", - "integrity": "sha512-+SFtMgoiYP3WoSswuNmxJOCwi06TdWE733D+WPjpXIe4LXGULwEaofiiAy6kbS0+XjM5xF5n3lKuBwN2SnqD9g==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.3.2.tgz", + "integrity": "sha512-xURk++7P7qR9JG1jJtLzPzf0qEvqCN0A/T3DXf8IPMKo9/6FfjxtEffRJIIew/bIL4T3C2jLLqBor8B/zVlx6g==", "dev": true }, + "@next/mdx": { + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/mdx/-/mdx-15.3.2.tgz", + "integrity": "sha512-D6lSSbVzn1EiPwrBKG5QzXClcgdqiNCL8a3/6oROinzgZnYSxbVmnfs0UrqygtGSOmgW7sdJJSEOy555DoAwvw==", + "dev": true, + "requires": { + "source-map": "^0.7.0" + }, + "dependencies": { + "source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true + } + } + }, "@next/swc-darwin-arm64": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.2.4.tgz", - "integrity": "sha512-1AnMfs655ipJEDC/FHkSr0r3lXBgpqKo4K1kiwfUf3iE68rDFXZ1TtHdMvf7D0hMItgDZ7Vuq3JgNMbt/+3bYw==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.3.2.tgz", + "integrity": "sha512-2DR6kY/OGcokbnCsjHpNeQblqCZ85/1j6njYSkzRdpLn5At7OkSdmk7WyAmB9G0k25+VgqVZ/u356OSoQZ3z0g==", "dev": true, "optional": true }, "@next/swc-darwin-x64": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.2.4.tgz", - "integrity": "sha512-3qK2zb5EwCwxnO2HeO+TRqCubeI/NgCe+kL5dTJlPldV/uwCnUgC7VbEzgmxbfrkbjehL4H9BPztWOEtsoMwew==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.3.2.tgz", + "integrity": "sha512-ro/fdqaZWL6k1S/5CLv1I0DaZfDVJkWNaUU3un8Lg6m0YENWlDulmIWzV96Iou2wEYyEsZq51mwV8+XQXqMp3w==", "dev": true, "optional": true }, "@next/swc-linux-arm64-gnu": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.2.4.tgz", - "integrity": "sha512-HFN6GKUcrTWvem8AZN7tT95zPb0GUGv9v0d0iyuTb303vbXkkbHDp/DxufB04jNVD+IN9yHy7y/6Mqq0h0YVaQ==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.3.2.tgz", + "integrity": "sha512-covwwtZYhlbRWK2HlYX9835qXum4xYZ3E2Mra1mdQ+0ICGoMiw1+nVAn4d9Bo7R3JqSmK1grMq/va+0cdh7bJA==", "dev": true, "optional": true }, "@next/swc-linux-arm64-musl": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.2.4.tgz", - "integrity": "sha512-Oioa0SORWLwi35/kVB8aCk5Uq+5/ZIumMK1kJV+jSdazFm2NzPDztsefzdmzzpx5oGCJ6FkUC7vkaUseNTStNA==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.3.2.tgz", + "integrity": "sha512-KQkMEillvlW5Qk5mtGA/3Yz0/tzpNlSw6/3/ttsV1lNtMuOHcGii3zVeXZyi4EJmmLDKYcTcByV2wVsOhDt/zg==", "dev": true, "optional": true }, "@next/swc-linux-x64-gnu": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.2.4.tgz", - "integrity": "sha512-yb5WTRaHdkgOqFOZiu6rHV1fAEK0flVpaIN2HB6kxHVSy/dIajWbThS7qON3W9/SNOH2JWkVCyulgGYekMePuw==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.3.2.tgz", + "integrity": "sha512-uRBo6THWei0chz+Y5j37qzx+BtoDRFIkDzZjlpCItBRXyMPIg079eIkOCl3aqr2tkxL4HFyJ4GHDes7W8HuAUg==", "dev": true, "optional": true }, "@next/swc-linux-x64-musl": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.2.4.tgz", - "integrity": "sha512-Dcdv/ix6srhkM25fgXiyOieFUkz+fOYkHlydWCtB0xMST6X9XYI3yPDKBZt1xuhOytONsIFJFB08xXYsxUwJLw==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.3.2.tgz", + "integrity": "sha512-+uxFlPuCNx/T9PdMClOqeE8USKzj8tVz37KflT3Kdbx/LOlZBRI2yxuIcmx1mPNK8DwSOMNCr4ureSet7eyC0w==", "dev": true, "optional": true }, "@next/swc-win32-arm64-msvc": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.2.4.tgz", - "integrity": "sha512-dW0i7eukvDxtIhCYkMrZNQfNicPDExt2jPb9AZPpL7cfyUo7QSNl1DjsHjmmKp6qNAqUESyT8YFl/Aw91cNJJg==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.3.2.tgz", + "integrity": "sha512-LLTKmaI5cfD8dVzh5Vt7+OMo+AIOClEdIU/TSKbXXT2iScUTSxOGoBhfuv+FU8R9MLmrkIL1e2fBMkEEjYAtPQ==", "dev": true, "optional": true }, "@next/swc-win32-x64-msvc": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.2.4.tgz", - "integrity": "sha512-SbnWkJmkS7Xl3kre8SdMF6F/XDh1DTFEhp0jRTj/uB8iPKoU2bb2NDfcu+iifv1+mxQEd1g2vvSxcZbXSKyWiQ==", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.3.2.tgz", + "integrity": "sha512-aW5B8wOPioJ4mBdMDXkt5f3j8pUr9W8AnlX0Df35uRWNT1Y6RIybxjnSUe+PhM+M1bwgyY8PHLmXZC6zT1o5tA==", "dev": true, "optional": true }, @@ -13372,12 +15330,6 @@ "fastq": "^1.6.0" } }, - "@nolyfill/is-core-module": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", - "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", - "dev": true - }, "@rollup/plugin-buble": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@rollup/plugin-buble/-/plugin-buble-1.0.3.tgz", @@ -13818,6 +15770,16 @@ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true }, + "@tybys/wasm-util": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.9.0.tgz", + "integrity": "sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==", + "dev": true, + "optional": true, + "requires": { + "tslib": "^2.4.0" + } + }, "@types/babel__core": { "version": "7.20.1", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz", @@ -13868,12 +15830,30 @@ "magic-string": "^0.25.0" } }, + "@types/debug": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "dev": true, + "requires": { + "@types/ms": "*" + } + }, "@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, + "@types/estree-jsx": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", + "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", + "dev": true, + "requires": { + "@types/estree": "*" + } + }, "@types/gensync": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.4.tgz", @@ -13889,6 +15869,15 @@ "@types/node": "*" } }, + "@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, "@types/istanbul-lib-coverage": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", @@ -13936,12 +15925,36 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, - "@types/node": { - "version": "14.17.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.3.tgz", - "integrity": "sha512-e6ZowgGJmTuXa3GyaPbTGxX17tnThl2aSSizrFthQ7m9uLGZBXiGhgE55cjRZTF5kjZvYn9EOPOMljdjwbflxw==", + "@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/mdx": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/@types/mdx/-/mdx-2.0.13.tgz", + "integrity": "sha512-+OWZQfAYyio6YkJb3HLxDrvnx6SWWDbC0zVPfBRzUk0/nqoDyf6dNxQi3eArPe8rJ473nobTMQ/8Zk+LxJ+Yuw==", "dev": true }, + "@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "dev": true + }, + "@types/node": { + "version": "22.15.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.17.tgz", + "integrity": "sha512-wIX2aSZL5FE+MR0JlvF87BNVrtFWf6AE6rxSE9X7OwnVvoyCQjpzSRJ+M87se/4QCkCiebQAqrJ0y6fwIyi7nw==", + "dev": true, + "requires": { + "undici-types": "~6.21.0" + } + }, "@types/prismjs": { "version": "1.26.3", "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.3.tgz", @@ -13975,6 +15988,12 @@ "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", "dev": true }, + "@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true + }, "@types/yargs": { "version": "17.0.24", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", @@ -14018,23 +16037,6 @@ "@typescript-eslint/typescript-estree": "8.24.0", "@typescript-eslint/visitor-keys": "8.24.0", "debug": "^4.3.4" - }, - "dependencies": { - "debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - } } }, "@typescript-eslint/scope-manager": { @@ -14054,26 +16056,9 @@ "dev": true, "requires": { "@typescript-eslint/typescript-estree": "8.24.0", - "@typescript-eslint/utils": "8.24.0", - "debug": "^4.3.4", - "ts-api-utils": "^2.0.1" - }, - "dependencies": { - "debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - } + "@typescript-eslint/utils": "8.24.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.0.1" } }, "@typescript-eslint/types": { @@ -14107,15 +16092,6 @@ "balanced-match": "^1.0.0" } }, - "debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, "minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -14125,12 +16101,6 @@ "brace-expansion": "^2.0.1" } }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "semver": { "version": "7.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", @@ -14161,6 +16131,134 @@ "eslint-visitor-keys": "^4.2.0" } }, + "@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "dev": true + }, + "@unrs/resolver-binding-darwin-arm64": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.7.2.tgz", + "integrity": "sha512-vxtBno4xvowwNmO/ASL0Y45TpHqmNkAaDtz4Jqb+clmcVSSl8XCG/PNFFkGsXXXS6AMjP+ja/TtNCFFa1QwLRg==", + "dev": true, + "optional": true + }, + "@unrs/resolver-binding-darwin-x64": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.7.2.tgz", + "integrity": "sha512-qhVa8ozu92C23Hsmv0BF4+5Dyyd5STT1FolV4whNgbY6mj3kA0qsrGPe35zNR3wAN7eFict3s4Rc2dDTPBTuFQ==", + "dev": true, + "optional": true + }, + "@unrs/resolver-binding-freebsd-x64": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.7.2.tgz", + "integrity": "sha512-zKKdm2uMXqLFX6Ac7K5ElnnG5VIXbDlFWzg4WJ8CGUedJryM5A3cTgHuGMw1+P5ziV8CRhnSEgOnurTI4vpHpg==", + "dev": true, + "optional": true + }, + "@unrs/resolver-binding-linux-arm-gnueabihf": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.7.2.tgz", + "integrity": "sha512-8N1z1TbPnHH+iDS/42GJ0bMPLiGK+cUqOhNbMKtWJ4oFGzqSJk/zoXFzcQkgtI63qMcUI7wW1tq2usZQSb2jxw==", + "dev": true, + "optional": true + }, + "@unrs/resolver-binding-linux-arm-musleabihf": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.7.2.tgz", + "integrity": "sha512-tjYzI9LcAXR9MYd9rO45m1s0B/6bJNuZ6jeOxo1pq1K6OBuRMMmfyvJYval3s9FPPGmrldYA3mi4gWDlWuTFGA==", + "dev": true, + "optional": true + }, + "@unrs/resolver-binding-linux-arm64-gnu": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.7.2.tgz", + "integrity": "sha512-jon9M7DKRLGZ9VYSkFMflvNqu9hDtOCEnO2QAryFWgT6o6AXU8du56V7YqnaLKr6rAbZBWYsYpikF226v423QA==", + "dev": true, + "optional": true + }, + "@unrs/resolver-binding-linux-arm64-musl": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.7.2.tgz", + "integrity": "sha512-c8Cg4/h+kQ63pL43wBNaVMmOjXI/X62wQmru51qjfTvI7kmCy5uHTJvK/9LrF0G8Jdx8r34d019P1DVJmhXQpA==", + "dev": true, + "optional": true + }, + "@unrs/resolver-binding-linux-ppc64-gnu": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.7.2.tgz", + "integrity": "sha512-A+lcwRFyrjeJmv3JJvhz5NbcCkLQL6Mk16kHTNm6/aGNc4FwPHPE4DR9DwuCvCnVHvF5IAd9U4VIs/VvVir5lg==", + "dev": true, + "optional": true + }, + "@unrs/resolver-binding-linux-riscv64-gnu": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.7.2.tgz", + "integrity": "sha512-hQQ4TJQrSQW8JlPm7tRpXN8OCNP9ez7PajJNjRD1ZTHQAy685OYqPrKjfaMw/8LiHCt8AZ74rfUVHP9vn0N69Q==", + "dev": true, + "optional": true + }, + "@unrs/resolver-binding-linux-riscv64-musl": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.7.2.tgz", + "integrity": "sha512-NoAGbiqrxtY8kVooZ24i70CjLDlUFI7nDj3I9y54U94p+3kPxwd2L692YsdLa+cqQ0VoqMWoehDFp21PKRUoIQ==", + "dev": true, + "optional": true + }, + "@unrs/resolver-binding-linux-s390x-gnu": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.7.2.tgz", + "integrity": "sha512-KaZByo8xuQZbUhhreBTW+yUnOIHUsv04P8lKjQ5otiGoSJ17ISGYArc+4vKdLEpGaLbemGzr4ZeUbYQQsLWFjA==", + "dev": true, + "optional": true + }, + "@unrs/resolver-binding-linux-x64-gnu": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.7.2.tgz", + "integrity": "sha512-dEidzJDubxxhUCBJ/SHSMJD/9q7JkyfBMT77Px1npl4xpg9t0POLvnWywSk66BgZS/b2Hy9Y1yFaoMTFJUe9yg==", + "dev": true, + "optional": true + }, + "@unrs/resolver-binding-linux-x64-musl": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.7.2.tgz", + "integrity": "sha512-RvP+Ux3wDjmnZDT4XWFfNBRVG0fMsc+yVzNFUqOflnDfZ9OYujv6nkh+GOr+watwrW4wdp6ASfG/e7bkDradsw==", + "dev": true, + "optional": true + }, + "@unrs/resolver-binding-wasm32-wasi": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.7.2.tgz", + "integrity": "sha512-y797JBmO9IsvXVRCKDXOxjyAE4+CcZpla2GSoBQ33TVb3ILXuFnMrbR/QQZoauBYeOFuu4w3ifWLw52sdHGz6g==", + "dev": true, + "optional": true, + "requires": { + "@napi-rs/wasm-runtime": "^0.2.9" + } + }, + "@unrs/resolver-binding-win32-arm64-msvc": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.7.2.tgz", + "integrity": "sha512-gtYTh4/VREVSLA+gHrfbWxaMO/00y+34htY7XpioBTy56YN2eBjkPrY1ML1Zys89X3RJDKVaogzwxlM1qU7egg==", + "dev": true, + "optional": true + }, + "@unrs/resolver-binding-win32-ia32-msvc": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.7.2.tgz", + "integrity": "sha512-Ywv20XHvHTDRQs12jd3MY8X5C8KLjDbg/jyaal/QLKx3fAShhJyD4blEANInsjxW3P7isHx1Blt56iUDDJO3jg==", + "dev": true, + "optional": true + }, + "@unrs/resolver-binding-win32-x64-msvc": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.7.2.tgz", + "integrity": "sha512-friS8NEQfHaDbkThxopGk+LuE5v3iY0StruifjQEt7SLbA46OnfgMO15sOTkbpJkol6RB+1l1TYPXh0sCddpvA==", + "dev": true, + "optional": true + }, "abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", @@ -14218,23 +16316,6 @@ "dev": true, "requires": { "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - } } }, "aggregate-error": { @@ -14426,6 +16507,12 @@ "integrity": "sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==", "dev": true }, + "astring": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/astring/-/astring-1.9.0.tgz", + "integrity": "sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==", + "dev": true + }, "async-function": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", @@ -14517,6 +16604,12 @@ "babel-preset-current-node-syntax": "^1.0.0" } }, + "bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "dev": true + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -14653,6 +16746,12 @@ "integrity": "sha512-b+uH5BakXZ9Do9iK+CkDmctUSEqZl+SP056vc5usa0PL+ev5OHw003rZXcnjNDv3L8P5j6rwT6C0BPKSikW08w==", "dev": true }, + "ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "dev": true + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -14669,6 +16768,30 @@ "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true }, + "character-entities": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", + "dev": true + }, + "character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "dev": true + }, + "character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "dev": true + }, + "character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "dev": true + }, "chokidar": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", @@ -14775,6 +16898,12 @@ "@codemirror/view": "^6.0.0" } }, + "collapse-white-space": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-2.1.0.tgz", + "integrity": "sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==", + "dev": true + }, "collect-v8-coverage": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", @@ -14833,6 +16962,12 @@ "delayed-stream": "~1.0.0" } }, + "comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "dev": true + }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -15017,12 +17152,30 @@ "is-data-view": "^1.0.1" } }, + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, "decimal.js": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", "dev": true }, + "decode-named-character-reference": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.1.0.tgz", + "integrity": "sha512-Wy+JTSbFThEOXQIR2L6mxJvEs+veIzpmqD7ynWxMXGpnk3smkHQOp6forLdHsKpAMW9iJpaBBIxz285t1n1C3w==", + "dev": true, + "requires": { + "character-entities": "^2.0.0" + } + }, "dedent": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", @@ -15092,10 +17245,16 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, - "detect-libc": { + "dequal": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", - "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dev": true + }, + "detect-libc": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", + "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==", "dev": true, "optional": true }, @@ -15105,6 +17264,15 @@ "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true }, + "devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "dev": true, + "requires": { + "dequal": "^2.0.0" + } + }, "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -15167,16 +17335,6 @@ "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true }, - "enhanced-resolve": { - "version": "5.18.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz", - "integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - } - }, "entities": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", @@ -15328,6 +17486,38 @@ "is-symbol": "^1.0.4" } }, + "esast-util-from-estree": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/esast-util-from-estree/-/esast-util-from-estree-2.0.0.tgz", + "integrity": "sha512-4CyanoAudUSBAn5K13H4JhsMH6L9ZP7XbLVe/dKybkxMO7eDyLsT8UHl9TRNrU2Gr9nz+FovfSIjuXWJ81uVwQ==", + "dev": true, + "requires": { + "@types/estree-jsx": "^1.0.0", + "devlop": "^1.0.0", + "estree-util-visit": "^2.0.0", + "unist-util-position-from-estree": "^2.0.0" + } + }, + "esast-util-from-js": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esast-util-from-js/-/esast-util-from-js-2.0.1.tgz", + "integrity": "sha512-8Ja+rNJ0Lt56Pcf3TAmpBZjmx8ZcK5Ts4cAzIOjsjevg9oSXJnl6SUQ2EevU8tv3h6ZLWmoKL5H4fgWvdvfETw==", + "dev": true, + "requires": { + "@types/estree-jsx": "^1.0.0", + "acorn": "^8.0.0", + "esast-util-from-estree": "^2.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "dev": true + } + } + }, "esbuild": { "version": "0.25.1", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.1.tgz", @@ -15478,15 +17668,6 @@ "optionator": "^0.9.3" }, "dependencies": { - "debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, "glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -15495,12 +17676,6 @@ "requires": { "is-glob": "^4.0.3" } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true } } }, @@ -15523,46 +17698,21 @@ "requires": { "ms": "^2.1.1" } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true } } }, "eslint-import-resolver-typescript": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.7.0.tgz", - "integrity": "sha512-Vrwyi8HHxY97K5ebydMtffsWAn1SCR9eol49eCd5fJS4O1WV7PaAjbcjmbfJJSMz/t4Mal212Uz/fQZrOB8mow==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-4.3.4.tgz", + "integrity": "sha512-buzw5z5VtiQMysYLH9iW9BV04YyZebsw+gPi+c4FCjfS9i6COYOrEWw9t3m3wA9PFBfqcBCqWf32qrXLbwafDw==", "dev": true, "requires": { - "@nolyfill/is-core-module": "1.0.39", - "debug": "^4.3.7", - "enhanced-resolve": "^5.15.0", - "fast-glob": "^3.3.2", - "get-tsconfig": "^4.7.5", - "is-bun-module": "^1.0.2", - "is-glob": "^4.0.3", - "stable-hash": "^0.0.4" - }, - "dependencies": { - "debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - } + "debug": "^4.4.0", + "get-tsconfig": "^4.10.0", + "is-bun-module": "^2.0.0", + "stable-hash": "^0.0.5", + "tinyglobby": "^0.2.13", + "unrs-resolver": "^1.6.3" } }, "eslint-module-utils": { @@ -15582,12 +17732,6 @@ "requires": { "ms": "^2.1.1" } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true } } }, @@ -15626,12 +17770,6 @@ "requires": { "ms": "^2.1.1" } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true } } }, @@ -15748,6 +17886,83 @@ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, + "estree-util-attach-comments": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/estree-util-attach-comments/-/estree-util-attach-comments-3.0.0.tgz", + "integrity": "sha512-cKUwm/HUcTDsYh/9FgnuFqpfquUbwIqwKM26BVCGDPVgvaCl/nDCCjUfiLlx6lsEZ3Z4RFxNbOQ60pkaEwFxGw==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0" + } + }, + "estree-util-build-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/estree-util-build-jsx/-/estree-util-build-jsx-3.0.1.tgz", + "integrity": "sha512-8U5eiL6BTrPxp/CHbs2yMgP8ftMhR5ww1eIKoWRMlqvltHF8fZn5LRDvTKuxD3DUn+shRbLGqXemcP51oFCsGQ==", + "dev": true, + "requires": { + "@types/estree-jsx": "^1.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "estree-walker": "^3.0.0" + }, + "dependencies": { + "estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0" + } + } + } + }, + "estree-util-is-identifier-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz", + "integrity": "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==", + "dev": true + }, + "estree-util-scope": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/estree-util-scope/-/estree-util-scope-1.0.0.tgz", + "integrity": "sha512-2CAASclonf+JFWBNJPndcOpA8EMJwa0Q8LUFJEKqXLW6+qBvbFZuF5gItbQOs/umBUkjviCSDCbBwU2cXbmrhQ==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0" + } + }, + "estree-util-to-js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/estree-util-to-js/-/estree-util-to-js-2.0.0.tgz", + "integrity": "sha512-WDF+xj5rRWmD5tj6bIqRi6CkLIXbbNQUcxQHzGysQzvHmdYG2G7p/Tf0J0gpxGgkeMZNTIjT/AoSvC9Xehcgdg==", + "dev": true, + "requires": { + "@types/estree-jsx": "^1.0.0", + "astring": "^1.8.0", + "source-map": "^0.7.0" + }, + "dependencies": { + "source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true + } + } + }, + "estree-util-visit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/estree-util-visit/-/estree-util-visit-2.0.0.tgz", + "integrity": "sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==", + "dev": true, + "requires": { + "@types/estree-jsx": "^1.0.0", + "@types/unist": "^3.0.0" + } + }, "estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", @@ -15796,6 +18011,12 @@ "jest-util": "^29.7.0" } }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, "fast-check": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.0.0.tgz", @@ -16143,6 +18364,62 @@ "function-bind": "^1.1.2" } }, + "hast-util-to-estree": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hast-util-to-estree/-/hast-util-to-estree-3.1.3.tgz", + "integrity": "sha512-48+B/rJWAp0jamNbAAf9M7Uf//UVqAoMmgXhBdxTDJLGKY+LRnZ99qcG+Qjl5HfMpYNzS5v4EAwVEF34LeAj7w==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-attach-comments": "^3.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-js": "^1.0.0", + "unist-util-position": "^5.0.0", + "zwitch": "^2.0.0" + } + }, + "hast-util-to-jsx-runtime": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz", + "integrity": "sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-js": "^1.0.0", + "unist-util-position": "^5.0.0", + "vfile-message": "^4.0.0" + } + }, + "hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0" + } + }, "hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", @@ -16173,23 +18450,6 @@ "@tootallnate/once": "2", "agent-base": "6", "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - } } }, "https-proxy-agent": { @@ -16200,23 +18460,6 @@ "requires": { "agent-base": "6", "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - } } }, "human-signals": { @@ -16336,6 +18579,12 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, + "inline-style-parser": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.4.tgz", + "integrity": "sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q==", + "dev": true + }, "internal-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", @@ -16347,6 +18596,22 @@ "side-channel": "^1.1.0" } }, + "is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", + "dev": true + }, + "is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "dev": true, + "requires": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + } + }, "is-array-buffer": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", @@ -16397,12 +18662,12 @@ } }, "is-bun-module": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-1.3.0.tgz", - "integrity": "sha512-DgXeu5UWI0IsMQundYb5UAOzm6G2eVnarJ0byP6Tm55iZNKceD59LNPA2L4VvsScTtHcw0yEkVwSf7PC+QoLSA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-2.0.0.tgz", + "integrity": "sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ==", "dev": true, "requires": { - "semver": "^7.6.3" + "semver": "^7.7.1" }, "dependencies": { "semver": { @@ -16449,6 +18714,12 @@ "has-tostringtag": "^1.0.2" } }, + "is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "dev": true + }, "is-docker": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", @@ -16503,6 +18774,12 @@ "is-extglob": "^2.1.1" } }, + "is-hexadecimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", + "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", + "dev": true + }, "is-inside-container": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", @@ -16534,6 +18811,12 @@ "has-tostringtag": "^1.0.2" } }, + "is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "dev": true + }, "is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", @@ -16708,23 +18991,6 @@ "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", "source-map": "^0.6.1" - }, - "dependencies": { - "debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - } } }, "istanbul-reports": { @@ -17456,119 +19722,613 @@ } } }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.8" + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "make-synchronous": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/make-synchronous/-/make-synchronous-0.1.1.tgz", + "integrity": "sha512-Y4SxxqhaoyMDokJQ0AZz0E+bLhRkOSR7Z/IQoTKPdS6HYi3aobal2kMHoHHoqBadPWjf07P4K1FQLXOx3wf9Yw==", + "dev": true, + "requires": { + "subsume": "^3.0.0", + "type-fest": "^0.16.0" + }, + "dependencies": { + "type-fest": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.16.0.tgz", + "integrity": "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==", + "dev": true + } + } + }, + "makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "requires": { + "tmpl": "1.0.5" + } + }, + "markdown-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz", + "integrity": "sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==", + "dev": true + }, + "marked": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-11.2.0.tgz", + "integrity": "sha512-HR0m3bvu0jAPYiIvLUUQtdg1g6D247//lvcekpHO1WMvbwDlwSkZAX9Lw4F4YHE1T0HaaNve0tuAWuV1UJ6vtw==", + "dev": true + }, + "marked-highlight": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/marked-highlight/-/marked-highlight-2.1.0.tgz", + "integrity": "sha512-peBvgGZZqUw074Vy/N8Y7/6JQhSnR54/T0Ozq2/fAIBzcYfVfExFdQJptIhQxreR1elpwvJRrqhp6S/Prk8prA==", + "dev": true, + "requires": {} + }, + "math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true + }, + "mdast-util-from-markdown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.2.tgz", + "integrity": "sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" + } + }, + "mdast-util-mdx": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-3.0.0.tgz", + "integrity": "sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w==", + "dev": true, + "requires": { + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + } + }, + "mdast-util-mdx-expression": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz", + "integrity": "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==", + "dev": true, + "requires": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + } + }, + "mdast-util-mdx-jsx": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.2.0.tgz", + "integrity": "sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q==", + "dev": true, + "requires": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "mdast-util-mdxjs-esm": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz", + "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==", + "dev": true, + "requires": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + } + }, + "mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + } + }, + "mdast-util-to-hast": { + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz", + "integrity": "sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + } + }, + "mdast-util-to-markdown": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz", + "integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + } + }, + "mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0" + } + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "dev": true + }, + "meow": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", + "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", + "dev": true + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromark": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", + "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", + "dev": true, + "requires": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-core-commonmark": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", + "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", + "dev": true, + "requires": { + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-extension-mdx-expression": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-3.0.1.tgz", + "integrity": "sha512-dD/ADLJ1AeMvSAKBwO22zG22N4ybhe7kFIZ3LsDI0GlsNr2A3KYxb0LdC1u5rj4Nw+CHKY0RVdnHX8vj8ejm4Q==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-mdx-expression": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-extension-mdx-jsx": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-3.0.2.tgz", + "integrity": "sha512-e5+q1DjMh62LZAJOnDraSSbDMvGJ8x3cbjygy2qFEi7HCeUT4BDKCvMozPozcD6WmOt6sVvYDNBKhFSz3kjOVQ==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "micromark-factory-mdx-expression": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "vfile-message": "^4.0.0" + } + }, + "micromark-extension-mdx-md": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-md/-/micromark-extension-mdx-md-2.0.0.tgz", + "integrity": "sha512-EpAiszsB3blw4Rpba7xTOUptcFeBFi+6PY8VnJ2hhimH+vCQDirWgsMpz7w1XcZE7LVrSAUGb9VJpG9ghlYvYQ==", + "dev": true, + "requires": { + "micromark-util-types": "^2.0.0" + } + }, + "micromark-extension-mdxjs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs/-/micromark-extension-mdxjs-3.0.0.tgz", + "integrity": "sha512-A873fJfhnJ2siZyUrJ31l34Uqwy4xIFmvPY1oj+Ean5PHcPBYzEsvqvWGaWcfEIr11O5Dlw3p2y0tZWpKHDejQ==", + "dev": true, + "requires": { + "acorn": "^8.0.0", + "acorn-jsx": "^5.0.0", + "micromark-extension-mdx-expression": "^3.0.0", + "micromark-extension-mdx-jsx": "^3.0.0", + "micromark-extension-mdx-md": "^2.0.0", + "micromark-extension-mdxjs-esm": "^3.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "dependencies": { + "acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "dev": true + } + } + }, + "micromark-extension-mdxjs-esm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs-esm/-/micromark-extension-mdxjs-esm-3.0.0.tgz", + "integrity": "sha512-DJFl4ZqkErRpq/dAPyeWp15tGrcrrJho1hKK5uBS70BCtfrIFg81sqcTVu3Ta+KD1Tk5vAtBNElWxtAa+m8K9A==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-position-from-estree": "^2.0.0", + "vfile-message": "^4.0.0" + } + }, + "micromark-factory-destination": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", + "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==", + "dev": true, + "requires": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-factory-label": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz", + "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==", + "dev": true, + "requires": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-factory-mdx-expression": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-2.0.3.tgz", + "integrity": "sha512-kQnEtA3vzucU2BkrIa8/VaSAsP+EJ3CKOvhMuJgOEGg9KDC6OAY6nSnNDVRiVNRqj7Y4SlSzcStaH/5jge8JdQ==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-position-from-estree": "^2.0.0", + "vfile-message": "^4.0.0" + } + }, + "micromark-factory-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", + "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", + "dev": true, + "requires": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-factory-title": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz", + "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==", + "dev": true, + "requires": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-factory-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz", + "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==", + "dev": true, + "requires": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-util-character": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", + "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", + "dev": true, + "requires": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-util-chunked": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz", + "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==", + "dev": true, + "requires": { + "micromark-util-symbol": "^2.0.0" + } + }, + "micromark-util-classify-character": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz", + "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==", "dev": true, "requires": { - "p-locate": "^5.0.0" + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "micromark-util-combine-extensions": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz", + "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==", + "dev": true, + "requires": { + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" + } }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "micromark-util-decode-numeric-character-reference": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz", + "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==", + "dev": true, + "requires": { + "micromark-util-symbol": "^2.0.0" + } }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "micromark-util-decode-string": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz", + "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==", "dev": true, "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" } }, - "magic-string": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", - "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "micromark-util-encode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", + "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", + "dev": true + }, + "micromark-util-events-to-acorn": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-util-events-to-acorn/-/micromark-util-events-to-acorn-2.0.3.tgz", + "integrity": "sha512-jmsiEIiZ1n7X1Rr5k8wVExBQCg5jy4UXVADItHmNk1zkwEVhBuIUKRu3fqv+hs4nxLISi2DQGlqIOGiFxgbfHg==", "dev": true, "requires": { - "sourcemap-codec": "^1.4.8" + "@types/estree": "^1.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "estree-util-visit": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "vfile-message": "^4.0.0" } }, - "make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "micromark-util-html-tag-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz", + "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==", "dev": true }, - "make-synchronous": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/make-synchronous/-/make-synchronous-0.1.1.tgz", - "integrity": "sha512-Y4SxxqhaoyMDokJQ0AZz0E+bLhRkOSR7Z/IQoTKPdS6HYi3aobal2kMHoHHoqBadPWjf07P4K1FQLXOx3wf9Yw==", + "micromark-util-normalize-identifier": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz", + "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==", "dev": true, "requires": { - "subsume": "^3.0.0", - "type-fest": "^0.16.0" - }, - "dependencies": { - "type-fest": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.16.0.tgz", - "integrity": "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==", - "dev": true - } + "micromark-util-symbol": "^2.0.0" } }, - "makeerror": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", - "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "micromark-util-resolve-all": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz", + "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==", "dev": true, "requires": { - "tmpl": "1.0.5" + "micromark-util-types": "^2.0.0" } }, - "marked": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-11.2.0.tgz", - "integrity": "sha512-HR0m3bvu0jAPYiIvLUUQtdg1g6D247//lvcekpHO1WMvbwDlwSkZAX9Lw4F4YHE1T0HaaNve0tuAWuV1UJ6vtw==", - "dev": true + "micromark-util-sanitize-uri": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", + "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", + "dev": true, + "requires": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } }, - "marked-highlight": { + "micromark-util-subtokenize": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/marked-highlight/-/marked-highlight-2.1.0.tgz", - "integrity": "sha512-peBvgGZZqUw074Vy/N8Y7/6JQhSnR54/T0Ozq2/fAIBzcYfVfExFdQJptIhQxreR1elpwvJRrqhp6S/Prk8prA==", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", + "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", "dev": true, - "requires": {} - }, - "math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true - }, - "memorystream": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", - "dev": true - }, - "meow": { - "version": "12.1.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", - "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", - "dev": true + "requires": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } }, - "merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "micromark-util-symbol": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", + "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", "dev": true }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "micromark-util-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", + "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", "dev": true }, "micromatch": { @@ -17627,6 +20387,12 @@ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, "nanoid": { "version": "3.3.10", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.10.tgz", @@ -17642,6 +20408,12 @@ "picocolors": "^1.1.1" } }, + "napi-postinstall": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.2.3.tgz", + "integrity": "sha512-Mi7JISo/4Ij2tDZ2xBE2WH+/KvVlkhA6juEjpEeRAVPNCpN3nxJo/5FhDNKgBcdmcmhaH6JjgST4xY/23ZYK0w==", + "dev": true + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -17655,26 +20427,26 @@ "dev": true }, "next": { - "version": "15.2.4", - "resolved": "https://registry.npmjs.org/next/-/next-15.2.4.tgz", - "integrity": "sha512-VwL+LAaPSxEkd3lU2xWbgEOtrM8oedmyhBqaVNmgKB+GvZlCy9rgaEc+y2on0wv+l0oSFqLtYD6dcC1eAedUaQ==", - "dev": true, - "requires": { - "@next/env": "15.2.4", - "@next/swc-darwin-arm64": "15.2.4", - "@next/swc-darwin-x64": "15.2.4", - "@next/swc-linux-arm64-gnu": "15.2.4", - "@next/swc-linux-arm64-musl": "15.2.4", - "@next/swc-linux-x64-gnu": "15.2.4", - "@next/swc-linux-x64-musl": "15.2.4", - "@next/swc-win32-arm64-msvc": "15.2.4", - "@next/swc-win32-x64-msvc": "15.2.4", + "version": "15.3.2", + "resolved": "https://registry.npmjs.org/next/-/next-15.3.2.tgz", + "integrity": "sha512-CA3BatMyHkxZ48sgOCLdVHjFU36N7TF1HhqAHLFOkV6buwZnvMI84Cug8xD56B9mCuKrqXnLn94417GrZ/jjCQ==", + "dev": true, + "requires": { + "@next/env": "15.3.2", + "@next/swc-darwin-arm64": "15.3.2", + "@next/swc-darwin-x64": "15.3.2", + "@next/swc-linux-arm64-gnu": "15.3.2", + "@next/swc-linux-arm64-musl": "15.3.2", + "@next/swc-linux-x64-gnu": "15.3.2", + "@next/swc-linux-x64-musl": "15.3.2", + "@next/swc-win32-arm64-msvc": "15.3.2", + "@next/swc-win32-x64-msvc": "15.3.2", "@swc/counter": "0.1.3", "@swc/helpers": "0.5.15", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", "postcss": "8.4.31", - "sharp": "^0.33.5", + "sharp": "^0.34.1", "styled-jsx": "5.1.6" } }, @@ -18100,6 +20872,29 @@ "callsites": "^3.0.0" } }, + "parse-entities": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz", + "integrity": "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "dev": true + } + } + }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", @@ -18266,6 +21061,12 @@ "react-is": "^16.13.1" } }, + "property-information": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.0.0.tgz", + "integrity": "sha512-7D/qOz/+Y4X/rzSB6jKxKUsQnphO046ei8qxG59mtM3RG3DHgTK81HrxrmoDVINJb8NKT5ZsRbwHvQ6B68Iyhg==", + "dev": true + }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -18363,6 +21164,54 @@ "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", "dev": true }, + "recma-build-jsx": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/recma-build-jsx/-/recma-build-jsx-1.0.0.tgz", + "integrity": "sha512-8GtdyqaBcDfva+GUKDr3nev3VpKAhup1+RvkMvUxURHpW7QyIvk9F5wz7Vzo06CEMSilw6uArgRqhpiUcWp8ew==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "estree-util-build-jsx": "^3.0.0", + "vfile": "^6.0.0" + } + }, + "recma-jsx": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/recma-jsx/-/recma-jsx-1.0.0.tgz", + "integrity": "sha512-5vwkv65qWwYxg+Atz95acp8DMu1JDSqdGkA2Of1j6rCreyFUE/gp15fC8MnGEuG1W68UKjM6x6+YTWIh7hZM/Q==", + "dev": true, + "requires": { + "acorn-jsx": "^5.0.0", + "estree-util-to-js": "^2.0.0", + "recma-parse": "^1.0.0", + "recma-stringify": "^1.0.0", + "unified": "^11.0.0" + } + }, + "recma-parse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/recma-parse/-/recma-parse-1.0.0.tgz", + "integrity": "sha512-OYLsIGBB5Y5wjnSnQW6t3Xg7q3fQ7FWbw/vcXtORTnyaSFscOtABg+7Pnz6YZ6c27fG1/aN8CjfwoUEUIdwqWQ==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "esast-util-from-js": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "recma-stringify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/recma-stringify/-/recma-stringify-1.0.0.tgz", + "integrity": "sha512-cjwII1MdIIVloKvC9ErQ+OgAtwHBmcZ0Bg4ciz78FtbT8In39aAYbaA7zvxQ61xVMSPE8WxhLwLbhif4Js2C+g==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "estree-util-to-js": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, "reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", @@ -18431,6 +21280,52 @@ } } }, + "rehype-recma": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/rehype-recma/-/rehype-recma-1.0.0.tgz", + "integrity": "sha512-lqA4rGUf1JmacCNWWZx0Wv1dHqMwxzsDWYMTowuplHF3xH0N/MmrZ/G3BDZnzAkRmxDadujCjaKM2hqYdCBOGw==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "hast-util-to-estree": "^3.0.0" + } + }, + "remark-mdx": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.1.0.tgz", + "integrity": "sha512-Ngl/H3YXyBV9RcRNdlYsZujAmhsxwzxpDzpDEhFBVAGthS4GDgnctpDjgFl/ULx5UEDzqtW1cyBSNKqYYrqLBA==", + "dev": true, + "requires": { + "mdast-util-mdx": "^3.0.0", + "micromark-extension-mdxjs": "^3.0.0" + } + }, + "remark-parse": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" + } + }, + "remark-rehype": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.2.tgz", + "integrity": "sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-to-hast": "^13.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -18678,34 +21573,35 @@ } }, "sharp": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", - "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.1.tgz", + "integrity": "sha512-1j0w61+eVxu7DawFJtnfYcvSv6qPFvfTaqzTQ2BLknVhHTwGS8sc63ZBF4rzkWMBVKybo4S5OBtDdZahh2A1xg==", "dev": true, "optional": true, "requires": { - "@img/sharp-darwin-arm64": "0.33.5", - "@img/sharp-darwin-x64": "0.33.5", - "@img/sharp-libvips-darwin-arm64": "1.0.4", - "@img/sharp-libvips-darwin-x64": "1.0.4", - "@img/sharp-libvips-linux-arm": "1.0.5", - "@img/sharp-libvips-linux-arm64": "1.0.4", - "@img/sharp-libvips-linux-s390x": "1.0.4", - "@img/sharp-libvips-linux-x64": "1.0.4", - "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", - "@img/sharp-libvips-linuxmusl-x64": "1.0.4", - "@img/sharp-linux-arm": "0.33.5", - "@img/sharp-linux-arm64": "0.33.5", - "@img/sharp-linux-s390x": "0.33.5", - "@img/sharp-linux-x64": "0.33.5", - "@img/sharp-linuxmusl-arm64": "0.33.5", - "@img/sharp-linuxmusl-x64": "0.33.5", - "@img/sharp-wasm32": "0.33.5", - "@img/sharp-win32-ia32": "0.33.5", - "@img/sharp-win32-x64": "0.33.5", + "@img/sharp-darwin-arm64": "0.34.1", + "@img/sharp-darwin-x64": "0.34.1", + "@img/sharp-libvips-darwin-arm64": "1.1.0", + "@img/sharp-libvips-darwin-x64": "1.1.0", + "@img/sharp-libvips-linux-arm": "1.1.0", + "@img/sharp-libvips-linux-arm64": "1.1.0", + "@img/sharp-libvips-linux-ppc64": "1.1.0", + "@img/sharp-libvips-linux-s390x": "1.1.0", + "@img/sharp-libvips-linux-x64": "1.1.0", + "@img/sharp-libvips-linuxmusl-arm64": "1.1.0", + "@img/sharp-libvips-linuxmusl-x64": "1.1.0", + "@img/sharp-linux-arm": "0.34.1", + "@img/sharp-linux-arm64": "0.34.1", + "@img/sharp-linux-s390x": "0.34.1", + "@img/sharp-linux-x64": "0.34.1", + "@img/sharp-linuxmusl-arm64": "0.34.1", + "@img/sharp-linuxmusl-x64": "0.34.1", + "@img/sharp-wasm32": "0.34.1", + "@img/sharp-win32-ia32": "0.34.1", + "@img/sharp-win32-x64": "0.34.1", "color": "^4.2.3", "detect-libc": "^2.0.3", - "semver": "^7.6.3" + "semver": "^7.7.1" }, "dependencies": { "semver": { @@ -18872,6 +21768,12 @@ "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "dev": true }, + "space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "dev": true + }, "spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -18911,9 +21813,9 @@ "dev": true }, "stable-hash": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.4.tgz", - "integrity": "sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==", + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.5.tgz", + "integrity": "sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA==", "dev": true }, "stack-utils": { @@ -19029,6 +21931,16 @@ "es-object-atoms": "^1.0.0" } }, + "stringify-entities": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "dev": true, + "requires": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + } + }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -19062,6 +21974,24 @@ "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==", "dev": true }, + "style-to-js": { + "version": "1.1.16", + "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.16.tgz", + "integrity": "sha512-/Q6ld50hKYPH3d/r6nr117TZkHR0w0kGGIVfpG9N6D8NymRPM9RqCUv4pRpJ62E5DqOYx2AFpbZMyCPnjQCnOw==", + "dev": true, + "requires": { + "style-to-object": "1.0.8" + } + }, + "style-to-object": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.8.tgz", + "integrity": "sha512-xT47I/Eo0rwJmaXC4oilDGDWLohVhR6o/xAQcPQN8q6QBuZVL8qMYL85kLmST5cPjAorwvqIA4qXTRQoYHaL6g==", + "dev": true, + "requires": { + "inline-style-parser": "0.2.4" + } + }, "styled-jsx": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz", @@ -19110,12 +22040,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "tapable": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", - "dev": true - }, "terser": { "version": "5.19.2", "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.2.tgz", @@ -19148,19 +22072,19 @@ } }, "tinyglobby": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", - "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz", + "integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==", "dev": true, "requires": { - "fdir": "^6.4.3", + "fdir": "^6.4.4", "picomatch": "^4.0.2" }, "dependencies": { "fdir": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", - "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", + "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", "dev": true, "requires": {} }, @@ -19202,6 +22126,18 @@ "integrity": "sha1-1YYsEO/0vj0zIqv2u3QuMPG7b8Q=", "dev": true }, + "trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "dev": true + }, + "trough": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", + "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", + "dev": true + }, "ts-api-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", @@ -19377,6 +22313,12 @@ "which-boxed-primitive": "^1.1.1" } }, + "undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true + }, "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", @@ -19405,6 +22347,21 @@ "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", "dev": true }, + "unified": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", + "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, "unique-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", @@ -19414,6 +22371,89 @@ "crypto-random-string": "^2.0.0" } }, + "unist-util-is": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", + "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-position-from-estree": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position-from-estree/-/unist-util-position-from-estree-2.0.0.tgz", + "integrity": "sha512-KaFVRjoqLyF6YXCbVLNad/eS4+OfPQQn2yOd7zF/h5T/CSL2v8NpN6a5TPvtbXthAGw5nG+PuTtq+DdIZr+cRQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + } + }, + "unist-util-visit-parents": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", + "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + } + }, + "unrs-resolver": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.7.2.tgz", + "integrity": "sha512-BBKpaylOW8KbHsu378Zky/dGh4ckT/4NW/0SHRABdqRLcQJ2dAOjDo9g97p04sWflm0kqPqpUatxReNV/dqI5A==", + "dev": true, + "requires": { + "@unrs/resolver-binding-darwin-arm64": "1.7.2", + "@unrs/resolver-binding-darwin-x64": "1.7.2", + "@unrs/resolver-binding-freebsd-x64": "1.7.2", + "@unrs/resolver-binding-linux-arm-gnueabihf": "1.7.2", + "@unrs/resolver-binding-linux-arm-musleabihf": "1.7.2", + "@unrs/resolver-binding-linux-arm64-gnu": "1.7.2", + "@unrs/resolver-binding-linux-arm64-musl": "1.7.2", + "@unrs/resolver-binding-linux-ppc64-gnu": "1.7.2", + "@unrs/resolver-binding-linux-riscv64-gnu": "1.7.2", + "@unrs/resolver-binding-linux-riscv64-musl": "1.7.2", + "@unrs/resolver-binding-linux-s390x-gnu": "1.7.2", + "@unrs/resolver-binding-linux-x64-gnu": "1.7.2", + "@unrs/resolver-binding-linux-x64-musl": "1.7.2", + "@unrs/resolver-binding-wasm32-wasi": "1.7.2", + "@unrs/resolver-binding-win32-arm64-msvc": "1.7.2", + "@unrs/resolver-binding-win32-ia32-msvc": "1.7.2", + "@unrs/resolver-binding-win32-x64-msvc": "1.7.2", + "napi-postinstall": "^0.2.2" + } + }, "update-browserslist-db": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", @@ -19470,6 +22510,26 @@ "spdx-expression-parse": "^3.0.0" } }, + "vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + }, "w3c-keyname": { "version": "2.2.8", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", @@ -19700,6 +22760,12 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true + }, + "zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "dev": true } } } diff --git a/package.json b/package.json index e773736d96..9d7ef03c4b 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "build:types": "cpy \"./type-definitions/immutable.*\" dist", "build:prepare": "./resources/prepare-dist.sh", "build:stats": "node ./resources/dist-stats.mjs", - "website:build": "cd website && next build && next-sitemap", + "website:build": "cd website && rm -rf out && next build --turbopack && next-sitemap", "website:dev": "cd website && next dev --turbopack", "check-build-output": "node ./resources/check-build-output.mjs", "check-git-clean": "./resources/check-git-clean.sh", @@ -91,6 +91,9 @@ "@eslint/js": "^9.20.0", "@jdeniau/immutable-devtools": "^0.2.0", "@jest/globals": "^29.7.0", + "@mdx-js/loader": "^3.1.0", + "@mdx-js/react": "^3.1.0", + "@next/mdx": "^15.3.2", "@rollup/plugin-buble": "1.0.3", "@rollup/plugin-commonjs": "28.0.2", "@rollup/plugin-json": "6.1.0", @@ -98,6 +101,8 @@ "@rollup/plugin-typescript": "^12.1.2", "@size-limit/esbuild-why": "^11.2.0", "@size-limit/preset-small-lib": "^11.2.0", + "@types/mdx": "^2.0.13", + "@types/node": "^22.15.17", "@types/prismjs": "^1.26.3", "@types/random-seed": "0.3.5", "@types/react": "19.1.0", @@ -106,7 +111,7 @@ "colors": "1.4.0", "cpy-cli": "^5.0.0", "eslint": "^9.20.1", - "eslint-import-resolver-typescript": "^3.7.0", + "eslint-import-resolver-typescript": "^4.3.4", "eslint-plugin-import": "^2.31.0", "eslint-plugin-jest": "^28.11.0", "eslint-plugin-react": "^7.37.4", @@ -120,7 +125,7 @@ "marked": "^11.2.0", "marked-highlight": "^2.1.0", "microtime": "3.1.1", - "next": "15.2.4", + "next": "^15.3.2", "next-sitemap": "4.2.3", "npm-run-all": "4.1.5", "prettier": "^3.5.0", diff --git a/type-definitions/immutable.d.ts b/type-definitions/immutable.d.ts index 331dc2c6a8..27567b5b03 100644 --- a/type-definitions/immutable.d.ts +++ b/type-definitions/immutable.d.ts @@ -2603,8 +2603,6 @@ declare namespace Immutable { * * ```js * const { Range } = require('immutable') - * Range() // [ 0, 1, 2, 3, ... ] - * Range(10) // [ 10, 11, 12, 13, ... ] * Range(10, 15) // [ 10, 11, 12, 13, 14 ] * Range(10, 30, 5) // [ 10, 15, 20, 25 ] * Range(30, 10, 5) // [ 30, 25, 20, 15 ] diff --git a/website/docs/Collection.Indexed.mdx b/website/docs/Collection.Indexed.mdx new file mode 100644 index 0000000000..a412d811a3 --- /dev/null +++ b/website/docs/Collection.Indexed.mdx @@ -0,0 +1,793 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# Collection.Indexed + +Indexed Collections have incrementing numeric keys. They exhibit +slightly different behavior than `Collection.Keyed` for some methods in order +to better mirror the behavior of JavaScript's `Array`, and add methods +which do not make sense on non-indexed Collections such as `indexOf`. + +Unlike JavaScript arrays, `Collection.Indexed`s are always dense. "Unset" +indices and `undefined` indices are indistinguishable, and all indices from +0 to `size` are visited when iterated. + +All Collection.Indexed methods return re-indexed Collections. In other words, +indices always start at 0 and increment until size. If you wish to +preserve indices, using them as keys, convert to a Collection.Keyed by +calling `toKeyedSeq`. + +## Construction + + + +Creates a new Collection.Indexed. + +(collection?: Iterable | ArrayLike): Collection.Indexed;`} +/> + +Note: `Collection.Indexed` is a conversion function and not a class, and does not use the `new` keyword during construction. + +## Reading values + + + +Returns the value associated with the provided index, or notSetValue if the index is beyond the bounds of the Collection. + +(index: number, notSetValue: NSV): T | NSV; +get(index: number): T | undefined;`} +/> + +`index` may be a negative number, which indexes back from the end of the Collection. `s.get(-1)` gets the last item in the Collection. + + + +True if a key exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + +True if a value exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + +In case the `Collection` is not empty returns the first element of the `Collection`. In case the `Collection` is empty returns the optional default value if provided, if no default value is provided returns undefined. + +(notSetValue: NSV): T | NSV; +first(): T | undefined;`} +/> + + + +In case the `Collection` is not empty returns the last element of the `Collection`. In case the `Collection` is empty returns the optional default value if provided, if no default value is provided returns undefined. + +(notSetValue: NSV): T | NSV; +last(): T | undefined;`} +/> + +## Conversion to JavaScript types + + + +Deeply converts this Indexed collection to equivalent native JavaScript Array. + +>;`} /> + + + +Shallowly converts this Indexed collection to equivalent native JavaScript Array. + +;`} /> + + + +Shallowly converts this collection to an Array. + +;`} /> + + + +Shallowly converts this Collection to an Object. + + + +Converts keys to Strings. + +## Conversion to Seq + + + +Returns Seq.Indexed. + +;`} /> + + + +If this is a collection of [key, value] entry tuples, it will return a Seq.Keyed of those entries. + +;`} /> + + + +Returns a Seq.Keyed with the same key-value entries as this Collection.Indexed. + +;`} /> + + + +Returns a Seq.Indexed with the same values as this Collection.Indexed. + +;`} /> + + + +Returns a Seq.Set with the same values as this Collection.Indexed. + +;`} /> + +## Combination + + + +Returns a Collection of the same type with `separator` between each item in this Collection. + + + + + +Returns a Collection of the same type with the provided `collections` interleaved into this collection. + +>): this;`} +/> + +The resulting Collection includes the first item from each, then the second from each, etc. + + + +The shortest Collection stops interleave. + + + +Since `interleave()` re-indexes values, it produces a complete copy, which has `O(N)` complexity. + +Note: `interleave` _cannot_ be used in `withMutations`. + + + +Splice returns a new indexed Collection by replacing a region of this Collection with new values. If values are not provided, it only skips the region to be removed. + +): this;`} +/> + +`index` may be a negative number, which indexes back from the end of the Collection. `s.splice(-2)` splices after the second to last item. + + + +Since `splice()` re-indexes values, it produces a complete copy, which has `O(N)` complexity. + +Note: `splice` _cannot_ be used in `withMutations`. + + + +Returns a Collection of the same type "zipped" with the provided collections. + +(other: Collection): Collection.Indexed<[T, U]>;`} +/> +(other: Collection, other2: Collection): Collection.Indexed<[T, U, V]>;`} +/> +>): Collection.Indexed;`} +/> + +Like `zipWith`, but using the default `zipper`: creating an `Array`. + + + + + +Returns a Collection "zipped" with the provided collections. Unlike `zip`, `zipAll` continues zipping until the longest collection is exhausted. Missing values from shorter collections are filled with `undefined`. + +(other: Collection): Collection.Indexed<[T, U]>;`} +/> +(other: Collection, other2: Collection): Collection.Indexed<[T, U, V]>;`} +/> +>): Collection.Indexed;`} +/> + + + + + +Returns a Collection of the same type "zipped" with the provided collections by using a custom `zipper` function. + +(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection): Collection.Indexed;`} +/> +(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection, thirdCollection: Collection): Collection.Indexed;`} +/> +(zipper: (...values: Array) => Z, ...collections: Array>): Collection.Indexed;`} +/> + + a + b, b);`} +/> + + + +Flattens nested Collections. + +;`} /> +;`} /> + +Will deeply flatten the Collection by default, returning a Collection of the same type, but a `depth` can be provided in the form of a number or boolean (where true means to shallowly flatten one level). A depth of 0 (or shallow: false) will deeply flatten. + +Flattens only others Collection, not Arrays or Objects. + +Note: `flatten(true)` operates on `Collection>` and returns `Collection` + +## Search for value + + + +Returns the first index at which a given value can be found in the Collection, or -1 if it is not present. + + + + + +Returns the last index at which a given value can be found in the Collection, or -1 if it is not present. + + + + + +Returns the first index in the Collection where a value satisfies the provided predicate function. Otherwise -1 is returned. + + boolean, context?: unknown): number;`} +/> + + + +Returns the last index in the Collection where a value satisfies the provided predicate function. Otherwise -1 is returned. + + boolean, context?: unknown): number;`} +/> + + + +Returns the first value for which the `predicate` returns true. + + boolean, context?: unknown): T | undefined;`} +/> + + + +Returns the last value for which the `predicate` returns true. + + boolean, context?: unknown): T | undefined;`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the first [key, value] entry for which the `predicate` returns true. + + boolean, context?: unknown): [number, T] | undefined;`} +/> + + + +Returns the last [key, value] entry for which the `predicate` returns true. + + boolean, context?: unknown): [number, T] | undefined;`} +/> + + + +Returns the key for which the `predicate` returns true. + + boolean, context?: unknown): number | undefined;`} +/> + + + +Returns the last key for which the `predicate` returns true. + + boolean, context?: unknown): number | undefined;`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the key associated with the search value, or undefined. + + + + + +Returns the last key associated with the search value, or undefined. + + + + + +Returns the maximum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): T | undefined;`} /> + +The `comparator` is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `>`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `max` will operate independent of the order of input as long as the comparator is commutative. The default comparator `>` is commutative _only_ when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `max`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means. + +(comparatorValueMapper: (value: T, key: number, iter: this) => C, comparator?: Comparator): T | undefined;`} +/> + + i.avgHit);`} +/> + + + +Returns the minimum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): T | undefined;`} /> + +The `comparator` is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `<`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `min` will operate independent of the order of input as long as the comparator is commutative. The default comparator `<` is commutative _only_ when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `min`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means. + +(comparatorValueMapper: (value: T, key: number, iter: this) => C, comparator?: Comparator): T | undefined;`} +/> + + i.avgHit);`} +/> + +## Sequence algorithms + + + +Returns a new Collection with other collections concatenated to this one. + +(...valuesOrCollections: Array | C>): Collection.Indexed;`} +/> + + + +Returns a new Collection.Indexed with values passed through a `mapper` function. + +(mapper: (value: T, key: number, iter: this) => M, context?: unknown): Collection.Indexed;`} +/> + + 10 * x)`} /> + +Note: `map()` always returns a new instance, even if it produced the same value at every step. + + + +Flat-maps the Collection, returning a Collection of the same type. + +(mapper: (value: T, key: number, iter: this) => Iterable, context?: unknown): Collection.Indexed;`} +/> + +Similar to `collection.map(...).flatten(true)`. + + + +Returns a new Collection with only the values for which the `predicate` function returns true. + +(predicate: (value: T, index: number, iter: this) => value is F, context?: unknown): Collection.Indexed;`} +/> + unknown, context?: unknown): this;`} +/> + +Note: `filter()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new indexed Collection with the values for which the `predicate` function returns false and another for which is returns true. + +(predicate: (this: C, value: T, index: number, iter: this) => value is F, context?: C): [Collection.Indexed, Collection.Indexed];`} +/> +(predicate: (this: C, value: T, index: number, iter: this) => unknown, context?: C): [this, this];`} +/> + + + +;`} /> + + + +Returns a new Collection with only the values for which the `predicate` function returns false. + + unknown, context?: unknown): this;`} +/> + + x > 2)`} /> + +Note: `filterNot()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new Collection with the values in reverse order. + + + + + +Returns a new sorted Collection, sorted by the natural order of the values. + +;`} /> + +If a `comparator` is not provided, a default comparator uses `<` and `>`. + +Note: `sort()` always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Returns a new sorted Collection, sorted by the provided `comparator` function. + +(comparator: (value: T) => R): Collection.Indexed;`} +/> + +Note: `sortBy()` always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Groups the values by the return value of the `mapper` function, and returns a Collection.Indexed of Arrays of grouped values. + +(mapper: (value: T) => K): Collection.Indexed>;`} +/> + +## Value equality + + + +Returns true if the Collections are of the same size and all values are equal. + + + + + +Returns a hash code for this Collection. + + + +## Reading deep values + + + +Returns the value at the given nested path, or notSetValue if any key in the path is not present. + +(path: Array, notSetValue: NSV): T | NSV;`} +/> +): T | undefined;`} /> + + + +Returns a boolean if the given nested path exists. + +): boolean;`} /> + +## Persistent changes + + + +Returns a new Collection.Indexed with the value at the given index updated to the new value. + + T): this;`} /> + +## Conversion to Collections + + + +Converts this Collection.Indexed to a Map. The first value of each entry is used as the key. + +;`} /> + + + +Converts this Collection.Indexed to an OrderedMap. The first value of each entry is used as the key. + +;`} /> + + + +Converts this Collection.Indexed to a Set. + +;`} /> + + + +Converts this Collection.Indexed to an OrderedSet. + +;`} /> + + + +Converts this Collection.Indexed to a List. + +;`} /> + + + +Converts this Collection.Indexed to a Stack. + +;`} /> + +## Iterators + + + +Returns an Iterable of the keys in the Collection. + +;`} /> + + + +Returns an Iterable of the values in the Collection. + +;`} /> + + + +Returns an Iterable of the [key, value] entries in the Collection. + +;`} /> + +## Collections (Seq) + + + +Returns a Seq of the keys in the Collection. + +;`} /> + + + +Returns a Seq of the values in the Collection. + +;`} /> + + + +Returns a Seq of the [key, value] entries in the Collection. + +;`} /> + +## Side effects + + + +Calls the provided function for each value in the Collection. Returns the Collection. + + void, context?: unknown): this;`} +/> + +## Creating subsets + + + +Returns a new Collection.Indexed with the values between the given start and end indices. + + + + + +Returns a new Collection.Indexed with all but the first value. + + + + + +Returns a new Collection.Indexed with all but the last value. + + + + + +Returns a new Collection.Indexed with the first `n` values removed. + + + + + +Returns a new Collection.Indexed with the last `n` values removed. + + + + + +Returns a new Collection.Indexed with values skipped while the `predicate` function returns true. + + boolean, context?: unknown): this;`} +/> + + + +Returns a new Collection.Indexed with values skipped until the `predicate` function returns true. + + boolean, context?: unknown): this;`} +/> + + + +Returns a new Collection.Indexed with the first `n` values. + + + + + +Returns a new Collection.Indexed with the last `n` values. + + + + + +Returns a new Collection.Indexed with values taken while the `predicate` function returns true. + + boolean, context?: unknown): this;`} +/> + + + +Returns a new Collection.Indexed with values taken until the `predicate` function returns true. + + boolean, context?: unknown): this;`} +/> + +## Reducing a value + + + +Returns the accumulated result of calling the provided reducer function for each value in the Collection, from left to right. + +(reducer: (previousValue: R | T, currentValue: T, index: number, iter: this) => R, initialValue?: R): R;`} +/> + + + +Returns the accumulated result of calling the provided reducer function for each value in the Collection, from right to left. + +(reducer: (previousValue: R | T, currentValue: T, index: number, iter: this) => R, initialValue?: R): R;`} +/> + + + +Returns true if the `predicate` function returns a truthy value for every value in the Collection. + + boolean, context?: unknown): boolean;`} +/> + + + +Returns true if the `predicate` function returns a truthy value for any value in the Collection. + + boolean, context?: unknown): boolean;`} +/> + + + +Returns the concatenated string result of calling `String(value)` on every value in the Collection, separated by the given separator string. + + + + + +Returns true if the Collection has no values. + + + + + +Returns the number of values in the Collection. + + + + + +Returns a new Collection.Indexed with the number of times each value occurs in the Collection. + +;`} /> + +## Comparison + + + +Returns true if this Collection.Indexed is a subset of the other Collection (i.e. all values in this Collection.Indexed are also in the other). + + + + + +Returns true if this Collection.Indexed is a superset of the other Collection (i.e. this Collection.Indexed contains all values of the other). diff --git a/website/docs/Collection.Keyed.mdx b/website/docs/Collection.Keyed.mdx new file mode 100644 index 0000000000..d932babb17 --- /dev/null +++ b/website/docs/Collection.Keyed.mdx @@ -0,0 +1,883 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# Collection.Keyed + +Keyed Collections have discrete keys tied to each value. + + + +When iterating `Collection.Keyed`, each iteration will yield a [K, V] tuple, in other words, `Collection#entries` is the default iterator for Keyed Collections. + +## Construction + + + +Creates a Collection.Keyed + +Similar to `Collection()`, however it expects collection-likes of [K, V] +tuples if not constructed from a Collection.Keyed or JS Object. + +Note: `Collection.Keyed` is a conversion function and not a class, and +does not use the `new` keyword during construction. + +## Conversion to JavaScript types + + + +Deeply converts this Keyed collection to equivalent native JavaScript Object. + + };`} /> +Converts keys to Strings. + + + +Shallowly converts this Keyed collection to equivalent native JavaScript Object. + + +Converts keys to Strings. + + + +Shallowly converts this collection to an Array of [key, value] pairs. + +;`} /> + + + +Shallowly converts this Collection to an Object. + + + +Converts keys to Strings. + +## Conversion to Seq + + + +Returns Seq.Keyed. + + + +Returns a Seq.Keyed from this Collection where indices are treated as keys. + +;`} /> + +This is useful if you want to operate on an Collection.Indexed and preserve the [index, value] pairs. + +The returned Seq will have identical iteration order as this Collection. + +```js +const indexedSeq = Seq(['A', 'B', 'C']); +// Seq [ "A", "B", "C" ] +indexedSeq.filter((v) => v === 'B'); +// Seq [ "B" ] +const keyedSeq = indexedSeq.toKeyedSeq(); +// Seq { 0: "A", 1: "B", 2: "C" } +keyedSeq.filter((v) => v === 'B'); +``` + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +;`} /> + + + +Returns a Seq.Set of the values of this Collection, discarding keys. + +;`} /> + +## Sequence functions + + + +Returns a new Collection.Keyed of the same type where the keys and values have been flipped. + + + +```js +const { Map } = require('immutable'); +Map({ a: 'z', b: 'y' }).flip(); +// Map { "z": "a", "y": "b" } +``` + + + +Returns a new Collection with other collections concatenated to this one. + +(...collections: Array>): Collection.Keyed;`} +/> +(...collections: Array<{ [key: string]: C }>): Collection.Keyed;`} +/> + + + +Returns a new Collection.Keyed with values passed through a `mapper` function. + +(mapper: (value: V, key: K, iter: this) => M, context?: unknown): Collection.Keyed;`} +/> + +```js +const { Collection } = require('immutable'); +Collection.Keyed({ a: 1, b: 2 }).map((x) => 10 * x); +// Seq { "a": 10, "b": 20 } +``` + +Note: `map()` always returns a new instance, even if it produced the same value at every step. + + + +Returns a new Collection.Keyed of the same type with keys passed through a `mapper` function. + +(mapper: (key: K, value: V, iter: this) => M, context?: unknown): Collection.Keyed;`} +/> + +```js +const { Map } = require('immutable'); +Map({ a: 1, b: 2 }).mapKeys((x) => x.toUpperCase()); +// Map { "A": 1, "B": 2 } +``` + +Note: `mapKeys()` always returns a new instance, even if it produced the same key at every step. + + + +Returns a new Collection.Keyed of the same type with entries ([key, value] tuples) passed through a `mapper` function. + +(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM] | undefined, context?: unknown): Collection.Keyed;`} +/> + +```js +const { Map } = require('immutable'); +Map({ a: 1, b: 2 }).mapEntries(([k, v]) => [k.toUpperCase(), v * 2]); +// Map { "A": 2, "B": 4 } +``` + +Note: `mapEntries()` always returns a new instance, even if it produced the same entry at every step. +If the mapper function returns `undefined`, then the entry will be filtered. + + + +Flat-maps the Collection, returning a Collection of the same type. + +(mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, context?: unknown): Collection.Keyed;`} +/> + +Similar to `collection.map(...).flatten(true)`. + + + +Returns a new Collection with only the values for which the `predicate` function returns true. + +(predicate: (value: V, key: K, iter: this) => value is F, context?: unknown): Collection.Keyed;`} +/> + unknown, context?: unknown): this;`} +/> + +Note: `filter()` always returns a new instance, even if it results in not filtering out any values. + + + +(predicate: (this: C, value: V, key: K, iter: this) => value is F, context?: C): [Collection.Keyed, Collection.Keyed];`} +/> +(predicate: (this: C, value: V, key: K, iter: this) => unknown, context?: C): [this, this];`} +/> + +Returns a new keyed Collection with the values for which the `predicate` function returns false and another for which it returns true. + + + +;`} /> + +Yields [key, value] pairs. + +## Value equality + + + +Returns true if this and the other Collection have value equality, as defined by `Immutable.is()`. + + + +Note: this is equivalent to `Immutable.is(this, other)`, but provided to allow for chained expressions. + + + +Computes and returns the hashed identity for this Collection. + + + +The `hashCode` of a Collection is used to determine potential equality, and is used when adding this to a `Set` or as a key in a `Map`, enabling lookup via a different instance. + +```js +const a = List([1, 2, 3]); +const b = List([1, 2, 3]); +assert.notStrictEqual(a, b); // different instances +const set = Set([a]); +assert.equal(set.has(b), true); +``` + +If two values have the same `hashCode`, they are [not guaranteed to be equal][Hash Collision]. If two values have different `hashCode`s, they must not be equal. + +[Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) + +## Reading values + + + +Returns the value associated with the provided key, or notSetValue if the Collection does not contain this key. + +(key: K, notSetValue: NSV): V | NSV;`} /> + + +Note: it is possible a key may be associated with an `undefined` value, so if `notSetValue` is not provided and this method returns `undefined`, that does not guarantee the key was not found. + + + +True if a key exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + +True if a value exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + +In case the `Collection` is not empty returns the first element of the `Collection`. In case the `Collection` is empty returns the optional default value if provided, if no default value is provided returns undefined. + +(notSetValue: NSV): V | NSV;`} /> + + + + +In case the `Collection` is not empty returns the last element of the `Collection`. In case the `Collection` is empty returns the optional default value if provided, if no default value is provided returns undefined. + +(notSetValue: NSV): V | NSV;`} /> + + +## Reading deep values + + + +Returns the value found by following a path of keys or indices through nested Collections. + +, notSetValue?: unknown): unknown;`} +/> + + + +Plain JavaScript Object or Arrays may be nested within an Immutable.js Collection, and getIn() can access those values as well: + + + + + +True if the result of following a path of keys or indices through nested Collections results in a set value. + +): boolean;`} /> + +## Persistent changes + + + +This can be very useful as a way to "chain" a normal function into a sequence of methods. RxJS calls this "let" and lodash calls it "thru". + +(updater: (value: this) => R): R;`} /> + +For example, to sum a Seq after mapping and filtering: + + sum + x, 0); +} + +Seq([1, 2, 3]) +.map((x) => x + 1) +.filter((x) => x % 2 === 0) +.update(sum);`} +/> + +## Conversion to Collections + + + +Converts this Collection to a Map, Throws if keys are not hashable. + +;`} /> + +Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a Map, maintaining the order of iteration. + +;`} /> + +Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a Set, discarding keys. Throws if values are not hashable. + +;`} /> + +Note: This is equivalent to Set(this), but provided to allow for chained expressions. + + + +Converts this Collection to a Set, maintaining the order of iteration and discarding keys. + +;`} /> + +Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a List, discarding keys. + +;`} /> + +This is similar to `List(collection)`, but provided to allow for chained expressions. However, when called on `Map` or other keyed collections, `collection.toList()` ignores the keys and creates a list of just the values, whereas `List(collection)` creates a list of entry tuples. + + + + + + + +Converts this Collection to a Stack, discarding keys. Throws if values are not hashable. + +;`} /> + +Note: This is equivalent to `Stack(this)`, but provided to allow for chained expressions. + +## Iterators + + + +An iterator of this `Collection`'s keys. + +;`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `keySeq` instead if you want an Immutable.js Seq. + + + +An iterator of this `Collection`'s values. + +;`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `valueSeq` instead if you want an Immutable.js Seq. + + + +An iterator of this `Collection`'s entries as `[ key, value ]` tuples. + +;`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `entrySeq` instead if you want an Immutable.js Seq. + +## Collections (Seq) + + + +Returns a new Seq.Indexed of the keys of this Collection, discarding values. + +;`} /> + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +;`} /> + + + +Returns a new Seq.Indexed of [key, value] tuples. + +;`} /> + +## Sequence algorithms + + + +Returns a new Collection of the same type with only the entries for which the `predicate` function returns false. + + boolean, context?: unknown): this;`} +/> + +```js +const { Map } = require('immutable'); +Map({ a: 1, b: 2, c: 3, d: 4 }).filterNot((x) => x % 2 === 0); +// Map { "a": 1, "c": 3 } +``` + +Note: `filterNot()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new Collection of the same type in reverse order. + + + + + +Returns a new Collection of the same type which includes the same entries, stably sorted by using a `comparator`. + +): this;`} /> + +If a `comparator` is not provided, a default comparator uses `<` and `>`. + +`comparator(valueA, valueB)`: + +- Returns `0` if the elements should not be swapped. +- Returns `-1` (or any negative number) if `valueA` comes before `valueB` +- Returns `1` (or any positive number) if `valueA` comes after `valueB` +- Alternatively, can return a value of the `PairSorting` enum type +- Is pure, i.e. it must always return the same value for the same pair of values. + +```js +const { Map } = require('immutable'); +Map({ c: 3, a: 1, b: 2 }).sort((a, b) => { + if (a < b) { + return -1; + } + if (a > b) { + return 1; + } + if (a === b) { + return 0; + } +}); +// OrderedMap { "a": 1, "b": 2, "c": 3 } +``` + +Note: `sort()` Always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Like `sort`, but also accepts a `comparatorValueMapper` which allows for sorting by more sophisticated means: + +(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): this;`} +/> + + member.name);`} +/> + +Note: `sortBy()` Always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Returns a `Map` of `Collection`, grouped by the return value of the `grouper` function. + +(grouper: (value: V, key: K, iter: this) => G, context?: unknown): Map;`} +/> + +Note: This is always an eager operation. + + x.get('v'));`} +/> + +## Side effects + + + +The `sideEffect` is executed for every entry in the Collection. + + unknown, context?: unknown): number;`} +/> + +Unlike `Array#forEach`, if any call of `sideEffect` returns `false`, the iteration will stop. Returns the number of entries iterated (including the last iteration which returned false). + +## Creating subsets + + + +Returns a new Collection of the same type representing a portion of this Collection from start up to but not including end. + + + +If begin is negative, it is offset from the end of the Collection. e.g. slice(-2) returns a Collection of the last two entries. If it is not provided the new Collection will begin at the beginning of this Collection. + +If end is negative, it is offset from the end of the Collection. e.g. slice(0, -1) returns a Collection of everything but the last entry. If it is not provided, the new Collection will continue through the end of this Collection. + +If the requested slice is equivalent to the current Collection, then it will return itself. + + + +Returns a new Collection of the same type containing all entries except the first. + + + + + +Returns a new Collection of the same type containing all entries except the last. + + + + + +Returns a new Collection of the same type which excludes the first `amount` entries from this Collection. + + + + + +Returns a new Collection of the same type which excludes the last `amount` entries from this Collection. + + + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns false. + + boolean, context?: unknown): this;`} +/> + + x.match(/g/)) +// List [ "cat", "hat", "god" ] +`} +/> + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns true. + + boolean, context?: unknown): this;`} +/> + + x.match(/hat/)) +// List [ "hat", "god" ] +`} +/> + + + +Returns a new Collection of the same type which includes the first `amount` entries from this Collection. + + + + + +Returns a new Collection of the same type which includes the last `amount` entries from this Collection. + + + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns true. + + boolean, context?: unknown): this;`} +/> + +```js +const { List } = require('immutable'); +List(['dog', 'frog', 'cat', 'hat', 'god']).takeWhile((x) => x.match(/o/)); +// List [ "dog", "frog" ] +``` + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns false. + + boolean, context?: unknown): this;`} +/> + +```js +const { List } = require('immutable'); +List(['dog', 'frog', 'cat', 'hat', 'god']).takeUntil((x) => x.match(/at/)); +// List [ "dog", "frog" ] +``` + +## Combination + + + +Flattens nested Collections. + +; +flatten(shallow?: boolean): Collection;`} +/> + +Will deeply flatten the Collection by default, returning a Collection of the same type, but a `depth` can be provided in the form of a number or boolean (where true means to shallowly flatten one level). A depth of 0 (or shallow: false) will deeply flatten. + +Flattens only other Collections, not Arrays or Objects. + +Note: `flatten(true)` operates on `Collection>` and returns `Collection`. + +## Reducing a value + + + +Reduces the Collection to a value by calling the `reducer` for every entry in the Collection and passing along the reduced value. + +If `initialReduction` is not provided, the first item in the Collection will be used. + +(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: unknown): R; +reduce(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R;`} +/> + + + +Reduces the Collection in reverse (from the right side). + +(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: unknown): R; +reduceRight(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R;`} +/> + + + +True if `predicate` returns true for all entries in the Collection. + + boolean, context?: unknown): boolean;`} +/> + + + +True if `predicate` returns true for any entry in the Collection. + + boolean, context?: unknown): boolean;`} +/> + + + +Joins values together as a string, inserting a separator between each. The default separator is `","`. + + + + + +Returns true if this Collection includes no values. + +For some lazy `Seq`, `isEmpty` might need to iterate to determine emptiness. At most one iteration will occur. + + + + + +Returns the size of this Collection. + +Regardless of if this Collection can describe its size lazily (some Seqs cannot), this method will always return the correct size. E.g. it evaluates a lazy `Seq` if necessary. + +If `predicate` is provided, then this returns the count of entries in the Collection for which the `predicate` returns true. + + boolean, context?: unknown): number;`} +/> + + + +Returns a `Seq.Keyed` of counts, grouped by the return value of the `grouper` function. + +(grouper: (value: V, key: K, iter: this) => G, context?: unknown): Map;`} +/> + +Note: This is not a lazy operation. + +## Search for value + + + +Returns the first value for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: V): V | undefined;`} +/> + + + +Returns the last value for which the `predicate` returns true. + +Note: `predicate` will be called for each entry in reverse. + + boolean, context?: unknown, notSetValue?: V): V | undefined;`} +/> + + + +Returns the first [key, value] entry for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: V): [K, V] | undefined;`} +/> + + + +Returns the last [key, value] entry for which the `predicate` returns true. + +Note: `predicate` will be called for each entry in reverse. + + boolean, context?: unknown, notSetValue?: V): [K, V] | undefined;`} +/> + + + +Returns the key for which the `predicate` returns true. + + boolean, context?: unknown): K | undefined;`} +/> + + + +Returns the last key for which the `predicate` returns true. + +Note: `predicate` will be called for each entry in reverse. + + boolean, context?: unknown): K | undefined;`} +/> + + + +Returns the key associated with the search value, or undefined. + + + + + +Returns the last key associated with the search value, or undefined. + + + + + +Returns the maximum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +The `comparator` is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `>`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `max` will operate independent of the order of input as long as the comparator is commutative. The default comparator `>` is commutative _only_ when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + +): V | undefined;`} /> + + + +Like `max`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means: + +(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: Comparator): V | undefined;`} +/> + +```js +const { List } = require('immutable'); +const l = List([ + { name: 'Bob', avgHit: 1 }, + { name: 'Max', avgHit: 3 }, + { name: 'Lili', avgHit: 2 }, +]); +l.maxBy((i) => i.avgHit); // will output { name: 'Max', avgHit: 3 +``` + + + +Returns the minimum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): V | undefined;`} /> + +The `comparator` is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `<`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `min` will operate independent of the order of input as long as the comparator is commutative. The default comparator `<` is commutative _only_ when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `min`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means: + +(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: Comparator): V | undefined;`} +/> + +```js +const { List } = require('immutable'); +const l = List([ + { name: 'Bob', avgHit: 1 }, + { name: 'Max', avgHit: 3 }, + { name: 'Lili', avgHit: 2 }, +]); +l.minBy((i) => i.avgHit); // will output { name: 'Bob', avgHit: 1 } +``` + +## Comparison + + + +True if `iter` includes every value in this Collection. + +): boolean;`} /> + + + +True if this Collection includes every value in `iter`. + +): boolean;`} /> diff --git a/website/docs/Collection.Set.mdx b/website/docs/Collection.Set.mdx new file mode 100644 index 0000000000..b9056ad458 --- /dev/null +++ b/website/docs/Collection.Set.mdx @@ -0,0 +1,765 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# Collection.Set + +Set Collections only represent values. They have no associated keys or indices. Duplicate values are possible in the lazy s, however the concrete Collection does not allow duplicate values. + + + +Collection methods on Collection.Set such as and will provide the value as both the first and second arguments to the provided function. + +```js +const seq = Collection.Set(['A', 'B', 'C']); +// Seq { "A", "B", "C" } +seq.forEach((v, k) => { + assert.equal(v, k); +}); +``` + +## Construction + + + +Similar to Collection(), but always returns a `Collection.Set`. + + + +Note: `Collection.Set` is a factory function and not a class, and does not use the `new` keyword during construction. + +## Sequence algorithms + + + +Returns a new `Collection.Set` with values passed through a `mapper` function. + +(mapper: (value: T, key: T, iter: this) => M, context?: unknown): Collection.Set`} +/> + + 10 * x)`} /> + +Note: `map()` always returns a new instance, even if it produced the same value at every step. + + + +Flat-maps the Collection, returning a Collection of the same type. + +Similar to `collection.map(...).flatten(true)`. + +(mapper: (value: T, key: T, iter: this) => Iterable, context?: unknown): Collection.Set`} +/> + + + +Returns a new Collection with only the values for which the `predicate` function returns true. + +Note: `filter()` always returns a new instance, even if it results in not filtering out any values. + + boolean, context?: unknown): Collection.Set`} +/> + + + +Returns a new Collection with only the values for which the `predicate` function returns false. + + boolean, context?: unknown): Collection.Set`} +/> + +Note: `filterNot()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new Collection with the values for which the `predicate` function returns false and another for which is returns true. + + boolean, context?: C): [Collection.Set, Collection.Set]`} +/> + + + +Returns a Collection of the same type which includes the same entries, stably sorted by using a `comparator`. + +): this`} /> + +If a `comparator` is not provided, a default comparator uses `<` and `>`. + +`comparator(valueA, valueB)`: + +- Returns `0` if the elements should not be swapped. +- Returns `-1` (or any negative number) if `valueA` comes before `valueB` +- Returns `1` (or any positive number) if `valueA` comes after `valueB` +- Alternatively, can return a value of the `PairSorting` enum type +- Is pure, i.e. it must always return the same value for the same pair of values. + +When sorting collections which have no defined order, their ordered equivalents will be returned. e.g. `map.sort()` returns OrderedMap. + + { + if (a < b) { return -1; } + if (a > b) { return 1; } + if (a === b) { return 0; } + });`} +/> + +Note: `sort()` Always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Like `sort`, but also accepts a `comparatorValueMapper` which allows for sorting by more sophisticated means: + +(comparatorValueMapper: (value: T, key: T, iter: this) => C, comparator?: Comparator): this`} +/> + + person.age)`} +/> + +Note: `sortBy()` Always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Returns a new Set with the order of the values reversed. + +`} /> + + + +Returns a `Map` of `Set`, grouped by the return value of the `grouper` function. + +(grouper: (value: T, key: T, iter: this) => G, context?: unknown): Map>`} +/> + +Note: This is not a lazy operation. + +## Conversion to JavaScript types + + + +Deeply converts this Set to equivalent native JavaScript Array. + +>`} /> + + + +Shallowly converts this Set to equivalent native JavaScript Array. + +`} /> + + + +Shallowly converts this collection to an Array. + +`} /> + + + +Shallowly converts this Collection to an Object. + + + +Converts keys to Strings. + +## Conversion to Seq + + + +Returns itself. + +`} /> + + + +Returns a Seq.Keyed from this Collection where indices are treated as keys. + +This is useful if you want to operate on a Collection and preserve the [value, value] pairs. + +`} /> + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +`} /> + + + +Returns a Seq.Set of the values of this Collection, discarding keys. + +`} /> + +## Value equality + + + +True if this and the other Collection have value equality, as defined by `Immutable.is()`. + + + +Note: This is equivalent to `Immutable.is(this, other)`, but provided to allow for chained expressions. + + + +Computes and returns the hashed identity for this Collection. + +The `hashCode` of a Collection is used to determine potential equality, and is used when adding this to a `Set` or as a key in a `Map`, enabling lookup via a different instance. + + + + + +If two values have the same `hashCode`, they are [not guaranteed to be equal][Hash Collision]. If two values have different `hashCode`s, they must not be equal. + +[Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) + +## Reading values + + + +Returns the value associated with the provided key, or notSetValue if the Collection does not contain this key. + +Note: it is possible a key may be associated with an `undefined` value, so if `notSetValue` is not provided and this method returns `undefined`, that does not guarantee the key was not found. + +(key: T, notSetValue: NSV): T | NSV +get(key: T): T | undefined`} +/> + + + +True if a key exists within this Collection, using `Immutable.is` to determine equality. + + + + + +True if a value exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + +Returns the first value in this Collection. + +(notSetValue: NSV): T | NSV +first(): T | undefined`} +/> + + + +Returns the last value in this Collection. + +(notSetValue: NSV): T | NSV +last(): T | undefined`} +/> + +## Reading deep values + + + +Returns the value found by following a path of keys or indices through nested Collections. + +, notSetValue?: unknown): unknown`} +/> + + + +Plain JavaScript Object or Arrays may be nested within an Immutable.js Collection, and getIn() can access those values as well: + + + + + +True if the result of following a path of keys or indices through nested Collections results in a set value. + +): boolean`} /> + +## Persistent changes + + + +This can be very useful as a way to "chain" a normal function into a sequence of methods. RxJS calls this "let" and lodash calls it "thru". + + + +For example, to sum a Seq after mapping and filtering: + + sum + x, 0) + } + + Collection.Set([ 1, 2, 3 ]) + .map(x => x + 1) + .filter(x => x % 2 === 0) + .update(sum)`} +/> + +## Conversion to Collections + + + +Converts this Collection to a Map, Throws if keys are not hashable. + +`} /> + +Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a Map, maintaining the order of iteration. + +`} /> + +Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Returns itself. + +`} /> + + + +Converts this Collection to a Set, maintaining the order of iteration. + +`} /> + +Note: This is equivalent to `OrderedSet(this)`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a List. + +`} /> + + + +Converts this Collection to a Stack, discarding keys. Throws if values are not hashable. + +`} /> + +Note: This is equivalent to `Stack(this)`, but provided to allow for chained expressions. + +## Iterators + + + +An iterator of this `Set`'s keys. + +`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `keySeq` instead, if this is what you want. + + + +An iterator of this `Set`'s values. + +`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `valueSeq` instead, if this is what you want. + + + +An iterator of this `Set`'s entries as `[value, value]` tuples. + +`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `entrySeq` instead, if this is what you want. + +## Collections (Seq) + + + +Returns a new Seq.Indexed of the keys of this Collection, discarding values. + +`} /> + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +`} /> + + + +Returns a new Seq.Indexed of [value, value] tuples. + +`} /> + +## Side effects + + + +The `sideEffect` is executed for every entry in the Collection. + + unknown, context?: unknown): number`} +/> + +Unlike `Array#forEach`, if any call of `sideEffect` returns `false`, the iteration will stop. Returns the number of entries iterated (including the last iteration which returned false). + +## Creating subsets + + + +Returns a new Set of the same type representing a portion of this Set from start up to but not including end. + +`} /> + +If begin is negative, it is offset from the end of the Collection. e.g. `slice(-2)` returns a Collection of the last two entries. If it is not provided the new Collection will begin at the beginning of this Collection. + +If end is negative, it is offset from the end of the Collection. e.g. `slice(0, -1)` returns a Collection of everything but the last entry. If it is not provided, the new Collection will continue through the end of this Collection. + +If the requested slice is equivalent to the current Collection, then it will return itself. + + + +Returns a new Collection of the same type containing all entries except the first. + +`} /> + + + +Returns a new Collection of the same type containing all entries except the last. + +`} /> + + + +Returns a new Collection of the same type which excludes the first `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which excludes the last `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns false. + + boolean, context?: unknown): Set`} +/> + + x.match(/g/))`} +/> + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns true. + + boolean, context?: unknown): Set`} +/> + + x.match(/hat/))`} +/> + + + +Returns a new Collection of the same type which includes the first `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which includes the last `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns true. + + boolean, context?: unknown): Set`} +/> + + x.match(/o/))`} +/> + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns false. + + boolean, context?: unknown): Set`} +/> + + x.match(/at/))`} +/> + +## Combination + + + +Returns a new Set with other collections concatenated to this one. + +(...valuesOrCollections: Array | C>): Set`} +/> + + + +Flattens nested Collections. + +Will deeply flatten the Collection by default, returning a Collection of the same type, but a `depth` can be provided in the form of a number or boolean (where true means to shallowly flatten one level). A depth of 0 (or shallow: false) will deeply flatten. + +Flattens only others Collection, not Arrays or Objects. + + + + + +Flat-maps the Set, returning a new Set. + +Similar to `set.map(...).flatten(true)`. + +(mapper: (value: T, key: T, iter: this) => Iterable, context?: unknown): Set`} +/> + +## Reducing a value + + + +Reduces the Iterable to a value by calling the `reducer` for every entry in the Iterable and passing along the reduced value. + +(reducer: (reduced: R, value: T, key: T, iter: this) => R, initialValue: R): R`} +/> + +If initialValue is not provided, the first entry in the Iterable will be used as the initial value. + + + +Reduces the Iterable to a value by calling the `reducer` for every entry in the Iterable and passing along the reduced value. + +(reducer: (reduced: R, value: T, key: T, iter: this) => R, initialValue: R): R`} +/> + +Note: Similar to this.reverse().reduce(), and provided for parity with `Array#reduceRight`. + + + +Returns true if the `predicate` returns true for every entry in the Iterable. + + boolean, context?: unknown): boolean`} +/> + + + +Returns true if the `predicate` returns true for any entry in the Iterable. + + boolean, context?: unknown): boolean`} +/> + + + +Returns a string of all the entries in the Iterable, separated by `separator`. + + + + + +Returns true if the Iterable is empty. + + + + + +Returns the number of entries in the Iterable. + + + + + +Returns a Map of the number of occurrences of each value in the Iterable. + +(grouper: (value: T, key: T, iter: this) => G, context?: unknown): Map`} +/> + +## Search for value + + + +Returns the first value for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): T | undefined`} +/> + + + +Returns the last value for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): T | undefined`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the first [value, value] entry for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): [T, T] | undefined`} +/> + + + +Returns the last [value, value] entry for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): [T, T] | undefined`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the first key for which the `predicate` returns true. + + boolean, context?: unknown): T | undefined`} +/> + + + +Returns the last key for which the `predicate` returns true. + + boolean, context?: unknown): T | undefined`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the key associated with the search value, or undefined. + + + + + +Returns the last key associated with the search value, or undefined. + + + + + +Returns the maximum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): T | undefined`} /> + +The comparator is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `>`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `max` will operate independent of the order of input as long as the comparator is commutative. The default comparator `>` is commutative only when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `max`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means: + +(comparatorValueMapper: (value: T, key: T, iter: this) => C, comparator?: Comparator): T | undefined`} +/> + + person.age)`} +/> + + + +Returns the minimum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): T | undefined`} /> + +The comparator is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `<`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `min` will operate independent of the order of input as long as the comparator is commutative. The default comparator `<` is commutative only when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `min`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means: + +(comparatorValueMapper: (value: T, key: T, iter: this) => C, comparator?: Comparator): T | undefined`} +/> + + person.age)`} +/> + +## Comparison + + + +True if `iter` includes every value in this Collection. + +): boolean`} /> + + + +True if this Collection includes every value in `iter`. + +): boolean`} /> diff --git a/website/docs/Collection.mdx b/website/docs/Collection.mdx new file mode 100644 index 0000000000..1611904da8 --- /dev/null +++ b/website/docs/Collection.mdx @@ -0,0 +1,817 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# Collection + +The `Collection` is a set of (key, value) entries which can be iterated, and is the base class for all collections in `immutable`, allowing them to make use of all the Collection methods (such as and ). + +Note: A collection is always iterated in the same order, however that order may not always be well defined, as is the case for the and . + +Collection is the abstract base class for concrete data structures. It cannot be constructed directly. + +Implementations should extend one of the subclasses, , , or . + +## Construction + + + +Creates a Collection. + +The type of Collection created is based on the input. + +- If an `Collection`, that same `Collection`. +- If an Array-like, an `Collection.Indexed`. +- If an Object with an Iterator defined, an `Collection.Indexed`. +- If an Object, an `Collection.Keyed`. + +This methods forces the conversion of Objects and Strings to Collections. +If you want to ensure that a Collection of one item is returned, use +`Seq.of`. + +Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`, +which is usually not what you want. You should turn your Iterator Object into +an iterable object by defining a `Symbol.iterator` (or `@@iterator`) method which +returns `this`. + +Note: `Collection` is a conversion function and not a class, and does not +use the `new` keyword during construction. + +(collection: Iterable | ArrayLike): Collection.Indexed; +function Collection(obj: { [key: string]: V; }): Collection.Keyed; +function Collection(): Collection; +`} +/> + +## Value equality + + + +True if this and the other Collection have value equality, as defined by `Immutable.is()`. + + + +Note: This is equivalent to `Immutable.is(this, other)`, but provided to allow for chained expressions. + + + +Computes and returns the hashed identity for this Collection. + + + +The `hashCode` of a Collection is used to determine potential equality, and is used when adding this to a `Set` or as a key in a `Map`, enabling lookup via a different instance. + +```js +const a = List([1, 2, 3]); +const b = List([1, 2, 3]); +assert.notStrictEqual(a, b); // different instances +const set = Set([a]); +assert.equal(set.has(b), true); +``` + +If two values have the same `hashCode`, they are [not guaranteed to be equal][Hash Collision]. If two values have different `hashCode`s, they must not be equal. + +[Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) + +## Reading values + + + +Returns the value associated with the provided key, or notSetValue if the Collection does not contain this key. + +(key: K, notSetValue: NSV): V | NSV;`} /> + + +Note: it is possible a key may be associated with an `undefined` value, so if `notSetValue` is not provided and this method returns `undefined`, that does not guarantee the key was not found. + + + +True if a key exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + +True if a value exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + +In case the `Collection` is not empty returns the first element of the `Collection`. In case the `Collection` is empty returns the optional default value if provided, if no default value is provided returns undefined. + +(notSetValue: NSV): V | NSV;`} /> + + + + +In case the `Collection` is not empty returns the last element of the `Collection`. In case the `Collection` is empty returns the optional default value if provided, if no default value is provided returns undefined. + +(notSetValue: NSV): V | NSV;`} /> + + +## Reading deep values + + + +Returns the value found by following a path of keys or indices through nested Collections. + +, notSetValue?: unknown): unknown;`} +/> + + + +Plain JavaScript Object or Arrays may be nested within an Immutable.js Collection, and getIn() can access those values as well: + + + + + +True if the result of following a path of keys or indices through nested Collections results in a set value. + +): boolean;`} /> + +## Persistent changes + + + +This can be very useful as a way to "chain" a normal function into a sequence of methods. RxJS calls this "let" and lodash calls it "thru". + +(updater: (value: this) => R): R;`} /> + +For example, to sum a Seq after mapping and filtering: + + sum + x, 0); +} + +Seq([1, 2, 3]) +.map((x) => x + 1) +.filter((x) => x % 2 === 0) +.update(sum); +`} /> + +## Conversion to JavaScript types + + + +Deeply converts this Collection to equivalent native JavaScript Array or Object. + +> | { [key in PropertyKey]: DeepCopy };`} +/> + +`Collection.Indexed`, and `Collection.Set` become `Array`, while `Collection.Keyed` become `Object`, converting keys to Strings. + + + +Shallowly converts this Collection to equivalent native JavaScript Array or Object. + + | { [key in PropertyKey]: V };`} /> + +`Collection.Indexed`, and `Collection.Set` become `Array`, while `Collection.Keyed` become `Object`, converting keys to Strings. + + + +Shallowly converts this collection to an Array. + + | Array<[K, V]>;`} /> + +`Collection.Indexed`, and `Collection.Set` produce an Array of values. `Collection.Keyed` produce an Array of [key, value] tuples. + + + +Shallowly converts this Collection to an Object. + + + +Converts keys to Strings. + +## Conversion to Collections + + + +Converts this Collection to a Map, Throws if keys are not hashable. + +;`} /> + +Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a Map, maintaining the order of iteration. + +;`} /> + +Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a Set, discarding keys. Throws if values are not hashable. + +;`} /> + +Note: This is equivalent to `Set(this)`, but provided to allow for chained expressions. + + + +Converts this Collection to a Set, maintaining the order of iteration and discarding keys. + +;`} /> + +Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a List, discarding keys. + +;`} /> + +This is similar to `List(collection)`, but provided to allow for chained expressions. However, when called on `Map` or other keyed collections, `collection.toList()` discards the keys and creates a list of only the values, whereas `List(collection)` creates a list of entry tuples. + + + + + + + +Converts this Collection to a Stack, discarding keys. Throws if values are not hashable. + +;`} /> + +Note: This is equivalent to `Stack(this)`, but provided to allow for chained expressions. + +## Conversion to Seq + + + +Converts this Collection to a Seq of the same kind (indexed, keyed, or set). + +;`} /> + + + +Returns a Seq.Keyed from this Collection where indices are treated as keys. + +;`} /> + +This is useful if you want to operate on an Collection.Indexed and preserve the [index, value] pairs. + +The returned Seq will have identical iteration order as this Collection. + + v === 'B'); +// Seq [ "B" ] +const keyedSeq = indexedSeq.toKeyedSeq(); +// Seq { 0: "A", 1: "B", 2: "C" } +keyedSeq.filter((v) => v === 'B');`} +/> + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +;`} /> + + + +Returns a Seq.Set of the values of this Collection, discarding keys. + +;`} /> + +## Iterators + + + +An iterator of this `Collection`'s keys. + +;`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `keySeq` instead, if this is what you want. + + + +An iterator of this `Collection`'s values. + +;`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `valueSeq` instead, if this is what you want. + + + +An iterator of this `Collection`'s entries as `[ key, value ]` tuples. + +;`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `entrySeq` instead, if this is what you want. + + + +;`} /> + +## Collections (Seq) + + + +Returns a new Seq.Indexed of the keys of this Collection, discarding values. + +;`} /> + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +;`} /> + + + +Returns a new Seq.Indexed of [key, value] tuples. + +;`} /> + +## Sequence algorithms + + + +Returns a new Collection of the same type with values passed through a `mapper` function. + +(mapper: (value: V, key: K, iter: this) => M, context?: unknown): Collection;`} +/> + +Note: `map()` always returns a new instance, even if it produced the same value at every step. + + + +Returns a new Collection of the same type with only the entries for which the `predicate` function returns true. + +(predicate: (value: V, key: K, iter: this) => value is F, context?: unknown): Collection;`} +/> + unknown, context?: unknown): this;`} +/> + +Note: `filter()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new Collection of the same type with only the entries for which the `predicate` function returns false. + + boolean, context?: unknown): this;`} +/> + +Note: `filterNot()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new Collection with the values for which the `predicate` function returns false and another for which is returns true. + +(predicate: (this: C, value: V, key: K, iter: this) => value is F, context?: C): [Collection, Collection];`} +/> +(predicate: (this: C, value: V, key: K, iter: this) => unknown, context?: C): [this, this];`} +/> + + + +Returns a new Collection of the same type in reverse order. + + + + + +Returns a new Collection of the same type which includes the same entries, stably sorted by using a `comparator`. + +): this;`} /> + +If a `comparator` is not provided, a default comparator uses `<` and `>`. + +`comparator(valueA, valueB)`: + +- Returns `0` if the elements should not be swapped. +- Returns `-1` (or any negative number) if `valueA` comes before `valueB` +- Returns `1` (or any positive number) if `valueA` comes after `valueB` +- Alternatively, can return a value of the `PairSorting` enum type +- Is pure, i.e. it must always return the same value for the same pair of values. + +When sorting collections which have no defined order, their ordered equivalents will be returned. e.g. `map.sort()` returns OrderedMap. + + { + if (a < b) { + return -1; + } + if (a > b) { + return 1; + } + if (a === b) { + return 0; + } +});`} +/> + +Note: `sort()` Always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Like `sort`, but also accepts a `comparatorValueMapper` which allows for sorting by more sophisticated means. + +(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: Comparator): this;`} +/> + + member.name);`} +/> + +Note: `sortBy()` Always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Returns a `Map` of `Collection`, grouped by the return value of the `grouper` function. + +(grouper: (value: V, key: K, iter: this) => G, context?: unknown): Map;`} +/> + +Note: This is always an eager operation. + + x.get('v'));`} +/> + +## Side effects + + + +The `sideEffect` is executed for every entry in the Collection. + + unknown, context?: unknown): number;`} +/> + +Unlike `Array#forEach`, if any call of `sideEffect` returns `false`, the iteration will stop. Returns the number of entries iterated (including the last iteration which returned false). + +## Creating subsets + + + +Returns a new Collection of the same type representing a portion of this Collection from start up to but not including end. + + + +If begin is negative, it is offset from the end of the Collection. e.g. `slice(-2)` returns a Collection of the last two entries. If it is not provided the new Collection will begin at the beginning of this Collection. + +If end is negative, it is offset from the end of the Collection. e.g. `slice(0, -1)` returns a Collection of everything but the last entry. If it is not provided, the new Collection will continue through the end of this Collection. + +If the requested slice is equivalent to the current Collection, then it will return itself. + + + +Returns a new Collection of the same type containing all entries except the first. + + + + + +Returns a new Collection of the same type containing all entries except the last. + + + + + +Returns a new Collection of the same type which excludes the first `amount` entries from this Collection. + + + + + +Returns a new Collection of the same type which excludes the last `amount` entries from this Collection. + + + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns false. + + boolean, context?: unknown): this;`} +/> + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns true. + + boolean, context?: unknown): this;`} +/> + + + +Returns a new Collection of the same type which includes the first `amount` entries from this Collection. + + + + + +Returns a new Collection of the same type which includes the last `amount` entries from this Collection. + + + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns true. + + boolean, context?: unknown): this;`} +/> + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns false. + + boolean, context?: unknown): this;`} +/> + +## Combination + + + +Returns a new Collection of the same type with other values and collection-like concatenated to this one. + +): Collection;`} +/> + +For Seqs, all entries will be present in the resulting Seq, even if they have the same key. + + + +Flattens nested Collections. + +;`} /> +;`} /> + +Will deeply flatten the Collection by default, returning a Collection of the same type, but a `depth` can be provided in the form of a number or boolean (where true means to shallowly flatten one level). A depth of 0 (or shallow: false) will deeply flatten. + +Flattens only others Collection, not Arrays or Objects. + +Note: `flatten(true)` operates on `Collection>` and returns `Collection` + + + +Flat-maps the Collection, returning a Collection of the same type. + +(mapper: (value: V, key: K, iter: this) => Iterable, context?: unknown): Collection;`} +/> +(mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, context?: unknown): Collection;`} +/> + + + +Reduces the Collection to a value by calling the `reducer` for every entry in the Collection and passing along the reduced value. + +(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: unknown): R;`} +/> +(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R;`} +/> + + + +Reduces the Collection in reverse (from the right side). + +(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: unknown): R;`} +/> +(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R;`} +/> + + + +True if `predicate` returns true for all entries in the Collection. + + boolean, context?: unknown): boolean;`} +/> + + + +True if `predicate` returns true for any entry in the Collection. + + boolean, context?: unknown): boolean;`} +/> + + + +Joins values together as a string, inserting a separator between each. The default separator is `","`. + + + + + +Returns true if this Collection includes no values. + + + +For some lazy `Seq`, `isEmpty` might need to iterate to determine emptiness. At most one iteration will occur. + + + +Returns the size of this Collection. + + + boolean, context?: unknown): number;`} +/> + +Regardless of if this Collection can describe its size lazily (some Seqs cannot), this method will always return the correct size. E.g. it evaluates a lazy `Seq` if necessary. + +If `predicate` is provided, then this returns the count of entries in the Collection for which the `predicate` returns true. + + + +Returns a `Seq.Keyed` of counts, grouped by the return value of the `grouper` function. + +(grouper: (value: V, key: K, iter: this) => G, context?: unknown): Map;`} +/> + +Note: This is not a lazy operation. + +## Search for value + + + +Returns the first value for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: V): V | undefined;`} +/> + + + +Returns the last value for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: V): V | undefined;`} +/> + + + +Returns the first [key, value] entry for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: V): [K, V] | undefined;`} +/> + + + +Returns the last [key, value] entry for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: V): [K, V] | undefined;`} +/> + + + +Returns the key for which the `predicate` returns true. + + boolean, context?: unknown): K | undefined;`} +/> + + + +Returns the last key for which the `predicate` returns true. + + boolean, context?: unknown): K | undefined;`} +/> + + + +Returns the key associated with the search value, or undefined. + + + + + +Returns the last key associated with the search value, or undefined. + + + + + +Returns the maximum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): V | undefined;`} /> + +The `comparator` is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `>`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `max` will operate independent of the order of input as long as the comparator is commutative. The default comparator `>` is commutative _only_ when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `max`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means. + +(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: Comparator): V | undefined;`} +/> + + i.avgHit);`} +/> + + + +Returns the minimum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): V | undefined;`} /> + +The `comparator` is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `<`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `min` will operate independent of the order of input as long as the comparator is commutative. The default comparator `<` is commutative _only_ when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `min`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means. + +(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: Comparator): V | undefined;`} +/> + + i.avgHit); // will output { name: 'Bob', avgHit: 1 }`} +/> + +## Comparison + + + +True if `iter` includes every value in this Collection. + +): boolean;`} /> + + + +True if this Collection includes every value in `iter`. + +): boolean;`} /> diff --git a/website/docs/Intro.mdx b/website/docs/Intro.mdx new file mode 100644 index 0000000000..3e2022aeef --- /dev/null +++ b/website/docs/Intro.mdx @@ -0,0 +1,90 @@ +Immutable data encourages pure functions (data-in, data-out) and lends itself +to much simpler application development and enabling techniques from +functional programming such as lazy evaluation. + +While designed to bring these powerful functional concepts to JavaScript, it +presents an Object-Oriented API familiar to Javascript engineers and closely +mirroring that of Array, Map, and Set. It is easy and efficient to convert to +and from plain Javascript types. + +## How to read these docs + +In order to better explain what kinds of values the Immutable.js API expects +and produces, this documentation is presented in a statically typed dialect of +JavaScript (like [Flow][] or [TypeScript][]). You _don't need_ to use these +type checking tools in order to use Immutable.js, however becoming familiar +with their syntax will help you get a deeper understanding of this API. + +**A few examples and how to read them.** + +All methods describe the kinds of data they accept and the kinds of data +they return. For example a function which accepts two numbers and returns +a number would look like this: + +```js +sum(first: number, second: number): number +``` + +Sometimes, methods can accept different kinds of data or return different +kinds of data, and this is described with a _type variable_, which is +typically in all-caps. For example, a function which always returns the same +kind of data it was provided would look like this: + +```js +identity(value: T): T +``` + +Type variables are defined with classes and referred to in methods. For +example, a class that holds onto a value for you might look like this: + +```js +class Box { +constructor(value: T) +getValue(): T +} +``` + +In order to manipulate Immutable data, methods that we're used to affecting +a Collection instead return a new Collection of the same type. The type +`this` refers to the same kind of class. For example, a List which returns +new Lists when you `push` a value onto it might look like: + +```js +class List { +push(value: T): this +} +``` + +Many methods in Immutable.js accept values which implement the JavaScript +[Iterable][] protocol, and might appear like `Iterable` for something +which represents sequence of strings. Typically in JavaScript we use plain +Arrays (`[]`) when an Iterable is expected, but also all of the Immutable.js +collections are iterable themselves! + +For example, to get a value deep within a structure of data, we might use +`getIn` which expects an `Iterable` path: + +``` +getIn(path: Iterable): unknown +``` + +To use this method, we could pass an array: `data.getIn([ "key", 2 ])`. + +Note: All examples are presented in the modern [ES2015][] version of +JavaScript. Use tools like Babel to support older browsers. + +For example: + +```js +// ES2015 +const mappedFoo = foo.map((x) => x * x); +// ES5 +var mappedFoo = foo.map(function (x) { + return x * x; +}); +``` + +[ES2015]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla +[TypeScript]: https://www.typescriptlang.org/ +[Flow]: https://flowtype.org/ +[Iterable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols diff --git a/website/docs/List.mdx b/website/docs/List.mdx new file mode 100644 index 0000000000..2f24247008 --- /dev/null +++ b/website/docs/List.mdx @@ -0,0 +1,1277 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# List + +Lists are ordered indexed dense collections, much like a JavaScript Array. + + extends Collection.Indexed`} /> + +Lists are immutable and fully persistent with O(log32 N) gets and sets, and O(1) push and pop. + +Lists implement Deque, with efficient addition and removal from both the end (, ) and beginning (, ). + +Unlike a JavaScript Array, there is no distinction between an "unset" index and an index set to undefined. List#forEach visits all indices from 0 to size, regardless of whether they were explicitly defined. + +## Construction + + + +Create a new immutable List containing the values of the provided collection-like. + +(collection?: Iterable | ArrayLike): List`} /> + +Note: is a factory function and not a class, and does not use the `new` keyword during construction. + + + + + + + + + +## Static methods + + + + + + + +(...values: Array): List`} /> + +## Members + + + +The number of items in this List. + + + +## Persistent changes + + + +Returns a new List which includes `value` at `index`. If `index` already exists in this List, it will be replaced. + +`} /> + +`index` may be a negative number, which indexes back from the end of the List. `v.set(-1, "value")` sets the last item in the List. + +If `index` larger than , the returned List's will be large enough to include the index. + + + +Note: `set` can be used in withMutations. + + + +Returns a new List which excludes this `index` and with a size 1 less than this List. Values at indices above `index` are shifted down by 1 to fill the position. + +This is synonymous with `list.splice(index, 1)`. + +`} /> + +`index` may be a negative number, which indexes back from the end of the List. `v.delete(-1)` deletes the last item in the List. + +Note: `delete` cannot be safely used in IE8. + + + +Since `delete()` re-indexes values, it produces a complete copy, which has `O(N)` complexity. + +Note: `delete` _cannot_ be used in withMutations. + + + +Returns a new List with `value` at `index` with a size 1 more than this List. Values at indices above `index` are shifted over by 1. + +`} /> + +This is synonymous with `list.splice(index, 0, value)`. + + + +Since `insert()` re-indexes values, it produces a complete copy, which has `O(N)` complexity. + +Note: `insert` _cannot_ be used in withMutations. + + + +Returns a new List with 0 size and no values in constant time. + +`} /> + + + +Note: `clear` can be used in withMutations. + + + +Returns a new List with the provided `values` appended, starting at this List's `size`. + +): List`} /> + + + +Note: `push` can be used in withMutations. + + + +Returns a new List with a size one less than this List, excluding the last index in this List. + +`} /> + +Note: this differs from `Array#pop` because it returns a new List rather than the removed value. Use `last()` to get the last value +in this List. + + + +Note: `pop` can be used in withMutations. + + + +Returns a new List with the provided `values` prepended, shifting other values ahead to higher indices. + +): List`} /> + + + +Note: `unshift` can be used in withMutations. + + + +Returns a new List with a size one less than this List, excluding the first index in this List, shifting all other values to a lower index. + +`} /> + +Note: this differs from `Array#shift` because it returns a new List rather than the removed value. Use `first()` to get the first value in this List. + + + +Note: `shift` can be used in withMutations. + + + +Returns a new List with an updated value at `index` with the return value of calling `updater` with the existing value, or `notSetValue` if `index` was not set. If called with a single argument, `updater` is called with the List itself. + + T): List +update(index: number, updater: (value: T | undefined) => T | undefined): List +update(updater: (value: this) => R): R`} +/> + +`index` may be a negative number, which indexes back from the end of the List. `v.update(-1)` updates the last item in the List. + + val.toUpperCase()) +// List [ "a", "b", "C" ]`} +/> + +This can be very useful as a way to "chain" a normal function into a sequence of methods. RxJS calls this "let" and lodash calls it "thru". + +For example, to sum a List after mapping and filtering: + + sum + x, 0) +} + +List([ 1, 2, 3 ]) +.map(x => x + 1) +.filter(x => x % 2 === 0) +.update(sum)`} +/> + +Note: `update(index)` can be used in withMutations. + + + +Returns a new List with size `size`. If `size` is less than this List's size, the new List will exclude values at the higher indices. If `size` is greater than this List's size, the new List will have undefined values for the newly available indices. + +`} /> + +When building a new List and the final size is known up front, `setSize` used in conjunction with withMutations may result in the more performant construction. + +## Deep persistent changes + + + +Returns a new List having set `value` at this `keyPath`. If any keys in `keyPath` do not exist, a new immutable Map will be created at that key. + +, value: unknown): List`} +/> + +Index numbers are used as keys to determine the path to follow in the List. + + + +Plain JavaScript Object or Arrays may be nested within an Immutable.js Collection, and setIn() can update those values as well, treating them immutably by creating new copies of those values with the changes applied. + + + +Note: `setIn` can be used in withMutations. + + + +Returns a new List having removed the value at this `keyPath`. If any keys in `keyPath` do not exist, no change will occur. + +): List`} /> + + + +Plain JavaScript Object or Arrays may be nested within an Immutable.js Collection, and `removeIn()` can update those values as well, treating them immutably by creating new copies of those values with the changes applied. + + + +Note: `deleteIn` _cannot_ be safely used in withMutations. + + + +, notSetValue: unknown, updater: (value: unknown) => unknown): this +updateIn(keyPath: Iterable, updater: (value: unknown) => unknown): this`} +/> + +Note: `updateIn` can be used in withMutations. + + + +, ...collections: Array): this`} +/> + +Note: `mergeIn` can be used in withMutations. + + + +, ...collections: Array): this`} +/> + +Note: `mergeDeepIn` can be used in withMutations. + +## Transient changes + + + +Note: Not all methods can be safely used on a mutable collection or within `withMutations`! Check the documentation for each method to see if it allows being used in `withMutations`. + + unknown): List`} +/> + + + +An alternative API for withMutations() + +Note: Not all methods can be safely used on a mutable collection or within `withMutations`! Check the documentation for each method to see if it allows being used in `withMutations`. + +`} /> + + + + + + + + + + + + + + + +## Sequence algorithms + + + +Returns a new List with other values or collections concatenated to this one. + +(...valuesOrCollections: Array | C>): List`} +/> + +Note: `concat` can be used in withMutations. + + + +Returns a new List with values passed through a `mapper` function. + +(mapper: (value: T, key: number, iter: this) => M, context?: unknown): List`} +/> + + 10 * x)`} /> + + + +Returns a new List with values passed through a `mapper` function. + +(mapper: (value: T, key: number, iter: this) => M, context?: unknown): List`} +/> + + + + + +Returns a new List with values passed through a `mapper` function. + +(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM] | undefined, context?: unknown): List<[KM, VM]>`} +/> + + + +Flat-maps the List, returning a new List. + +Similar to `list.map(...).flatten(true)`. + +(mapper: (value: T, key: number, iter: this) => Iterable, context?: unknown): List`} +/> + + + +Returns a new List with only the values for which the `predicate` function returns true. + +Note: `filter()` always returns a new instance, even if it results in not filtering out any values. + +(predicate: (value: T, index: number, iter: this) => value is F, context?: unknown): List`} +/> + + + +Returns a new List with the values for which the `predicate` function returns false and another for which is returns true. + +(predicate: (this: C, value: T, index: number, iter: this) => value is F, context?: C): [List, List]`} +/> + + + +Returns a List "zipped" with the provided collection. + +Like `zipWith`, but using the default `zipper`: creating an `Array`. + +(other: Collection): List<[T, U]> +zip(other: Collection, other2: Collection): List<[T, U, V]>`} +/> + + + + + +Returns a List "zipped" with the provided collections. + +Unlike `zip`, `zipAll` continues zipping until the longest collection is exhausted. Missing values from shorter collections are filled with `undefined`. + +(other: Collection): List<[T, U]> +zipAll(other: Collection, other2: Collection): List<[T, U, V]>`} +/> + + + +Note: Since zipAll will return a collection as large as the largest input, some results may contain undefined values. +TypeScript cannot account for these without cases (as of v2.5). + + + +Returns a List "zipped" with the provided collections by using a custom `zipper` function. + +(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection): List +zipWith(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection, thirdCollection: Collection): List +zipWith(zipper: (...values: Array) => Z, ...collections: Array>): List`} +/> + + a + b, b);`} +/> + + + +Returns a new List with its values shuffled thanks to the [Fisher–Yates](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle) algorithm. +It uses Math.random, but you can provide your own random number generator. + + number): this`} /> + + + +Returns a new List with only the values for which the `predicate` function returns false. + + boolean, context?: unknown): this`} +/> + + x % 2 === 0);`} /> + +Note: `filterNot()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new List with the order of the values reversed. + +`} /> + + + + + +Returns List of the same type which includes the same entries, stably sorted by using a comparator. + + number): List`} /> + + b - a);`} /> + +If a comparator is not provided, a default comparator uses `<` and `>`. + +`comparator(valueA, valueB)`: + +- Returns `0` if the elements should not be swapped. +- Returns `-1` (or any negative number) if `valueA` comes before `valueB` +- Returns `1` (or any positive number) if `valueA` comes after `valueB` +- Alternatively, can return a value of the `PairSorting` enum type +- Is pure, i.e. it must always return the same value for the same pair of values. + +When sorting collections which have no defined order, their ordered equivalents will be returned. e.g. `map.sort()` returns `OrderedMap`. + +Note: `sort()` always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Like `sort`, but also accepts a `comparatorValueMapper` which allows for sorting by more sophisticated means: + + C, comparator?: (a, b) => number): List`} +/> + + person.age);`} +/> + +Note: `sortBy()` always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Returns a `Map` of `List` grouped by the return value of the `grouper` function. + +(grouper: (value: T, index: number, iter: this) => G, context?: unknown): Map>`} +/> + +Note: This is not a lazy operation. + + x.get('v'))`} +/> + +## Conversion to JavaScript types + + + +Deeply converts this List to a JavaScript Array. + +>`} /> + + + +Shallowly converts this Indexed collection to equivalent native JavaScript Array. + +`} /> + + + +Shallowly converts this collection to an Array. + +`} /> + + + +Shallowly converts this List to a JavaScript Object. + + + +Convert keys to strings. + +## Reading values + + + +Returns the value at `index`. + + + + + + + +True if a key exists within this Collection, using Immutable.is to determine equality + + + + + + + +True if a value exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + + + +Returns the first value in this collection. + + + + + + + +Returns the last value in this collection. + + + + + +## Conversion to Seq + + + +Converts this List to a Seq of the same kind (indexed). + +`} /> + + + +If this is a collection of [key, value] entry tuples, it will return a Seq.Keyed of those entries. + +`} /> + + + +Returns a Seq.Keyed from this List where indices are treated as keys. + +This is useful if you want to operate on a List and preserve the [index, value] pairs. + +The returned Seq will have identical iteration order as this List. + +`} /> + + v === 'B') +// Seq [ "B" ] +const keyedSeq = indexedSeq.toKeyedSeq() +// Seq { 0: "A", 1: "B", 2: "C" } +keyedSeq.filter(v => v === 'B') +// Seq { 1: "B" }`} +/> + + + +Returns a Seq.Indexed of the values of this List, discarding keys. + +`} /> + + + +Returns a Seq.Set of the values of this List, discarding keys. + +`} /> + +## Combination + + + +Returns a new List with the separator inserted between each value in this List. + +`} /> + + + + + +Returns a new List with the values from each collection interleaved. + +>): List`} +/> + +The resulting Collection includes the first item from each, then the second from each, etc. + + + +The shortest Collection stops interleave. + + + +Since `interleave()` re-indexes values, it produces a complete copy, which has `O(N)` complexity. + +Note: `interleave()` _cannot_ be used in withMutations. + + + +Returns a new List by replacing a region of this List with new values. If values are not provided, it only skips the region to be removed. + +`index` may be a negative number, which indexes back from the end of the List. `s.splice(-2)` splices after the second to last item. + +): List`} +/> + + + +Since `splice()` re-indexes values, it produces a complete copy, which has `O(N)` complexity. + +Note: `splice` _cannot_ be used in withMutations. + + + +Returns a new flattened List, optionally only flattening to a particular depth. + + +flatten(shallow?: boolean): List`} +/> + + + +## Search for value + + + +Returns the first index at which a given value can be found in the Collection, or -1 if it is not present. + + + + + + + +Returns the last index at which a given value can be found in the Collection, or -1 if it is not present. + + + + + + + +Returns the first index in the Collection where a value satisfies the provided predicate function. Otherwise -1 is returned. + + boolean, context?: unknown): number`} +/> + + x % 2 === 0)`} /> + + + +Returns the last index in the Collection where a value satisfies the provided predicate function. Otherwise -1 is returned. + + boolean, context?: unknown): number`} +/> + + x % 2 === 0)`} +/> + + + +Returns the first value for which the `predicate` function returns true. + + boolean, context?: unknown): T | undefined`} +/> + + x % 2 === 0)`} /> + + + +Returns the last value for which the `predicate` function returns true. + + boolean, context?: unknown): T | undefined`} +/> + + x % 2 === 0)`} /> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the first `[key, value]` entry for which the `predicate` function returns true. + + boolean, context?: unknown): [number, T] | undefined`} +/> + + x % 2 === 0)`} /> + + + +Returns the last `[key, value]` entry for which the `predicate` function returns true. + + boolean, context?: unknown): [number, T] | undefined`} +/> + + x % 2 === 0)`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the first key for which the `predicate` function returns true. + + boolean, context?: unknown): number | undefined`} +/> + + x % 2 === 0)`} /> + + + +Returns the last key for which the `predicate` function returns true. + + boolean, context?: unknown): number | undefined`} +/> + + x % 2 === 0)`} /> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the key associated with the search value, or undefined. + + + + + + + +Returns the last key associated with the search value, or undefined. + + + + + + + +Returns the maximum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + + number): T | undefined`} +/> + + + +The comparator is used in the same way as Collection#sort. If it is not provided, the default comparator is `>`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `max` will operate independent of the order of input as long as the comparator is commutative. The default comparator `>` is commutative only when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `max()`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means. + +( + comparatorValueMapper: (value: T, key: number, iter: this) => C, + comparator?: (valueA: C, valueB: C) => number +): T | undefined`} +/> + + person.age)`} +/> + + + +Returns the minimum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + + number): T | undefined`} +/> + + + +The comparator is used in the same way as Collection#sort. If it is not provided, the default comparator is `<`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `min` will operate independent of the order of input as long as the comparator is commutative. The default comparator `<` is commutative only when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `min()`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means. + +( + comparatorValueMapper: (value: T, key: number, iter: this) => C, + comparator?: (valueA: C, valueB: C) => number +): T | undefined`} +/> + + person.age)`} +/> + +## Value equality + + + +True if this and the other Collection have value equality, as defined by `Immutable.is()`. + + + +Note: This is equivalent to `Immutable.is(this, other)`, but provided to allow for chained expressions. + + + +Computes and returns the hashed identity for this Collection. + +The `hashCode` of a Collection is used to determine potential equality, and is used when adding this to a `Set` or as a key in a `Map`, enabling lookup via a different instance. + + + + + +If two values have the same `hashCode`, they are [not guaranteed to be equal][Hash Collision]. If two values have different `hashCode`s, they must not be equal. + +[Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) + +## Reading deep values + + + +Returns the value found by following a path of keys or indices through nested Collections. + +, notSetValue?: unknown): unknown`} +/> + + + +Plain JavaScript Object or Arrays may be nested within an Immutable.js Collection, and getIn() can access those values as well: + + + + + +True if the result of following a path of keys or indices through nested Collections results in a set value. + +): boolean`} /> + +## Conversion to Collections + + + +Converts this Collection to a Map, Throws if keys are not hashable. + +`} /> + +Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a Map, maintaining the order of iteration. + +`} /> + +Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a Set, discarding keys. Throws if values are not hashable. + +`} /> + +Note: This is equivalent to `Set(this)`, but provided to allow for chained expressions. + + + +Converts this Collection to a Set, maintaining the order of iteration and discarding keys. + +`} /> + +Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a List, discarding keys. + +This is similar to `List(collection)`, but provided to allow for chained expressions. However, when called on `Map` or other keyed collections, `collection.toList()` discards the keys and creates a list of only the values, whereas `List(collection)` creates a list of entry tuples. + +`} /> + + + + + +Converts this Collection to a Stack, discarding keys. Throws if values are not hashable. + +`} /> + +Note: This is equivalent to `Stack(this)`, but provided to allow for chained expressions. + +## Iterators + + + +An iterator of this `Collection`'s keys. + +`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `keySeq` instead, if this is what you want. + + + +An iterator of this `Collection`'s values. + +`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `valueSeq` instead, if this is what you want. + + + +An iterator of this `Collection`'s entries as `[ key, value ]` tuples. + +`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `entrySeq` instead, if this is what you want. + +## Collections (Seq) + + + +Returns a new Seq.Indexed of the keys of this Collection, discarding values. + +`} /> + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +`} /> + + + +Returns a new Seq.Indexed of [key, value] tuples. + +`} /> + +## Side effects + + + +The `sideEffect` is executed for every entry in the Collection. + + unknown, context?: unknown): number`} +/> + +Unlike `Array#forEach`, if any call of `sideEffect` returns `false`, the iteration will stop. Returns the number of entries iterated (including the last iteration which returned false). + +## Creating subsets + + + +Returns a new Collection of the same type representing a portion of this Collection from start up to but not including end. + + + +If begin is negative, it is offset from the end of the Collection. e.g. `slice(-2)` returns a Collection of the last two entries. If it is not provided the new Collection will begin at the beginning of this Collection. + +If end is negative, it is offset from the end of the Collection. e.g. `slice(0, -1)` returns a Collection of everything but the last entry. If it is not provided, the new Collection will continue through the end of this Collection. + +If the requested slice is equivalent to the current Collection, then it will return itself. + + + +Returns a new Collection of the same type containing all entries except the first. + +`} /> + + + +Returns a new Collection of the same type containing all entries except the last. + +`} /> + + + +Returns a new Collection of the same type which excludes the first `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which excludes the last `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns false. + + boolean, context?: unknown): List`} +/> + + x.match(/g/))`} +/> + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns true. + + boolean, context?: unknown): this`} +/> + + x.match(/hat/))`} +/> + + + +Returns a new Collection of the same type which includes the first `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which includes the last `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns true. + + boolean, context?: unknown): List`} +/> + + x.match(/o/))`} +/> + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns false. + + boolean, context?: unknown): List`} +/> + + x.match(/at/))`} +/> + +## Reducing a value + + + +Reduces the Collection to a value by calling the `reducer` for every entry in the Collection and passing along the reduced value. + +(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: unknown): R +reduce(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R`} +/> + +If `initialReduction` is not provided, the first item in the Collection will be used. + + + +Reduces the Collection in reverse (from the right side). + +(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: unknown): R +reduceRight(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R`} +/> + +Note: Similar to this.reverse().reduce(), and provided for parity with `Array#reduceRight`. + + + +True if `predicate` returns true for all entries in the Collection. + + boolean, context?: unknown): boolean`} +/> + + + +True if `predicate` returns true for any entry in the Collection. + + boolean, context?: unknown): boolean`} +/> + + + +Joins values together as a string, inserting a separator between each. The default separator is `","`. + + + + + +Returns true if this Collection includes no values. + + + +For some lazy `Seq`, `isEmpty` might need to iterate to determine emptiness. At most one iteration will occur. + + + +Returns the size of this Collection. + + boolean, context?: unknown): number`} +/> + +Regardless of if this Collection can describe its size lazily (some Seqs cannot), this method will always return the correct size. E.g. it evaluates a lazy `Seq` if necessary. + +If `predicate` is provided, then this returns the count of entries in the Collection for which the `predicate` returns true. + + + +Returns a `Seq.Keyed` of counts, grouped by the return value of the `grouper` function. + +(grouper: (value: V, key: K, iter: this) => G, context?: unknown): Map`} +/> + +Note: This is not a lazy operation. + +## Comparison + + + +True if `iter` includes every value in this Collection. + +): boolean`} /> + + + +True if this Collection includes every value in `iter`. + +): boolean`} /> diff --git a/website/docs/Map.mdx b/website/docs/Map.mdx new file mode 100644 index 0000000000..0c73b7fc8d --- /dev/null +++ b/website/docs/Map.mdx @@ -0,0 +1,1320 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# Map + +Immutable Map is an unordered Collection.Keyed of (key, value) pairs with `O(log32 N)` gets and `O(log32 N)` persistent sets. + + extends Collection.Keyed`} /> + +Iteration order of a Map is undefined, however is stable. Multiple iterations of the same Map will iterate in the same order. + +Map's keys can be of any type, and use `Immutable.is` to determine key equality. This allows the use of any value (including NaN) as a key. + +Because `Immutable.is` returns equality based on value semantics, and Immutable collections are treated as values, any Immutable collection may be used as a key. + + + +Any JavaScript object may be used as a key, however strict identity is used to evaluate key equality. Two similar looking objects will represent two different keys. + +Implemented by a hash-array mapped trie. + +## Construction + + + +Create a new Immutable Map. + +(collection?: Iterable<[K, V]>): Map +Map(obj: { [key: PropertyKey]: V }): Map +`} +/> + +Created with the same key value pairs as the provided Collection.Keyed or JavaScript Object or expects a Collection of [K, V] tuple entries. + +Note: `Map` is a factory function and not a class, and does not use the `new` keyword during construction. + + + + + +Keep in mind, when using JS objects to construct Immutable Maps, that JavaScript Object properties are always strings, even if written in a quote-less shorthand, while Immutable Maps accept keys of any type. + +```js +let obj = { 1: 'one' }; +Object.keys(obj); // [ "1" ] +assert.equal(obj['1'], obj[1]); // "one" === "one" + +let map = Map(obj); +assert.notEqual(map.get('1'), map.get(1)); // "one" !== undefined +``` + +Property access for JavaScript Objects first converts the key to a string, but since Immutable Map keys can be of any type the argument to `get()` is not altered. + +## Static Methods + + + +True if the provided value is a Map. + +`} +/> + +## Members + + + +The number of entries in this Map. + + + +## Persistent changes + + + +Returns a new Map also containing the new key, value pair. If an equivalent key already exists in this Map, it will be replaced. + +`} /> + + + +Note: `set` can be used in `withMutations`. + + + +Returns a new Map which excludes this `key`. + +`} /> + +Note: `delete` cannot be safely used in IE8, but is provided to mirror the ES6 collection API. + + + +Note: `delete` can be used in `withMutations`. + + + +Returns a new Map which excludes the provided `keys`. + +): this`} /> + + + +Note: `deleteAll` can be used in `withMutations`. + + + +Returns a new Map containing no keys or values. + +`} /> + + + +Note: `clear` can be used in `withMutations`. + + + +Returns a new Map having updated the value at this `key` with the return value of calling `updater` with the existing value. + + V): Map +update(key: K, updater: (value: V | undefined) => V | undefined): Map +update(updater: (value: this) => R): R`} +/> + +Similar to: `map.set(key, updater(map.get(key)))`. + + value + value)`} +/> + +This is most commonly used to call methods on collections within a structure of data. For example, in order to `.push()` onto a nested `List`, `update` and `push` can be used together: + + list.push(4))`} +/> + +When a `notSetValue` is provided, it is provided to the `updater` function when the value at the key does not exist in the Map. + + value + value)`} +/> + +However, if the `updater` function returns the same value it was called with, then no change will occur. This is still true if `notSetValue` is provided. + + val) +// Map { "apples": 10 } +assert.strictEqual(newMap, aMap);`} +/> + +For code using ES2015 or later, using `notSetValue` is discouraged in favor of function parameter default values. This helps to avoid any potential confusion with identify functions as described above. + +The previous example behaves differently when written with default values: + + val)`} +/> + +If no key is provided, then the `updater` function return value is returned as well. + + aMap.get('key')) +// "value"`} +/> + +This can be very useful as a way to "chain" a normal function into a sequence of methods. RxJS calls this "let" and lodash calls it "thru". + +For example, to sum the values in a Map: + + sum + x, 0) +} + +Map({ x: 1, y: 2, z: 3 }) +.map(x => x + 1) +.filter(x => x % 2 === 0) +.update(sum)`} /> + +Note: `update(key)` can be used in `withMutations`. + + + +Returns a new Map resulting from merging the provided Collections (or JS objects) into this Map. In other words, this takes each entry of each collection and sets it on this Map. + +`} /> + +Note: Values provided to `merge` are shallowly converted before being merged. No nested values are altered. + + + +Note: `merge` can be used in `withMutations`. + + + +Like `merge()`, `mergeWith()` returns a new Map resulting from merging the provided Collections (or JS objects) into this Map, but uses the `merger` function for dealing with conflicts. + + unknown, ...collections): Map`} +/> + + oldVal / newVal, two) +// { "a": 0.2, "b": 0.5, "c": 30, "d": 60 } +two.mergeWith((oldVal, newVal) => oldVal / newVal, one) +// { "b": 2, "a": 5, "d": 60, "c": 30 }`} +/> + +Note: `mergeWith` can be used in `withMutations`. + + + +Like `merge()`, but when two compatible collections are encountered with the same key, it merges them as well, recursing deeply through the nested data. Two collections are considered to be compatible (and thus will be merged together) if they both fall into one of three categories: keyed (e.g., `Map`s, `Record`s, and objects), indexed (e.g., `List`s and arrays), or set-like (e.g., `Set`s). If they fall into separate categories, `mergeDeep` will replace the existing collection with the collection being merged in. This behavior can be customized by using `mergeDeepWith()`. + +`} /> + +Note: Indexed and set-like collections are merged using `concat()`/`union()` and therefore do not recurse. + + + +Note: `mergeDeep` can be used in `withMutations`. + + + +Like `mergeDeep()`, but when two non-collections or incompatible collections are encountered at the same key, it uses the `merger` function to determine the resulting value. Collections are considered incompatible if they fall into separate categories between keyed, indexed, and set-like. + + unknown, ...collections): Map`} +/> + + oldVal / newVal, two)`} +/> + +Note: `mergeDeepWith` can be used in `withMutations`. + +## Deep persistent changes + + + +Returns a new Map having set `value` at this `keyPath`. If any keys in `keyPath` do not exist, a new immutable Map will be created at that key. + +, value: unknown): Map`} +/> + + + +Plain JavaScript Object or Arrays may be nested within an Immutable.js Collection, and `setIn()` can update those values as well, treating them immutably by creating new copies of those values with the changes applied. + + + +If any key in the path exists but cannot be updated (such as a primitive like number or a custom Object like Date), an error will be thrown. + +Note: `setIn` can be used in `withMutations`. + + + +Returns a new Map having removed the value at this `keyPath`. If any keys in `keyPath` do not exist, no change will occur. + +): Map`} /> + +Note: `deleteIn` can be used in `withMutations`. + + + +Returns a new Map having applied the `updater` to the entry found at the keyPath. + +, notSetValue: unknown, updater: (value) => unknown): Map`} +/> + +This is most commonly used to call methods on collections nested within a structure of data. For example, in order to `.push()` onto a nested `List`, `updateIn` and `push` can be used together: + + list.push(4))`} +/> + +If any keys in `keyPath` do not exist, new Immutable `Map`s will be created at those keys. If the `keyPath` does not already contain a value, the `updater` function will be called with `notSetValue`, if provided, otherwise `undefined`. + + val * 2)`} +/> + +If the `updater` function returns the same value it was called with, then no change will occur. This is still true if `notSetValue` is provided. + + val) +// Map { "a": Map { "b": Map { "c": 10 } } } +assert.strictEqual(newMap, map)`} +/> + +For code using ES2015 or later, using `notSetValue` is discouraged in favor of function parameter default values. This helps to avoid any potential confusion with identify functions as described above. + +The previous example behaves differently when written with default values: + + val)`} +/> + +Plain JavaScript Object or Arrays may be nested within an Immutable.js Collection, and updateIn() can update those values as well, treating them immutably by creating new copies of those values with the changes applied. + + val * 2)`} +/> + +If any key in the path exists but cannot be updated (such as a primitive like number or a custom Object like Date), an error will be thrown. + +Note: `updateIn` can be used in `withMutations`. + + + +A combination of `updateIn` and `merge`, returning a new Map, but performing the merge at a point arrived at by following the keyPath. In other words, these two lines are equivalent: + +```js +map.updateIn(['a', 'b', 'c'], (abc) => abc.merge(y)); +map.mergeIn(['a', 'b', 'c'], y); +``` + +, ...collections: Array): Map`} +/> + +Note: `mergeIn` can be used in `withMutations`. + + + +A combination of `updateIn` and `mergeDeep`, returning a new Map, but performing the deep merge at a point arrived at by following the keyPath. In other words, these two lines are equivalent: + +```js +map.updateIn(['a', 'b', 'c'], (abc) => abc.mergeDeep(y)); +map.mergeDeepIn(['a', 'b', 'c'], y); +``` + +, ...collections: Array): Map`} +/> + +Note: `mergeDeepIn` can be used in `withMutations`. + +## Transient changes + + + +Every time you call one of the above functions, a new immutable Map is created. If a pure function calls a number of these to produce a final return value, then a penalty on performance and memory has been paid by creating all of the intermediate immutable Maps. + +If you need to apply a series of mutations to produce a new immutable Map, `withMutations()` creates a temporary mutable copy of the Map which can apply mutations in a highly performant manner. In fact, this is exactly how complex mutations like `merge` are done. + + unknown): Map`} +/> + +As an example, this results in the creation of 2, not 4, new Maps: + + { + map.set('a', 1).set('b', 2).set('c', 3) +}) +assert.equal(map1.size, 0) +assert.equal(map2.size, 3)`} +/> + +Note: Not all methods can be used on a mutable collection or within `withMutations`! Read the documentation for each method to see if it is safe to use in `withMutations`. + + + +Another way to avoid creation of intermediate Immutable maps is to create a mutable copy of this collection. Mutable copies _always_ return `this`, and thus shouldn't be used for equality. Your function should never return a mutable copy of a collection, only use it internally to create a new collection. + + + +If possible, use `withMutations` to work with temporary mutable copies as it provides an easier to use API and considers many common optimizations. + +Note: if the collection is already mutable, `asMutable` returns itself. + +Note: Not all methods can be used on a mutable collection or within `withMutations`! Read the documentation for each method to see if it allows being used in `withMutations`. + + + +Returns true if this is a mutable copy (see `asMutable()`) and mutative alterations have been applied. + + + + + +The yin to `asMutable`'s yang. Because it applies to mutable collections, this operation is _mutable_ and may return itself (though may not return itself, i.e. if the result is an empty collection). Once performed, the original mutable copy must no longer be mutated since it may be the immutable result. + + + +If possible, use `withMutations` to work with temporary mutable copies as it provides an easier to use API and considers many common optimizations. + +## Sequence algorithms + + + +Returns a new Map with values passed through a `mapper` function. + +(mapper: (value: V, key: K, iter: this) => M, context?: unknown): Map`} +/> + + 10 * x)`} /> + + + +Returns a new Map with keys passed through a `mapper` function. + +(mapper: (key: K, value: V, iter: this) => M, context?: unknown): Map`} +/> + + x.toUpperCase())`} /> + + + +Returns a new Map with entries ([key, value] tuples) passed through a `mapper` function. + +(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM] | undefined, context?: unknown): Map`} +/> + + [ k.toUpperCase(), v * 2 ])`} +/> + +Note: `mapEntries()` always returns a new instance, even if it produced the same entry at every step. + +If the mapper function returns `undefined`, then the entry will be filtered. + + + +Flat-maps the Map, returning a Map of the same type. + +Similar to `map(...).flatten(true)`. + +(mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, context?: unknown): Map`} +/> + + + +Returns a new Map with only the entries for which the `predicate` function returns true. + + boolean, context?: unknown): Map`} +/> + +Note: `filter()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new Map with only the entries for which the `predicate` function returns false. + + boolean, context?: unknown): this`} +/> + + x % 2 === 0)`} +/> + +Note: `filterNot()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new Map with the order of the entries reversed. + + + + + +Returns a new Map with the entries partitioned into two Maps based on the `predicate` function. + + boolean, context?: unknown): [Map, Map]`} +/> + + x % 2 === 0)`} +/> + + + +Returns a new Map with the keys and values flipped. + +`} /> + + + + + +Returns an OrderedMap of the same type which includes the same entries, stably sorted by using a `comparator`. + +): this & OrderedMap`} /> + +If a `comparator` is not provided, a default comparator uses `<` and `>`. + +`comparator(valueA, valueB)`: + +- Returns `0` if the elements should not be swapped. +- Returns `-1` (or any negative number) if `valueA` comes before `valueB` +- Returns `1` (or any positive number) if `valueA` comes after `valueB` +- Alternatively, can return a value of the `PairSorting` enum type +- Is pure, i.e. it must always return the same value for the same pair of values. + + { + if (a < b) { return -1; } + if (a > b) { return 1; } + if (a === b) { return 0; } +});`} +/> + +Note: `sort()` Always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Like `sort`, but also accepts a `comparatorValueMapper` which allows for sorting by more sophisticated means: + +( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: (valueA: C, valueB: C) => number +): OrderedMap`} +/> + + member.name);`} +/> + +Note: `sortBy()` Always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Returns a `Map` of `Collection`, grouped by the return value of the `grouper` function. + +( + grouper: (value: V, key: K, iter: this) => G, + context?: unknown + ): Map`} +/> + +Note: This is always an eager operation. + + x.get('v'))`} +/> + +## Conversion to JavaScript types + + + +Deeply converts this Keyed collection to equivalent native JavaScript Object. + +> | { [key in PropertyKey]: DeepCopy }`} +/> + +Converts keys to Strings. + + + +Shallowly converts this Keyed collection to equivalent native JavaScript Object. + + | { [key in PropertyKey]: V }`} /> + +Converts keys to Strings. + + + +Shallowly converts this collection to an Array. + + | Array<[K, V]>`} /> + + + +Shallowly converts this Collection to an Object. + + + +Converts keys to Strings. + +## Conversion to Seq + + + +Converts this Collection to a Seq of the same kind (indexed, keyed, or set). + +`} /> + + + +Returns a Seq.Keyed from this Collection where indices are treated as keys. + +This is useful if you want to operate on a Collection.Indexed and preserve the [index, value] pairs. + +The returned Seq will have identical iteration order as this Collection. + +`} /> + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +`} /> + + + +Returns a Seq.Set of the values of this Collection, discarding keys. + +`} /> + +## Value equality + + + +True if this and the other Collection have value equality, as defined by `Immutable.is()`. + + + +Note: This is equivalent to `Immutable.is(this, other)`, but provided to allow for chained expressions. + + + +Computes and returns the hashed identity for this Collection. + +The `hashCode` of a Collection is used to determine potential equality, and is used when adding this to a `Set` or as a key in a `Map`, enabling lookup via a different instance. + + + + + +If two values have the same `hashCode`, they are [not guaranteed to be equal][Hash Collision]. If two values have different `hashCode`s, they must not be equal. + +[Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) + +## Reading values + + + +Returns the value associated with the provided key. + + + + + + + +True if a key exists within this Collection, using Immutable.is to determine equality. + + + + + + + +True if a value exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + + + +Returns the first value in this collection. + + + + + + + +Returns the last value in this collection. + + + + + +## Reading deep values + + + +Returns the value found by following a path of keys or indices through nested Collections. + +, notSetValue?: unknown): unknown`} +/> + + + +Plain JavaScript Object or Arrays may be nested within an Immutable.js Collection, and getIn() can access those values as well: + + + + + +True if the result of following a path of keys or indices through nested Collections results in a set value. + +): boolean`} /> + +## Conversion to Collections + + + +Converts this Collection to a Map, Throws if keys are not hashable. + +`} /> + +Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a Map, maintaining the order of iteration. + +`} /> + +Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a Set, discarding keys. Throws if values are not hashable. + +`} /> + +Note: This is equivalent to `Set(this)`, but provided to allow for chained expressions. + + + +Converts this Collection to a Set, maintaining the order of iteration and discarding keys. + +`} /> + +Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a List, discarding keys. + +`} /> + +This is similar to `List(collection)`, but provided to allow for chained expressions. However, when called on `Map` or other keyed collections, `collection.toList()` discards the keys and creates a list of only the values, whereas `List(collection)` creates a list of entry tuples. + + + + + +Converts this Collection to a Stack, discarding keys. Throws if values are not hashable. + +`} /> + +Note: This is equivalent to `Stack(this)`, but provided to allow for chained expressions. + +## Iterators + + + +An iterator of this `Collection`'s keys. + +`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `keySeq` instead, if this is what you want. + + + +An iterator of this `Collection`'s values. + +`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `valueSeq` instead, if this is what you want. + + + +An iterator of this `Collection`'s entries as `[ key, value ]` tuples. + +`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `entrySeq` instead, if this is what you want. + +## Collections (Seq) + + + +Returns a new Seq.Indexed of the keys of this Collection, discarding values. + +`} /> + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +`} /> + + + +Returns a new Seq.Indexed of [key, value] tuples. + +`} /> + +## Side effects + + + +The `sideEffect` is executed for every entry in the Collection. + + unknown, + context?: unknown + ): number`} +/> + +Unlike `Array#forEach`, if any call of `sideEffect` returns `false`, the iteration will stop. Returns the number of entries iterated (including the last iteration which returned false). + +## Creating subsets + + + +Returns a new Collection of the same type representing a portion of this Collection from start up to but not including end. + +`} /> + +If begin is negative, it is offset from the end of the Collection. e.g. `slice(-2)` returns a Collection of the last two entries. If it is not provided the new Collection will begin at the beginning of this Collection. + +If end is negative, it is offset from the end of the Collection. e.g. `slice(0, -1)` returns a Collection of everything but the last entry. If it is not provided, the new Collection will continue through the end of this Collection. + +If the requested slice is equivalent to the current Collection, then it will return itself. + + + +Returns a new Collection of the same type containing all entries except the first. + +`} /> + + + +Returns a new Collection of the same type containing all entries except the last. + +`} /> + + + +Returns a new Collection of the same type which excludes the first `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which excludes the last `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns false. + + boolean, context?: unknown): Map`} +/> + + x.match(/g/))`} +/> + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns true. + + boolean, context?: unknown): Map`} +/> + + x.match(/hat/))`} +/> + + + +Returns a new Collection of the same type which includes the first `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which includes the last `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns true. + + boolean, context?: unknown): Map`} +/> + + x.match(/o/))`} +/> + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns false. + + boolean, context?: unknown): Map`} +/> + + x.match(/at/))`} +/> + +## Combination + + + +Returns a new flattened Map, optionally only flattening to a particular depth. + + +flatten(shallow?: boolean): Map`} +/> + + + +## Reducing a value + + + +Reduces the Collection to a value by calling the `reducer` for every entry in the Collection and passing along the reduced value. + +( + reducer: (reduction: R, value: V, key: K, iter: this) => R, + initialReduction?: R, + context?: unknown + ): R`} +/> + +If `initialReduction` is not provided, the first item in the Collection will be used. + + + +Reduces the Collection in reverse (from the right side). + +( + reducer: (reduction: R, value: V, key: K, iter: this) => R, + initialReduction?: R, + context?: unknown + ): R`} +/> + +Note: Similar to `this.reverse().reduce()`, and provided for parity with `Array#reduceRight`. + + + +True if `predicate` returns true for all entries in the Collection. + + boolean, + context?: unknown + ): boolean`} +/> + + + +True if `predicate` returns true for any entry in the Collection. + + boolean, + context?: unknown + ): boolean`} +/> + + + +Joins values together as a string, inserting a separator between each. The default separator is `","`. + + + + + +Returns true if this Collection includes no values. + + + +For some lazy `Seq`, `isEmpty` might need to iterate to determine emptiness. At most one iteration will occur. + + + +Returns the size of this Collection. + + boolean, context?: unknown): number`} +/> + +Regardless of if this Collection can describe its size lazily (some Seqs cannot), this method will always return the correct size. E.g. it evaluates a lazy `Seq` if necessary. + +If `predicate` is provided, then this returns the count of entries in the Collection for which the `predicate` returns true. + + + +Returns a `Seq.Keyed` of counts, grouped by the return value of the `grouper` function. + +( + grouper: (value: V, key: K, iter: this) => G, + context?: unknown + ): Map`} +/> + +Note: This is not a lazy operation. + +## Search for value + + + +Returns the first value for which the `predicate` function returns true. + + boolean, + context?: unknown + ): V | undefined`} +/> + + x % 2 === 0)`} /> + + + +Returns the last value for which the `predicate` function returns true. + + boolean, + context?: unknown + ): V | undefined`} +/> + + x % 2 === 0)`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the first `[key, value]` entry for which the `predicate` function returns true. + + boolean, + context?: unknown + ): [K, V] | undefined`} +/> + + x % 2 === 0)`} +/> + + + +Returns the last `[key, value]` entry for which the `predicate` function returns true. + + boolean, + context?: unknown + ): [K, V] | undefined`} +/> + + x % 2 === 0)`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the first key for which the `predicate` function returns true. + + boolean, + context?: unknown + ): K | undefined`} +/> + + x % 2 === 0)`} +/> + + + +Returns the last key for which the `predicate` function returns true. + + boolean, + context?: unknown + ): K | undefined`} +/> + + x % 2 === 0)`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the key associated with the search value, or undefined. + + + + + + + +Returns the last key associated with the search value, or undefined. + + + + + + + +Returns the maximum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + + number): V | undefined`} +/> + + + +The comparator is used in the same way as Collection#sort. If it is not provided, the default comparator is `>`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `max` will operate independent of the order of input as long as the comparator is commutative. The default comparator `>` is commutative only when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `max()`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means. + +( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: (valueA: C, valueB: C) => number +): V | undefined`} +/> + + person.age)`} +/> + + + +Returns the minimum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + + number): V | undefined`} +/> + + + +The comparator is used in the same way as Collection#sort. If it is not provided, the default comparator is `<`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `min` will operate independent of the order of input as long as the comparator is commutative. The default comparator `<` is commutative only when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `min()`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means. + +( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: (valueA: C, valueB: C) => number + ): V | undefined`} +/> + + person.age)`} +/> + +## Comparison + + + +True if `iter` includes every value in this Collection. + +): boolean`} /> + + + +True if this Collection includes every value in `iter`. + +): boolean`} /> diff --git a/website/docs/OrderedCollection.mdx b/website/docs/OrderedCollection.mdx new file mode 100644 index 0000000000..7586e771f4 --- /dev/null +++ b/website/docs/OrderedCollection.mdx @@ -0,0 +1,22 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# OrderedCollection + +Interface representing all oredered collections. +This includes `List`, `Stack`, `Map`, `OrderedMap`, `Set`, and `OrderedSet`. +return of `isOrdered()` return true in that case. + +## Members + + + +Shallowly converts this collection to an Array. + + + + + +Returns an iterator that iterates over the values in this collection. + + diff --git a/website/docs/OrderedSet.mdx b/website/docs/OrderedSet.mdx new file mode 100644 index 0000000000..f4647aba8c --- /dev/null +++ b/website/docs/OrderedSet.mdx @@ -0,0 +1,38 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# OrderedSet + +A type of [`Set`](../Set/) that has the additional guarantee that the iteration order of values will be the order in which they were added. + + extends Set, OrderedCollection`} /> + +The iteration behavior of OrderedSet is the same as native ES6 Set. + +Note that `OrderedSet` are more expensive than non-ordered Set and may consume more memory. `OrderedSet#add` is amortized `O(log32 N)`, but not stable. + +## Similar API with `Set` + +`OrderedSet` has the exact same API as [`Set`](../Set/). The only new method is OrderedSet.isOrderedSet(maybeOrderedSet) to check if a value is an `OrderedSet`. + +## Construction + + + +Create a new immutable OrderedSet containing the values of the provided collection-like. + +(collection?: Iterable | ArrayLike): OrderedSet`} +/> + +Note: `OrderedSet` is a factory function and not a class, and does not use the `new` keyword during construction. + + + +## Static Methods + + + +True if the provided value is an OrderedSet. + + diff --git a/website/docs/OrdererMap.mdx b/website/docs/OrdererMap.mdx new file mode 100644 index 0000000000..6caeefe9d7 --- /dev/null +++ b/website/docs/OrdererMap.mdx @@ -0,0 +1,49 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# OrderedMap + +A type of [`Map`](../Map/) that maintains the order of iteration according to when entries were set. + + extends Map`} /> + +The iteration behavior of OrderedMap is the same as native ES6 Map and JavaScript Object. + +Note that `OrderedMap` are more expensive than non-ordered Map and may consume more memory. OrderedMap#set is amortized `O(log32 N)`, but not stable. + +Let's look at the following example to see the difference between `Map` and `OrderedMap`: + + + +The `b` key is re-located on the second position. + + + +The `b` key is still on the third position. + +## Similar API with `Map` + +`OrderedMap` has the exact same API as [`Map`](../Map/). The only new method is OrderedMap.isOrderedMap(maybeOrderedMap) to check if a value is an `OrderedMap`. + +## Construction + + + +Creates a new Immutable OrderedMap. + +(collection?: Iterable<[K, V]>): OrderedMap +OrderedMap(obj: { [key: PropertyKey]: V }): OrderedMap`} +/> + +Note: `OrderedMap` is a factory function and not a class, and does not use the `new` keyword during construction. + + + +## Static Methods + + + +True if the provided value is an OrderedMap. + + diff --git a/website/docs/Range().mdx b/website/docs/Range().mdx new file mode 100644 index 0000000000..814fb7b3bc --- /dev/null +++ b/website/docs/Range().mdx @@ -0,0 +1,17 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# Range() + +Returns a Seq.Indexed of numbers from `start` (inclusive) to `end` (exclusive), by `step`, where start defaults to 0, `step` to 1, and `end` to infinity. When `start` is equal to `end`, returns empty range. + +`} +/> + +Note: `Range` is a factory function and not a class, and does not use the `new` keyword during construction. + + + + + diff --git a/website/docs/Record.Factory.mdx b/website/docs/Record.Factory.mdx new file mode 100644 index 0000000000..59c7e84fb4 --- /dev/null +++ b/website/docs/Record.Factory.mdx @@ -0,0 +1,46 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# Record.Factory + +A Record.Factory is created by the `Record()` function. Record instances +are created by passing it some of the accepted values for that Recordtype: + + + +Note that Record Factories return `Record & Readonly`, +this allows use of both the Record instance API, and direct property +access on the resulting instances: + + + +## Construction + + + +( + values?: Partial + ): RecordOf`} +/> + +## Members + + + +The name provided to `Record(values, name)` can be accessed with `displayName`. + + diff --git a/website/docs/Record.mdx b/website/docs/Record.mdx new file mode 100644 index 0000000000..82f123422b --- /dev/null +++ b/website/docs/Record.mdx @@ -0,0 +1,303 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# Record + +A record is similar to a JS object, but enforces a specific set of allowed string keys, and has default values. + +The `Record()` function produces new Record Factories, which when called create Record instances. + + + +Records always have a value for the keys they define. `remove`ing a key from a record simply resets it to the default value for that key. + +```js +myRecord.get('a'); // 1 +myRecord.get('b'); // 3 +const myRecordWithoutB = myRecord.remove('b'); +myRecordWithoutB.get('b'); // 2 +``` + +Values provided to the constructor not found in the Record type will be ignored. For example, in this case, ABRecord is provided a key "x" even though only "a" and "b" have been defined. The value for "x" will be ignored for this record. + +```js +const myRecord = ABRecord({ b: 3, x: 10 }); +myRecord.get('x'); // undefined +``` + +Because Records have a known set of string keys, property get access works as expected, however property sets will throw an Error. + +Note: IE8 does not support property access. Only use `get()` when supporting IE8. + +```js +myRecord.b; // 3 +myRecord.b = 5; // throws Error +``` + +Record Types can be extended as well, allowing for custom methods on your Record. This is not a common pattern in functional environments, but is in many JS programs. + +However Record Types are more restricted than typical JavaScript classes. They do not use a class constructor, which also means they cannot use class properties (since those are technically part of a constructor). + +While Record Types can be syntactically created with the JavaScript `class` form, the resulting Record function is actually a factory function, not a class constructor. Even though Record Types are not classes, JavaScript currently requires the use of `new` when creating new Record instances if they are defined as a `class`. + + + +**Typing Records:** + +Immutable.js exports two types designed to make it easier to use Records with typed code, `RecordOf` and `RecordFactory`. + +When defining a new kind of Record factory function, use a type that describes the values the record contains along with `RecordFactory`. To type instances of the Record (which the factory function returns), use `RecordOf`. + +Typically, new Record definitions will export both the Record factory function as well as the Record instance type for use in other code. + +```ts +import type { RecordFactory, RecordOf } from 'immutable'; + +// Use RecordFactory for defining new Record factory functions. +type Point3DProps = { x: number, y: number, z: number }; + +const defaultValues: Point3DProps = { x: 0, y: 0, z: 0 }; +const makePoint3D: RecordFactory = Record(defaultValues); +export makePoint3D; + +// Use RecordOf for defining new instances of that Record. +export type Point3D = RecordOf; +const some3DPoint: Point3D = makePoint3D({ x: 10, y: 20, z: 30 }); +``` + +**Typing Record Subclasses:** + +Records can be subclassed as a means to add additional methods to Record instances. This is generally discouraged in favor of a more functional API, since Subclasses have some minor overhead. However the ability to create a rich API on Record types can be quite valuable. + +When typing Subclasses, do not use `RecordFactory`, instead apply the props type when subclassing: + +```ts +type PersonProps = { name: string; age: number }; + +const defaultValues: PersonProps = { name: 'Aristotle', age: 2400 }; +const PersonRecord = Record(defaultValues); + +class Person extends PersonRecord { + getName(): string { + return this.get('name'); + } + + setName(name: string): this { + return this.set('name', name); + } +} +``` + +**Choosing Records vs plain JavaScript objects** + +Records offer a persistently immutable alternative to plain JavaScript objects, however they're not required to be used within Immutable.js collections. In fact, the deep-access and deep-updating functions like `getIn()` and `setIn()` work with plain JavaScript Objects as well. + +Deciding to use Records or Objects in your application should be informed by the tradeoffs and relative benefits of each: + +- _Runtime immutability_: plain JS objects may be carefully treated as immutable, however Record instances will _throw_ if attempted to be mutated directly. Records provide this additional guarantee, however at some marginal runtime cost. While JS objects are mutable by nature, the use of type-checking tools like TypeScript or [Flow](https://medium.com/@gcanti/immutability-with-flow-faa050a1aef4) can help gain confidence in code written to favor immutability. + +- _Value equality_: Records use value equality when compared with `is()` or `record.equals()`. That is, two Records with the same keys and values are equal. Plain objects use _reference equality_. Two objects with the same keys and values are not equal since they are different objects. This is important to consider when using objects as keys in a `Map` or + values in a `Set`, which use equality when retrieving values. + +- _API methods_: Records have a full featured API, with methods like `.getIn()`, and `.equals()`. These can make working with these values easier, but comes at the cost of not allowing keys with those names. + +- _Default values_: Records provide default values for every key, which can be useful when constructing Records with often unchanging values. However default values can make using Flow and TypeScript more laborious. + +- _Serialization_: Records use a custom internal representation to efficiently store and update their values. Converting to and from this form isn't free. If converting Records to plain objects is common, consider sticking with plain objects to begin with. + +## Construction + + + +(defaultValues: TProps, name?: string): Record.Factory`} +/> + +## Static methods + + + + + + + + + +## Reading values + + + + + + + +(key: K): TProps[K] +get(key: string, notSetValue: T): T`} +/> + +## Reading deep values + + + + + + + +(key: K): TProps[K] +getIn(key: string, notSetValue: T): T`} +/> + +## Value equality + + + + + + + + + +## Persistent changes + + + +(key: K, value: TProps[K]): this`} /> + + + +(key: K, updater: (value: TProps[K]) => TProps[K]): this;`} +/> + + + +>>): this`} /> + + + +>): this;`} /> + + + + unknown, + ...collections: Array> + ): this;`} +/> + + + + unknown, + ...collections: Array> + ): this;`} +/> + + + +Returns a new instance of this Record type with the value for the specific key set to its default value. + +(key: K): this;`} /> + + + +Returns a new instance of this Record type with all values set to their default values. + + + +## Deep persistent changes + + + + + + + + unknown): this;`} +/> + + + +>): this;`} /> + + + +>): this;`} +/> + + + +): this;`} /> + +## Conversion to JavaScript types + + + +Deeply converts this Record to equivalent native JavaScript Object. + +Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead. + +;`} /> + + + +Shallowly converts this Record to equivalent native JavaScript Object. + + + + + +Shallowly converts this Record to equivalent JavaScript Object. + + + +## Transient changes + + + +Note: Not all methods can be used on a mutable collection or within `withMutations`! Only `set` may be used mutatively. + +See Map#withMutations + + unknown): this;`} /> + + + +See Map#asMutable + + + + + +See Map#wasAltered + + + + + +See Map#asImmutable + + + +## Sequence algorithms + + + +;`} /> diff --git a/website/docs/Repeat().mdx b/website/docs/Repeat().mdx new file mode 100644 index 0000000000..f70c5ed8cd --- /dev/null +++ b/website/docs/Repeat().mdx @@ -0,0 +1,16 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# Repeat() + +Returns a Seq.Indexed of `value` repeated `times` times. When `times` is not defined, returns an infinite `Seq` of `value`. + +(value: T, times?: number): Seq.Indexed`} /> + +Note: `Repeat` is a factory function and not a class, and does not use the `new` keyword during construction. + + + diff --git a/website/docs/Seq.Indexed.mdx b/website/docs/Seq.Indexed.mdx new file mode 100644 index 0000000000..74b258eb45 --- /dev/null +++ b/website/docs/Seq.Indexed.mdx @@ -0,0 +1,789 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# Seq.Indexed + + which represents an ordered indexed list of values. + + + +## Construction + + + +Always returns Seq.Indexed, discarding associated keys and supplying incrementing indices. + + + +Note: `Seq.Indexed` is a conversion function and not a class, and does not use the new keyword during construction. + +## Static methods + + + +Provides an Seq.Indexed of the values provided. + + + +## Reading values + + + +Returns the value associated with the provided index, or notSetValue if the index is beyond the bounds of the Collection. + +(key: number, notSetValue: NSV): T | NSV; +get(key: number): T | undefined;`} +/> + +`index` may be a negative number, which indexes back from the end of the Collection. `s.get(-1)` gets the last item in the Collection. + + + +True if a key exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + +True if a value exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + +In case the `Collection` is not empty returns the first element of the `Collection`. In case the `Collection` is empty returns the optional default value if provided, if no default value is provided returns undefined. + +(notSetValue: NSV): T | NSV; +first(): T | undefined;`} +/> + + + +In case the `Collection` is not empty returns the last element of the `Collection`. In case the `Collection` is empty returns the optional default value if provided, if no default value is provided returns undefined. + +(notSetValue: NSV): T | NSV; +last(): T | undefined;`} +/> + +## Conversion to JavaScript types + + + +Deeply converts this Indexed Seq to equivalent native JavaScript Array. + +>;`} /> + + + +Shallowly converts this Indexed Seq to equivalent native JavaScript Array. + +;`} /> + + + +Shallowly converts this collection to an Array. + +;`} /> + + + +Shallowly converts this Collection to an Object. + + + +Converts keys to Strings. + +## Conversion to Seq + + + +Returns Seq.Indexed. + +;`} /> + + + +If this is a collection of [key, value] entry tuples, it will return a Seq.Keyed of those entries. + +;`} /> + + + +Returns a Seq.Keyed with the same key-value entries as this Collection.Indexed. + +;`} /> + + + +Returns a Seq.Indexed with the same values as this Collection.Indexed. + +;`} /> + + + +Returns a Seq.Set with the same values as this Collection.Indexed. + +;`} /> + +## Combination + + + +Returns a Collection of the same type with `separator` between each item in this Collection. + + + + + +Returns a Collection of the same type with the provided `collections` interleaved into this collection. + +>): this;`} +/> + +The resulting Collection includes the first item from each, then the second from each, etc. + + + +The shortest Collection stops interleave. + + + +Since `interleave()` re-indexes values, it produces a complete copy, which has `O(N)` complexity. + +Note: `interleave` _cannot_ be used in `withMutations`. + + + +Splice returns a new indexed Collection by replacing a region of this Collection with new values. If values are not provided, it only skips the region to be removed. + +): this;`} +/> + +`index` may be a negative number, which indexes back from the end of the Collection. `s.splice(-2)` splices after the second to last item. + + + +Since `splice()` re-indexes values, it produces a complete copy, which has `O(N)` complexity. + +Note: `splice` _cannot_ be used in `withMutations`. + + + +Returns a Collection of the same type "zipped" with the provided collections. + +(other: Collection): Seq.Indexed<[T, U]>;`} +/> +(other: Collection, other2: Collection): Seq.Indexed<[T, U, V]>;`} +/> +>): Seq.Indexed;`} +/> + +Like `zipWith`, but using the default `zipper`: creating an `Array`. + + + + + +Returns a Collection "zipped" with the provided collections. Unlike `zip`, `zipAll` continues zipping until the longest collection is exhausted. Missing values from shorter collections are filled with `undefined`. + +(other: Collection): Seq.Indexed<[T, U]>;`} +/> +(other: Collection, other2: Collection): Seq.Indexed<[T, U, V]>;`} +/> +>): Seq.Indexed;`} +/> + + + + + +Returns a Collection of the same type "zipped" with the provided collections by using a custom `zipper` function. + +(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection): Collection.Indexed;`} +/> +(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection, thirdCollection: Collection): Seq.Indexed;`} +/> +(zipper: (...values: Array) => Z, ...collections: Array>): Seq.Indexed;`} +/> + + a + b, b);`} +/> + + + +Flattens nested Collections. + +;`} /> +;`} /> + +Will deeply flatten the Collection by default, returning a Collection of the same type, but a `depth` can be provided in the form of a number or boolean (where true means to shallowly flatten one level). A depth of 0 (or shallow: false) will deeply flatten. + +Flattens only others Collection, not Arrays or Objects. + +Note: `flatten(true)` operates on `Collection>` and returns `Collection` + +## Search for value + + + +Returns the first index at which a given value can be found in the Collection, or -1 if it is not present. + + + + + +Returns the last index at which a given value can be found in the Collection, or -1 if it is not present. + + + + + +Returns the first index in the Collection where a value satisfies the provided predicate function. Otherwise -1 is returned. + + boolean, context?: unknown): number;`} +/> + + + +Returns the last index in the Collection where a value satisfies the provided predicate function. Otherwise -1 is returned. + + boolean, context?: unknown): number;`} +/> + + + +Returns the first value for which the `predicate` returns true. + + boolean, context?: unknown): T | undefined;`} +/> + + + +Returns the last value for which the `predicate` returns true. + + boolean, context?: unknown): T | undefined;`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the first [key, value] entry for which the `predicate` returns true. + + boolean, context?: unknown): [number, T] | undefined;`} +/> + + + +Returns the last [key, value] entry for which the `predicate` returns true. + + boolean, context?: unknown): [number, T] | undefined;`} +/> + + + +Returns the key for which the `predicate` returns true. + + boolean, context?: unknown): number | undefined;`} +/> + + + +Returns the last key for which the `predicate` returns true. + + boolean, context?: unknown): number | undefined;`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the key associated with the search value, or undefined. + + + + + +Returns the last key associated with the search value, or undefined. + + + + + +Returns the maximum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): T | undefined;`} /> + +The `comparator` is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `>`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `max` will operate independent of the order of input as long as the comparator is commutative. The default comparator `>` is commutative _only_ when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `max`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means. + +(comparatorValueMapper: (value: T, key: number, iter: this) => C, comparator?: Comparator): T | undefined;`} +/> + + i.avgHit);`} +/> + + + +Returns the minimum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): T | undefined;`} /> + +The `comparator` is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `<`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `min` will operate independent of the order of input as long as the comparator is commutative. The default comparator `<` is commutative _only_ when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `min`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means. + +(comparatorValueMapper: (value: T, key: number, iter: this) => C, comparator?: Comparator): T | undefined;`} +/> + + i.avgHit);`} +/> + +## Sequence algorithms + + + +Returns a new Seq with other collections concatenated to this one. + +(...valuesOrCollections: Array | C>): Seq.Indexed;`} +/> + + + +Returns a new Seq.Indexed with values passed through a `mapper` function. + +(mapper: (value: T, key: number, iter: this) => M, context?: unknown): Seq.Indexed;`} +/> + + 10 * x)`} /> + +Note: `map()` always returns a new instance, even if it produced the same value at every step. + + + +Flat-maps the Seq, returning a Seq of the same type. + +(mapper: (value: T, key: number, iter: this) => Iterable, context?: unknown): Seq.Indexed;`} +/> + +Similar to `seq.map(...).flatten(true)`. + + + +Returns a new Collection with only the values for which the `predicate` function returns true. + +(predicate: (value: T, index: number, iter: this) => value is F, context?: unknown): Seq.Indexed;`} +/> + unknown, context?: unknown): this;`} +/> + +Note: `filter()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new indexed Seq with the values for which the `predicate` function returns false and another for which is returns true. + +(predicate: (this: C, value: T, index: number, iter: this) => value is F, context?: C): [Seq.Indexed, Seq.Indexed];`} +/> +(predicate: (this: C, value: T, index: number, iter: this) => unknown, context?: C): [this, this];`} +/> + + + +;`} /> + + + +Returns a new Collection with only the values for which the `predicate` function returns false. + + unknown, context?: unknown): this;`} +/> + + x > 2)`} /> + +Note: `filterNot()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new Collection with the values in reverse order. + + + + + +Returns a new sorted Collection, sorted by the natural order of the values. + +;`} /> + +If a `comparator` is not provided, a default comparator uses `<` and `>`. + +Note: `sort()` always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Returns a new sorted Collection, sorted by the provided `comparator` function. + +(comparator: (value: T) => R): Collection.Indexed;`} +/> + +Note: `sortBy()` always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Groups the values by the return value of the `mapper` function, and returns a Collection.Indexed of Arrays of grouped values. + +(mapper: (value: T) => K): Collection.Indexed>;`} +/> + +## Value equality + + + +Returns true if the Collections are of the same size and all values are equal. + + + + + +Returns a hash code for this Collection. + + + +## Reading deep values + + + +Returns the value at the given nested path, or notSetValue if any key in the path is not present. + +(path: Array, notSetValue: NSV): T | NSV;`} +/> +): T | undefined;`} /> + + + +Returns a boolean if the given nested path exists. + +): boolean;`} /> + +## Persistent changes + + + +Returns a new Collection.Indexed with the value at the given index updated to the new value. + + T): this;`} /> + +## Conversion to Collections + + + +Converts this Collection.Indexed to a Map. The first value of each entry is used as the key. + +;`} /> + + + +Converts this Collection.Indexed to an OrderedMap. The first value of each entry is used as the key. + +;`} /> + + + +Converts this Collection.Indexed to a Set. + +;`} /> + + + +Converts this Collection.Indexed to an OrderedSet. + +;`} /> + + + +Converts this Collection.Indexed to a List. + +;`} /> + + + +Converts this Collection.Indexed to a Stack. + +;`} /> + +## Iterators + + + +Returns an Iterable of the keys in the Collection. + +;`} /> + + + +Returns an Iterable of the values in the Collection. + +;`} /> + + + +Returns an Iterable of the [key, value] entries in the Collection. + +;`} /> + +## Collections (Seq) + + + +Returns a Seq of the keys in the Collection. + +;`} /> + + + +Returns a Seq of the values in the Collection. + +;`} /> + + + +Returns a Seq of the [key, value] entries in the Collection. + +;`} /> + +## Side effects + + + +Calls the provided function for each value in the Collection. Returns the Collection. + + void, context?: unknown): this;`} +/> + +## Creating subsets + + + +Returns a new Collection.Indexed with the values between the given start and end indices. + + + + + +Returns a new Collection.Indexed with all but the first value. + + + + + +Returns a new Collection.Indexed with all but the last value. + + + + + +Returns a new Collection.Indexed with the first `n` values removed. + + + + + +Returns a new Collection.Indexed with the last `n` values removed. + + + + + +Returns a new Collection.Indexed with values skipped while the `predicate` function returns true. + + boolean, context?: unknown): this;`} +/> + + + +Returns a new Collection.Indexed with values skipped until the `predicate` function returns true. + + boolean, context?: unknown): this;`} +/> + + + +Returns a new Collection.Indexed with the first `n` values. + + + + + +Returns a new Collection.Indexed with the last `n` values. + + + + + +Returns a new Collection.Indexed with values taken while the `predicate` function returns true. + + boolean, context?: unknown): this;`} +/> + + + +Returns a new Collection.Indexed with values taken until the `predicate` function returns true. + + boolean, context?: unknown): this;`} +/> + +## Reducing a value + + + +Returns the accumulated result of calling the provided reducer function for each value in the Collection, from left to right. + +(reducer: (previousValue: R | T, currentValue: T, index: number, iter: this) => R, initialValue?: R): R;`} +/> + + + +Returns the accumulated result of calling the provided reducer function for each value in the Collection, from right to left. + +(reducer: (previousValue: R | T, currentValue: T, index: number, iter: this) => R, initialValue?: R): R;`} +/> + + + +Returns true if the `predicate` function returns a truthy value for every value in the Collection. + + boolean, context?: unknown): boolean;`} +/> + + + +Returns true if the `predicate` function returns a truthy value for any value in the Collection. + + boolean, context?: unknown): boolean;`} +/> + + + +Returns the concatenated string result of calling `String(value)` on every value in the Collection, separated by the given separator string. + + + + + +Returns true if the Collection has no values. + + + + + +Returns the number of values in the Collection. + + + + + +Returns a new Collection.Indexed with the number of times each value occurs in the Collection. + +;`} /> + +## Comparison + + + +Returns true if this Collection.Indexed is a subset of the other Collection (i.e. all values in this Collection.Indexed are also in the other). + + + + + +Returns true if this Collection.Indexed is a superset of the other Collection (i.e. this Collection.Indexed contains all values of the other). diff --git a/website/docs/Seq.Keyed.mdx b/website/docs/Seq.Keyed.mdx new file mode 100644 index 0000000000..c81a376324 --- /dev/null +++ b/website/docs/Seq.Keyed.mdx @@ -0,0 +1,889 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# Seq.Keyed + + which represents key-value pairs. + + + +## Construction + + + +Always returns a `Seq.Keyed`, if input is not keyed, expects an +collection of [K, V] tuples. + +(collection?: Iterable<[K, V]>): Seq.Keyed +Seq.Keyed(obj: {[key: string]: V}): Seq.Keyed`} +/> + +Note: `Seq.Keyed` is a conversion function and not a class, and does not +use the `new` keyword during construction. + +## Conversion to JavaScript types + + + +Deeply converts this Keyed Seq to equivalent native JavaScript Object. + + };`} /> +Converts keys to Strings. + + + +Shallowly converts this Keyed Seq to equivalent native JavaScript Object. + + +Converts keys to Strings. + + + +Shallowly converts this collection to an Array. + +;`} /> + + + +Shallowly converts this Collection to an Object. + + + +Converts keys to Strings. + +## Conversion to Seq + + + +Returns itself. + + + +Returns a Seq.Keyed from this Collection where indices are treated as keys. + +;`} /> + +This is useful if you want to operate on an Collection.Indexed and preserve the [index, value] pairs. + +The returned Seq will have identical iteration order as this Collection. + +```js +const indexedSeq = Seq(['A', 'B', 'C']); +// Seq [ "A", "B", "C" ] +indexedSeq.filter((v) => v === 'B'); +// Seq [ "B" ] +const keyedSeq = indexedSeq.toKeyedSeq(); +// Seq { 0: "A", 1: "B", 2: "C" } +keyedSeq.filter((v) => v === 'B'); +``` + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +;`} /> + + + +Returns a Seq.Set of the values of this Collection, discarding keys. + +;`} /> + +## Sequence functions + + + +Returns a new Collection.Keyed of the same type where the keys and values have been flipped. + + + +```js +const { Map } = require('immutable'); +Map({ a: 'z', b: 'y' }).flip(); +// Map { "z": "a", "y": "b" } +``` + + + +Returns a new Seq with other collections concatenated to this one. + +All entries will be present in the resulting Seq, even if they +have the same key. + +( + ...collections: Array> + ): Seq.Keyed; + concat( + ...collections: Array<{ [key: string]: C }> + ): Seq.Keyed;`} +/> + + + +Returns a new Seq.Keyed with values passed through a `mapper` function. + +(mapper: (value: V, key: K, iter: this) => M, context?: unknown): Seq.Keyed;`} +/> + +```js +const { Seq } = require('immutable'); +Seq.Keyed({ a: 1, b: 2 }).map((x) => 10 * x); +// Seq { "a": 10, "b": 20 } +``` + +Note: `map()` always returns a new instance, even if it produced the same value at every step. + + + +Returns a new Collection.Keyed of the same type with keys passed through a `mapper` function. + +(mapper: (key: K, value: V, iter: this) => M, context?: unknown): Seq.Keyed;`} +/> + +```js +const { Map } = require('immutable'); +Map({ a: 1, b: 2 }).mapKeys((x) => x.toUpperCase()); +// Map { "A": 1, "B": 2 } +``` + +Note: `mapKeys()` always returns a new instance, even if it produced the same key at every step. + + + +Returns a new Collection.Keyed of the same type with entries ([key, value] tuples) passed through a `mapper` function. + +(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM] | undefined, context?: unknown): Seq.Keyed;`} +/> + +```js +const { Map } = require('immutable'); +Map({ a: 1, b: 2 }).mapEntries(([k, v]) => [k.toUpperCase(), v * 2]); +// Map { "A": 2, "B": 4 } +``` + +Note: `mapEntries()` always returns a new instance, even if it produced the same entry at every step. +If the mapper function returns `undefined`, then the entry will be filtered. + + + +Flat-maps the Seq, returning a Seq of the same type. + +(mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, context?: unknown): Seq.Keyed;`} +/> + +Similar to `seq.map(...).flatten(true)`. + + + +Returns a new Seq with only the entries for which the `predicate` function returns true. + +(predicate: (value: V, key: K, iter: this) => value is F, context?: unknown): Seq.Keyed;`} +/> + unknown, context?: unknown): this;`} +/> + +Note: `filter()` always returns a new instance, even if it results in not filtering out any values. + + + +(predicate: (this: C, value: V, key: K, iter: this) => value is F, context?: C): [Seq.Keyed, Seq.Keyed];`} +/> +(predicate: (this: C, value: V, key: K, iter: this) => unknown, context?: C): [this, this];`} +/> + +Returns a new keyed Seq with the values for which the `predicate` function returns false and another for which is returns true. + + + +;`} /> + +Yields [key, value] pairs. + +## Value equality + + + +Returns true if this and the other Collection have value equality, as defined by `Immutable.is()`. + + + +Note: this is equivalent to `Immutable.is(this, other)`, but provided to allow for chained expressions. + + + +Computes and returns the hashed identity for this Collection. + + + +The `hashCode` of a Collection is used to determine potential equality, and is used when adding this to a `Set` or as a key in a `Map`, enabling lookup via a different instance. + +```js +const a = List([1, 2, 3]); +const b = List([1, 2, 3]); +assert.notStrictEqual(a, b); // different instances +const set = Set([a]); +assert.equal(set.has(b), true); +``` + +If two values have the same `hashCode`, they are [not guaranteed to be equal][Hash Collision]. If two values have different `hashCode`s, they must not be equal. + +[Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) + +## Reading values + + + +Returns the value associated with the provided key, or notSetValue if the Collection does not contain this key. + +(key: K, notSetValue: NSV): V | NSV;`} /> + + +Note: it is possible a key may be associated with an `undefined` value, so if `notSetValue` is not provided and this method returns `undefined`, that does not guarantee the key was not found. + + + +True if a key exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + +True if a value exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + +In case the `Collection` is not empty returns the first element of the `Collection`. In case the `Collection` is empty returns the optional default value if provided, if no default value is provided returns undefined. + +(notSetValue: NSV): V | NSV;`} /> + + + + +In case the `Collection` is not empty returns the last element of the `Collection`. In case the `Collection` is empty returns the optional default value if provided, if no default value is provided returns undefined. + +(notSetValue: NSV): V | NSV;`} /> + + +## Reading deep values + + + +Returns the value found by following a path of keys or indices through nested Collections. + +, notSetValue?: unknown): unknown;`} +/> + + + +Plain JavaScript Object or Arrays may be nested within an Immutable.js Collection, and getIn() can access those values as well: + + + + + +True if the result of following a path of keys or indices through nested Collections results in a set value. + +): boolean;`} /> + +## Persistent changes + + + +This can be very useful as a way to "chain" a normal function into a sequence of methods. RxJS calls this "let" and lodash calls it "thru". + +(updater: (value: this) => R): R;`} /> + +For example, to sum a Seq after mapping and filtering: + + sum + x, 0); +} + +Seq([1, 2, 3]) +.map((x) => x + 1) +.filter((x) => x % 2 === 0) +.update(sum);`} +/> + +## Conversion to Collections + + + +Converts this Collection to a Map, Throws if keys are not hashable. + +;`} /> + +Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a Map, maintaining the order of iteration. + +;`} /> + +Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a Set, discarding keys. Throws if values are not hashable. + +;`} /> + +Note: This is equivalent to Set(this), but provided to allow for chained expressions. + + + +Converts this Collection to a Set, maintaining the order of iteration and discarding keys. + +;`} /> + +Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a List, discarding keys. + +;`} /> + +This is similar to `List(collection)`, but provided to allow for chained expressions. However, when called on `Map` or other keyed collections, `collection.toList()` ignores the keys and creates a list of just the values, whereas `List(collection)` creates a list of entry tuples. + + + + + + + +Converts this Collection to a Stack, discarding keys. Throws if values are not hashable. + +;`} /> + +Note: This is equivalent to `Stack(this)`, but provided to allow for chained expressions. + +## Iterators + + + +An iterator of this `Collection`'s keys. + +;`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `keySeq` instead if you want an Immutable.js Seq. + + + +An iterator of this `Collection`'s values. + +;`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `valueSeq` instead if you want an Immutable.js Seq. + + + +An iterator of this `Collection`'s entries as `[ key, value ]` tuples. + +;`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `entrySeq` instead if you want an Immutable.js Seq. + +## Collections (Seq) + + + +Returns a new Seq.Indexed of the keys of this Collection, discarding values. + +;`} /> + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +;`} /> + + + +Returns a new Seq.Indexed of [key, value] tuples. + +;`} /> + +## Sequence algorithms + + + +Returns a new Collection of the same type with only the entries for which the `predicate` function returns false. + + boolean, context?: unknown): this;`} +/> + +```js +const { Map } = require('immutable'); +Map({ a: 1, b: 2, c: 3, d: 4 }).filterNot((x) => x % 2 === 0); +// Map { "a": 1, "c": 3 } +``` + +Note: `filterNot()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new Collection of the same type in reverse order. + + + + + +Returns a new Collection of the same type which includes the same entries, stably sorted by using a `comparator`. + +): this;`} /> + +If a `comparator` is not provided, a default comparator uses `<` and `>`. + +`comparator(valueA, valueB)`: + +- Returns `0` if the elements should not be swapped. +- Returns `-1` (or any negative number) if `valueA` comes before `valueB` +- Returns `1` (or any positive number) if `valueA` comes after `valueB` +- Alternatively, can return a value of the `PairSorting` enum type +- Is pure, i.e. it must always return the same value for the same pair of values. + +```js +const { Map } = require('immutable'); +Map({ c: 3, a: 1, b: 2 }).sort((a, b) => { + if (a < b) { + return -1; + } + if (a > b) { + return 1; + } + if (a === b) { + return 0; + } +}); +// OrderedMap { "a": 1, "b": 2, "c": 3 } +``` + +Note: `sort()` Always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Like `sort`, but also accepts a `comparatorValueMapper` which allows for sorting by more sophisticated means: + +(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): this;`} +/> + + member.name);`} +/> + +Note: `sortBy()` Always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Returns a `Map` of `Collection`, grouped by the return value of the `grouper` function. + +(grouper: (value: V, key: K, iter: this) => G, context?: unknown): Map;`} +/> + +Note: This is always an eager operation. + + x.get('v'));`} +/> + +## Side effects + + + +The `sideEffect` is executed for every entry in the Collection. + + unknown, context?: unknown): number;`} +/> + +Unlike `Array#forEach`, if any call of `sideEffect` returns `false`, the iteration will stop. Returns the number of entries iterated (including the last iteration which returned false). + +## Creating subsets + + + +Returns a new Collection of the same type representing a portion of this Collection from start up to but not including end. + + + +If begin is negative, it is offset from the end of the Collection. e.g. slice(-2) returns a Collection of the last two entries. If it is not provided the new Collection will begin at the beginning of this Collection. + +If end is negative, it is offset from the end of the Collection. e.g. slice(0, -1) returns a Collection of everything but the last entry. If it is not provided, the new Collection will continue through the end of this Collection. + +If the requested slice is equivalent to the current Collection, then it will return itself. + + + +Returns a new Collection of the same type containing all entries except the first. + + + + + +Returns a new Collection of the same type containing all entries except the last. + + + + + +Returns a new Collection of the same type which excludes the first `amount` entries from this Collection. + + + + + +Returns a new Collection of the same type which excludes the last `amount` entries from this Collection. + + + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns false. + + boolean, context?: unknown): this;`} +/> + + x.match(/g/)) +// List [ "cat", "hat", "god" ] +`} +/> + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns true. + + boolean, context?: unknown): this;`} +/> + + x.match(/hat/)) +// List [ "hat", "god" ] +`} +/> + + + +Returns a new Collection of the same type which includes the first `amount` entries from this Collection. + + + + + +Returns a new Collection of the same type which includes the last `amount` entries from this Collection. + + + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns true. + + boolean, context?: unknown): this;`} +/> + +```js +const { List } = require('immutable'); +List(['dog', 'frog', 'cat', 'hat', 'god']).takeWhile((x) => x.match(/o/)); +// List [ "dog", "frog" ] +``` + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns false. + + boolean, context?: unknown): this;`} +/> + +```js +const { List } = require('immutable'); +List(['dog', 'frog', 'cat', 'hat', 'god']).takeUntil((x) => x.match(/at/)); +// List [ "dog", "frog" ] +``` + +## Combination + + + +Flattens nested Collections. + +; +flatten(shallow?: boolean): Collection;`} +/> + +Will deeply flatten the Collection by default, returning a Collection of the same type, but a `depth` can be provided in the form of a number or boolean (where true means to shallowly flatten one level). A depth of 0 (or shallow: false) will deeply flatten. + +Flattens only other Collections, not Arrays or Objects. + +Note: `flatten(true)` operates on `Collection>` and returns `Collection`. + +## Reducing a value + + + +Reduces the Collection to a value by calling the `reducer` for every entry in the Collection and passing along the reduced value. + +If `initialReduction` is not provided, the first item in the Collection will be used. + +(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: unknown): R; +reduce(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R;`} +/> + + + +Reduces the Collection in reverse (from the right side). + +(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: unknown): R; +reduceRight(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R;`} +/> + + + +True if `predicate` returns true for all entries in the Collection. + + boolean, context?: unknown): boolean;`} +/> + + + +True if `predicate` returns true for any entry in the Collection. + + boolean, context?: unknown): boolean;`} +/> + + + +Joins values together as a string, inserting a separator between each. The default separator is `","`. + + + + + +Returns true if this Collection includes no values. + +For some lazy `Seq`, `isEmpty` might need to iterate to determine emptiness. At most one iteration will occur. + + + + + +Returns the size of this Collection. + +Regardless of if this Collection can describe its size lazily (some Seqs cannot), this method will always return the correct size. E.g. it evaluates a lazy `Seq` if necessary. + +If `predicate` is provided, then this returns the count of entries in the Collection for which the `predicate` returns true. + + boolean, context?: unknown): number;`} +/> + + + +Returns a `Seq.Keyed` of counts, grouped by the return value of the `grouper` function. + +(grouper: (value: V, key: K, iter: this) => G, context?: unknown): Map;`} +/> + +Note: This is not a lazy operation. + +## Search for value + + + +Returns the first value for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: V): V | undefined;`} +/> + + + +Returns the last value for which the `predicate` returns true. + +Note: `predicate` will be called for each entry in reverse. + + boolean, context?: unknown, notSetValue?: V): V | undefined;`} +/> + + + +Returns the first [key, value] entry for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: V): [K, V] | undefined;`} +/> + + + +Returns the last [key, value] entry for which the `predicate` returns true. + +Note: `predicate` will be called for each entry in reverse. + + boolean, context?: unknown, notSetValue?: V): [K, V] | undefined;`} +/> + + + +Returns the key for which the `predicate` returns true. + + boolean, context?: unknown): K | undefined;`} +/> + + + +Returns the last key for which the `predicate` returns true. + +Note: `predicate` will be called for each entry in reverse. + + boolean, context?: unknown): K | undefined;`} +/> + + + +Returns the key associated with the search value, or undefined. + + + + + +Returns the last key associated with the search value, or undefined. + + + + + +Returns the maximum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +The `comparator` is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `>`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `max` will operate independent of the order of input as long as the comparator is commutative. The default comparator `>` is commutative _only_ when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + +): V | undefined;`} /> + + + +Like `max`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means: + +(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: Comparator): V | undefined;`} +/> + +```js +const { List } = require('immutable'); +const l = List([ + { name: 'Bob', avgHit: 1 }, + { name: 'Max', avgHit: 3 }, + { name: 'Lili', avgHit: 2 }, +]); +l.maxBy((i) => i.avgHit); // will output { name: 'Max', avgHit: 3 +``` + + + +Returns the minimum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): V | undefined;`} /> + +The `comparator` is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `<`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `min` will operate independent of the order of input as long as the comparator is commutative. The default comparator `<` is commutative _only_ when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `min`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means: + +(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: Comparator): V | undefined;`} +/> + +```js +const { List } = require('immutable'); +const l = List([ + { name: 'Bob', avgHit: 1 }, + { name: 'Max', avgHit: 3 }, + { name: 'Lili', avgHit: 2 }, +]); +l.minBy((i) => i.avgHit); // will output { name: 'Bob', avgHit: 1 } +``` + +## Comparison + + + +True if `iter` includes every value in this Collection. + +): boolean;`} /> + + + +True if this Collection includes every value in `iter`. + +): boolean;`} /> diff --git a/website/docs/Seq.Set.mdx b/website/docs/Seq.Set.mdx new file mode 100644 index 0000000000..5f5462658d --- /dev/null +++ b/website/docs/Seq.Set.mdx @@ -0,0 +1,744 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# Seq.Set + + which represents a set of values. + + + +Because are often lazy, `Seq.Set` does not provide the same guarantee +of value uniqueness as the concrete . + +## Construction + + + +Always returns a Seq.Set, discarding associated indices or keys. + + + +Note: `Seq.Set` is a conversion function and not a class, and does not use the new keyword during construction. + +## Static methods + + + +Returns a Seq.Set of the provided values. + + + +## Members + + + +## Force evaluation + + +## Persistent changes + + +## Sequence algorithms + + + +Returns a new `Seq.Set` with values passed through a `mapper` function. + +(mapper: (value: T, key: T, iter: this) => M, context?: unknown): Set`} +/> + + 10 * x)`} /> + +Note: `map()` always returns a new instance, even if it produced the same value at every step. + + + +Flat-maps the Seq, returning a Seq of the same type. + +Similar to `set.map(...).flatten(true)`. + +(mapper: (value: T, key: T, iter: this) => Iterable, context?: unknown): Seq.Set`} +/> + + + +Returns a new Set with only the values for which the `predicate` function returns true. + +Note: `filter()` always returns a new instance, even if it results in not filtering out any values. + + boolean, context?: unknown): Seq.Set`} +/> + + + +Returns a new Set with only the values for which the `predicate` function returns false. + + boolean, context?: unknown): Seq.Set`} +/> + +Note: `filterNot()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new Set with the values for which the `predicate` function returns false and another for which is returns true. + + boolean, context?: C): [Seq.Set, Seq.Set]`} +/> + + + +Returns a new Collection of the same type which includes the same entries, stably sorted by using a `comparator`. + +): OrderedSet`} /> + +If a `comparator` is not provided, a default comparator uses `<` and `>`. + +`comparator(valueA, valueB)`: + +- Returns `0` if the elements should not be swapped. +- Returns `-1` (or any negative number) if `valueA` comes before `valueB` +- Returns `1` (or any positive number) if `valueA` comes after `valueB` +- Alternatively, can return a value of the `PairSorting` enum type +- Is pure, i.e. it must always return the same value for the same pair of values. + +Note: `sort()` Always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Like `sort`, but also accepts a `comparatorValueMapper` which allows for sorting by more sophisticated means: + +(comparatorValueMapper: (value: T, key: T, iter: this) => C, comparator?: Comparator): this & OrderedSet`} +/> + + person.age)`} +/> + +Note: `sortBy()` Always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Returns a new Set with the order of the values reversed. + +`} /> + + + +Returns a `Map` of `Set`, grouped by the return value of the `grouper` function. + +(grouper: (value: T, key: T, iter: this) => G, context?: unknown): Map>`} +/> + +Note: This is not a lazy operation. + +## Conversion to JavaScript types + + + +Deeply converts this Set Seq to equivalent native JavaScript Array. + +>`} /> + + + +Shallowly converts this Set Seq to equivalent native JavaScript Array. + +`} /> + + + +Shallowly converts this collection to an Array. + +`} /> + + + +Shallowly converts this Collection to an Object. + + + +Converts keys to Strings. + +## Conversion to Seq + + + +Returns itself. + +`} /> + + + +Returns a Seq.Keyed from this Collection where indices are treated as keys. + +This is useful if you want to operate on a Collection and preserve the [value, value] pairs. + +`} /> + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +`} /> + + + +Returns a Seq.Set of the values of this Collection, discarding keys. + +`} /> +## Value equality + + + +True if this and the other Collection have value equality, as defined by `Immutable.is()`. + + + +Note: This is equivalent to `Immutable.is(this, other)`, but provided to allow for chained expressions. + + + +Computes and returns the hashed identity for this Collection. + +The `hashCode` of a Collection is used to determine potential equality, and is used when adding this to a `Set` or as a key in a `Map`, enabling lookup via a different instance. + + + + + +If two values have the same `hashCode`, they are [not guaranteed to be equal][Hash Collision]. If two values have different `hashCode`s, they must not be equal. + +[Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) + +## Reading values + + + +Returns the value associated with the provided key, or notSetValue if the Collection does not contain this key. + +Note: it is possible a key may be associated with an `undefined` value, so if `notSetValue` is not provided and this method returns `undefined`, that does not guarantee the key was not found. + +(key: T, notSetValue: NSV): T | NSV +get(key: T): T | undefined`} +/> + + + +True if a key exists within this Collection, using `Immutable.is` to determine equality. + + + + + +True if a value exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + +Returns the first value in this Collection. + +(notSetValue: NSV): T | NSV +first(): T | undefined`} +/> + + + +Returns the last value in this Collection. + +(notSetValue: NSV): T | NSV +last(): T | undefined`} +/> + +## Reading deep values + + + +Returns the value found by following a path of keys or indices through nested Collections. + +, notSetValue?: unknown): unknown`} +/> + + + +Plain JavaScript Object or Arrays may be nested within an Immutable.js Collection, and getIn() can access those values as well: + + + + + +True if the result of following a path of keys or indices through nested Collections results in a set value. + +): boolean`} /> + +## Conversion to Collections + + + +Converts this Collection to a Map, Throws if keys are not hashable. + +`} /> + +Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a Map, maintaining the order of iteration. + +`} /> + +Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Returns itself. + +`} /> + + + +Converts this Collection to a Set, maintaining the order of iteration. + +`} /> + +Note: This is equivalent to `OrderedSet(this)`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a List. + +`} /> + + + +Converts this Collection to a Stack, discarding keys. Throws if values are not hashable. + +`} /> + +Note: This is equivalent to `Stack(this)`, but provided to allow for chained expressions. + +## Iterators + + + +An iterator of this `Set`'s keys. + +`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `keySeq` instead, if this is what you want. + + + +An iterator of this `Set`'s values. + +`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `valueSeq` instead, if this is what you want. + + + +An iterator of this `Set`'s entries as `[value, value]` tuples. + +`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `entrySeq` instead, if this is what you want. + +## Collections (Seq) + + + +Returns a new Seq.Indexed of the keys of this Collection, discarding values. + +`} /> + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +`} /> + + + +Returns a new Seq.Indexed of [value, value] tuples. + +`} /> + +## Side effects + + + +The `sideEffect` is executed for every entry in the Collection. + + unknown, context?: unknown): number`} +/> + +Unlike `Array#forEach`, if any call of `sideEffect` returns `false`, the iteration will stop. Returns the number of entries iterated (including the last iteration which returned false). + +## Creating subsets + + + +Returns a new Set of the same type representing a portion of this Set from start up to but not including end. + +`} /> + +If begin is negative, it is offset from the end of the Collection. e.g. `slice(-2)` returns a Collection of the last two entries. If it is not provided the new Collection will begin at the beginning of this Collection. + +If end is negative, it is offset from the end of the Collection. e.g. `slice(0, -1)` returns a Collection of everything but the last entry. If it is not provided, the new Collection will continue through the end of this Collection. + +If the requested slice is equivalent to the current Collection, then it will return itself. + + + +Returns a new Collection of the same type containing all entries except the first. + +`} /> + + + +Returns a new Collection of the same type containing all entries except the last. + +`} /> + + + +Returns a new Collection of the same type which excludes the first `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which excludes the last `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns false. + + boolean, context?: unknown): Set`} +/> + + x.match(/g/))`} +/> + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns true. + + boolean, context?: unknown): Set`} +/> + + x.match(/hat/))`} +/> + + + +Returns a new Collection of the same type which includes the first `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which includes the last `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns true. + + boolean, context?: unknown): Set`} +/> + + x.match(/o/))`} +/> + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns false. + + boolean, context?: unknown): Set`} +/> + + x.match(/at/))`} +/> + +## Combination + + + +Returns a new Seq with other collections concatenated to this one. + +(...valuesOrCollections: Array | C>): Seq.Set`} +/> + + + +Flattens nested Collections. + +Will deeply flatten the Collection by default, returning a Collection of the same type, but a `depth` can be provided in the form of a number or boolean (where true means to shallowly flatten one level). A depth of 0 (or shallow: false) will deeply flatten. + +Flattens only others Collection, not Arrays or Objects. + + + + + +Flat-maps the Set, returning a new Set. + +Similar to `set.map(...).flatten(true)`. + +(mapper: (value: T, key: T, iter: this) => Iterable, context?: unknown): Set`} +/> + +## Reducing a value + + + +Reduces the Iterable to a value by calling the `reducer` for every entry in the Iterable and passing along the reduced value. + +(reducer: (reduced: R, value: T, key: T, iter: this) => R, initialValue: R): R`} +/> + +If initialValue is not provided, the first entry in the Iterable will be used as the initial value. + + + +Reduces the Iterable to a value by calling the `reducer` for every entry in the Iterable and passing along the reduced value. + +(reducer: (reduced: R, value: T, key: T, iter: this) => R, initialValue: R): R`} +/> + +Note: Similar to this.reverse().reduce(), and provided for parity with `Array#reduceRight`. + + + +Returns true if the `predicate` returns true for every entry in the Iterable. + + boolean, context?: unknown): boolean`} +/> + + + +Returns true if the `predicate` returns true for any entry in the Iterable. + + boolean, context?: unknown): boolean`} +/> + + + +Returns a string of all the entries in the Iterable, separated by `separator`. + + + + + +Returns true if the Iterable is empty. + + + + + +Returns the number of entries in the Iterable. + + + + + +Returns a Map of the number of occurrences of each value in the Iterable. + +(grouper: (value: T, key: T, iter: this) => G, context?: unknown): Map`} +/> + +## Search for value + + + +Returns the first value for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): T | undefined`} +/> + + + +Returns the last value for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): T | undefined`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the first [value, value] entry for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): [T, T] | undefined`} +/> + + + +Returns the last [value, value] entry for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): [T, T] | undefined`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the first key for which the `predicate` returns true. + + boolean, context?: unknown): T | undefined`} +/> + + + +Returns the last key for which the `predicate` returns true. + + boolean, context?: unknown): T | undefined`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the key associated with the search value, or undefined. + + + + + +Returns the last key associated with the search value, or undefined. + + + + + +Returns the maximum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): T | undefined`} /> + +The comparator is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `>`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `max` will operate independent of the order of input as long as the comparator is commutative. The default comparator `>` is commutative only when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `max`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means: + +(comparatorValueMapper: (value: T, key: T, iter: this) => C, comparator?: Comparator): T | undefined`} +/> + + person.age)`} +/> + + + +Returns the minimum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): T | undefined`} /> + +The comparator is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `<`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `min` will operate independent of the order of input as long as the comparator is commutative. The default comparator `<` is commutative only when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `min`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means: + +(comparatorValueMapper: (value: T, key: T, iter: this) => C, comparator?: Comparator): T | undefined`} +/> + + person.age)`} +/> + +## Comparison + + + +True if `iter` includes every value in this Collection. + +): boolean`} /> + + + +True if this Collection includes every value in `iter`. + +): boolean`} /> diff --git a/website/docs/Seq.mdx b/website/docs/Seq.mdx new file mode 100644 index 0000000000..96c005c4bc --- /dev/null +++ b/website/docs/Seq.mdx @@ -0,0 +1,996 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# Seq + +`Seq` describes a lazy operation, allowing them to efficiently chain +use of all the higher-order collection methods (such as and ) +by not creating intermediate collections. + + extends Collection`} /> + +**Seq is immutable** — Once a Seq is created, it cannot be +changed, appended to, rearranged or otherwise modified. Instead, any +mutative method called on a `Seq` will return a new `Seq`. + +**Seq is lazy** — `Seq` does as little work as necessary to respond to any +method call. Values are often created during iteration, including implicit +iteration when reducing or converting to a concrete data structure such as +a or JavaScript [`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array). + +For example, the following performs no work, because the resulting +`Seq`'s values are never iterated: + +```js +import { Seq } from 'immutable'; +const oddSquares = Seq([1, 2, 3, 4, 5, 6, 7, 8]) + .filter((x) => x % 2 !== 0) + .map((x) => x * x); +``` + +Once the `Seq` is used, it performs only the work necessary. In this +example, no intermediate arrays are ever created, filter is called three +times, and map is only called once: + +```js +oddSquares.get(1); // 9 +``` + +Any collection can be converted to a lazy Seq with `Seq()`. + +```js +import { Map } from 'immutable'; + +const map = Map({ a: 1, b: 2, c: 3 }); +const lazySeq = Seq(map); +``` + +`Seq` allows for the efficient chaining of operations, allowing for the +expression of logic that can otherwise be very tedious: + +```js +lazySeq + .flip() + .map((key) => key.toUpperCase()) + .flip(); +// Seq { A: 1, B: 1, C: 1 } +``` + +As well as expressing logic that would otherwise seem memory or time +limited, for example `Range` is a special kind of Lazy sequence. + + -n) + .filter((n) => n % 2 === 0) + .take(2) + .reduce((r, n) => r * n, 1); +`} +/> + +Seq is often used to provide a rich collection API to JavaScript Object. + + v * 2) + .toObject();`} +/> + +## Construction + + + +Creates a Seq. + +(seq: S): S; +function Seq(collection: Collection.Keyed): Seq.Keyed; +function Seq(collection: Collection.Set): Seq.Set; +function Seq(collection: Collection.Indexed | Iterable | ArrayLike): Seq.Indexed; +function Seq(obj: { [key: string]: V }): Seq.Keyed;`} +/> + +Returns a particular kind of `Seq` based on the input. + + * If a `Seq`, that same `Seq`. + * If an `Collection`, a `Seq` of the same kind (Keyed, Indexed, or Set). + * If an Array-like, an `Seq.Indexed`. + * If an Iterable Object, an `Seq.Indexed`. + * If an Object, a `Seq.Keyed`. + +Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`, +which is usually not what you want. You should turn your Iterator Object into +an iterable object by defining a Symbol.iterator (or @@iterator) method which +returns `this`. + +Note: `Seq` is a conversion function and not a class, and does not use the +`new` keyword during construction. + +## Static methods + + + + + +## Members + + + +Some Seqs can describe their size lazily. When this is the case, +size will be an integer. Otherwise it will be undefined. + + + +For example, Seqs returned from or +preserve the size of the original `Seq` while does not. + +Note: , + + and `Seq`s made from +s and s will always have a +size. + +## Force evaluation + + + +Because Sequences are lazy and designed to be chained together, they do +not cache their results. For example, this function is called a total +of 6 times, as each `join` iterates the `Seq` of three values. + + + +```js +var squares = Seq([1, 2, 3]).map((x) => x * x); +squares.join() + squares.join(); +``` + +If you know a `Seq` will be used multiple times, it may be more +efficient to first cache it in memory. Here, the function is called +only 3 times. + +```js +var squares = Seq([1, 2, 3]) + .map((x) => x * x) + .cacheResult(); +squares.join() + squares.join(); +``` + +Use this method judiciously, as it must fully evaluate a `Seq` which can be +a burden on memory and possibly performance. + +Note: after calling , a `Seq` will always have a `size`. + +## Sequence algorithms + + + +Returns a new `Seq` with values passed through a +`mapper` function. + +(mapper: (value: V, key: K, iter: this) => M, context?: unknown): Seq;`} +/> + + 10 * x);`} /> + +Note: always returns a new instance, even if it produced the same +value at every step. +Note: used only for sets. + + + +Flat-maps the `Seq`, returning a `Seq` of the same type. + +(mapper: (value: V, key: K, iter: this) => Iterable, context?: unknown): Seq;`} +/> + +Similar to (...).(true). + +Note: Used only for sets. + + + +Returns a new `Seq` with only the values for which the `predicate` +function returns true. + + unknown, context?: unknown): this;`} +/> + +Note: always returns a new instance, even if it results in +not filtering out any values. + + + +Returns a new `Seq` with the values for which the `predicate` function returns false and another for which is returns true. + +( + predicate: (this, value: V, key: K, iter) => value is F, + context + ): [Seq, Seq];`} +/> + + + +Returns a new `Seq` of the same type with other values and collection-like concatenated to this one. + + + +All entries will be present in the resulting `Seq`, even if they have the same key. + + + +Returns a new Collection of the same type with only the entries for which the `predicate` function returns false. + + boolean, context): this;`} +/> + +Note: `filterNot()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new Collection of the same type in reverse order. + + + + + +Returns a new Collection of the same type which includes the same entries, stably sorted by using a `comparator`. + +): this;`} /> + +If a `comparator` is not provided, a default comparator uses `<` and `>`. + +`comparator(valueA, valueB)`: + +- Returns `0` if the elements should not be swapped. +- Returns `-1` (or any negative number) if `valueA` comes before `valueB` +- Returns `1` (or any positive number) if `valueA` comes after `valueB` +- Alternatively, can return a value of the `PairSorting` enum type +- Is pure, i.e. it must always return the same value for the same pair of values. + +When sorting collections which have no defined order, their ordered equivalents will be returned. e.g. `map.sort()` returns OrderedMap. + + { + if (a < b) { + return -1; + } + if (a > b) { + return 1; + } + if (a === b) { + return 0; + } +});`} +/> + +Note: `sort()` Always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Like `sort`, but also accepts a `comparatorValueMapper` which allows for sorting by more sophisticated means. + +(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: Comparator): this;`} +/> + + member.name); +`} +/> + +Note: `sortBy()` Always returns a new instance, even if the original was +already sorted. + +Note: This is always an eager operation. + + + +Returns a `Map` of `Collection`, grouped by the return value of the `grouper` function. + +( + grouper: (value: V, key: K, iter: this) => G, + context?: unknown + ): Map`} +/> + +Note: This is always an eager operation. + + x.get('v'))`} +/> + +## Value equality + + + +True if this and the other Collection have value equality, as defined by `Immutable.is()`. + + + +Note: This is equivalent to `Immutable.is(this, other)`, but provided to allow for chained expressions. + + + +Computes and returns the hashed identity for this Collection. + + + +The `hashCode` of a Collection is used to determine potential equality, and is used when adding this to a `Set` or as a key in a `Map`, enabling lookup via a different instance. + +```js +import { Seq, Set } from 'immutable'; + +const a = Seq([1, 2, 3]); +const b = Seq([1, 2, 3]); +assert.notStrictEqual(a, b); // different instances +const set = Set([a]); +assert.equal(set.has(b), true); +``` + +Note: hashCode() MUST return a Uint32 number. The easiest way to guarantee this is to return `myHash | 0` from a custom implementation. +If two values have the same `hashCode`, they are [not guaranteed to be equal][Hash Collision]. If two values have different `hashCode`s, they must not be equal. + +Note: `hashCode()` is not guaranteed to always be called before `equals()`. Most but not all Immutable.js collections use hash codes to organize their internal data structures, while all Immutable.js collections use equality during lookups. + +[Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) + +## Reading values + + + +Returns the value associated with the provided key, or notSetValue if the Collection does not contain this key. + +Note: it is possible a key may be associated with an `undefined` value, so if `notSetValue` is not provided and this method returns `undefined`, that does not guarantee the key was not found. + +(key: K, notSetValue: NSV): V | NSV;`} /> + + + + +True if a key exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + +True if a value exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + +In case the `Collection` is not empty returns the first element of the `Collection`. In case the `Collection` is empty returns the optional default value if provided, if no default value is provided returns undefined. + +(notSetValue: NSV): V | NSV;`} /> + + + + +In case the `Collection` is not empty returns the last element of the `Collection`. In case the `Collection` is empty returns the optional default value if provided, if no default value is provided returns undefined. + +(notSetValue: NSV): V | NSV;`} /> + + +## Reading deep values + + + +Returns the value found by following a path of keys or indices through nested Collections. + +, notSetValue?: unknown): unknown;`} +/> + + + +Plain JavaScript Object or Arrays may be nested within an Immutable.js Collection, and getIn() can access those values as well: + + + + + +True if the result of following a path of keys or indices through nested Collections results in a set value. + +): boolean;`} /> + +## Persistent changes + + + +This can be very useful as a way to "chain" a normal function into a sequence of methods. RxJS calls this "let" and lodash calls it "thru". + +(updater: (value: this) => R): R;`} /> + +For example, to sum a Seq after mapping and filtering: + + sum + x, 0); +} +Seq([1, 2, 3]) + .map((x) => x + 1) + .filter((x) => x % 2 === 0) + .update(sum);`} +/> + +## Conversion to JavaScript types + + + +Deeply converts this Seq to equivalent native JavaScript Array or Object. + + | { [key: string]: V };`} /> + +`Collection.Indexed`, and `Collection.Set` become `Array`, while `Collection.Keyed` become `Object`, converting keys to Strings. + + + +Shallowly converts this Seq to equivalent native JavaScript Array or Object. + + | { [key: string]: V };`} /> + +`Collection.Indexed`, and `Collection.Set` become `Array`, while `Collection.Keyed` become `Object`, converting keys to Strings. + + + +Shallowly converts this collection to an Array. + +;`} /> + +`Collection.Indexed`, and `Collection.Set` produce an Array of values. `Collection.Keyed` produce an Array of [key, value] tuples. + + + +Shallowly converts this Collection to an Object. + + + +Converts keys to Strings. + +## Conversion to Collections + + + +Converts this Collection to a Map, Throws if keys are not hashable. + +;`} /> + +Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a Map, maintaining the order of iteration. + +;`} /> + +Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a Set, discarding keys. Throws if values are not hashable. + +;`} /> + +Note: This is equivalent to `Set(this)`, but provided to allow for chained expressions. + + + +Converts this Collection to a Set, maintaining the order of iteration and discarding keys. + +;`} /> + +Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a List, discarding keys. + +;`} /> + +This is similar to `List(collection)`, but provided to allow for chained +expressions. However, when called on `Map` or other keyed collections, +`collection.toList()` discards the keys and creates a list of only the +values, whereas `List(collection)` creates a list of entry tuples. + + + + + + + +Converts this Collection to a Stack, discarding keys. Throws if values are not hashable. + +;`} /> + +Note: This is equivalent to `Stack(this)`, but provided to allow for chained expressions. + +## Conversion to Seq + + + +Converts this Collection to a Seq of the same kind (indexed, keyed, or set). + +;`} /> + + + +Returns a Seq.Keyed from this Collection where indices are treated as keys. + +;`} /> + +This is useful if you want to operate on an Collection.Indexed and preserve the [index, value] pairs. + +The returned Seq will have identical iteration order as this Collection. + +```js +import { Seq } from 'immutable'; + +const indexedSeq = Seq(['A', 'B', 'C']); +// Seq [ "A", "B", "C" ] +indexedSeq.filter((v) => v === 'B'); +// Seq [ "B" ] +const keyedSeq = indexedSeq.toKeyedSeq(); +// Seq { 0: "A", 1: "B", 2: "C" } +keyedSeq.filter((v) => v === 'B'); +// Seq { 1: "B" } +``` + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +;`} /> + + + +Returns a Seq.Set of the values of this Collection, discarding keys. + +;`} /> + +## Iterators + + + +An iterator of this `Collection`'s keys. + +;`} /> + +Note: this will return an ES6 iterator which does not support +Immutable.js sequence algorithms. Use `keySeq` instead, if this is +what you want. + + + +An iterator of this `Collection`'s values. + +Note: this will return an ES6 iterator which does not support +Immutable.js sequence algorithms. Use `valueSeq` instead, if this is +what you want. + +;`} /> + + + +An iterator of this `Collection`'s entries as `[ key, value ]` tuples. + +Note: this will return an ES6 iterator which does not support +Immutable.js sequence algorithms. Use `entrySeq` instead, if this is +what you want. + +;`} /> + +## Collections (Seq) + + + +Returns a new Seq.Indexed of the keys of this Collection, +discarding values. + +;`} /> + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +;`} /> + + + +Returns a new Seq.Indexed of [key, value] tuples. + +;`} /> + +## Side effects + + + +The sideEffect is executed for every entry in the Seq. + + unknown, context?: unknown): number;`} +/> + +Unlike `Array#forEach`, if any call of `sideEffect` returns `false`, the iteration will stop. Returns the number of entries iterated (including the last iteration which returned `false`). + +## Creating subsets + + + +Returns a new Seq of the same type containing entries from begin up to but not including end. + +If begin is negative, it is offset from the end of the Seq. If end is negative, it is also offset from the end of the Seq. If end is not provided, it will default to the size of the Seq. If the requested slice is empty, returns the same type of empty Seq. + + + + + +Returns a new Seq of the same type containing all entries except the first. + + + + + +Returns a new Seq of the same type containing all entries except the last. + + + + + +Returns a new Seq of the same type containing all entries except the first amount. + + + + + +Returns a new Seq of the same type containing all entries except the last amount. + + + + + +Returns a new Seq of the same type containing entries from the first entry for which predicate returns false. + + boolean, context?: unknown): this;`} +/> + + + +Returns a new Seq of the same type containing entries from the first entry for which predicate returns true. + + boolean, context?: unknown): this;`} +/> + + + +Returns a new Seq of the same type containing the first amount entries. + + + + + +Returns a new Seq of the same type containing the last amount entries. + + + + + +Returns a new Seq of the same type containing entries from the start until predicate returns false. + + boolean, context?: unknown): this;`} +/> + + + +Returns a new Seq of the same type containing entries from the start until predicate returns true. + + boolean, context?: unknown): this;`} +/> + +## Combination + + + +Flattens nested Collections. + +Will deeply flatten the Collection by default, returning a Collection of the same type, but a `depth` can be provided in the form of a number or boolean (where true means to shallowly flatten one level). A depth of 0 (or shallow: false) will deeply flatten. + +Flattens only other Collections, not Arrays or Objects. + +Note: `flatten(true)` operates on `Collection>` and returns `Collection`. + + + + + + +Reduces the Collection to a value by calling the `reducer` for every entry in the Collection and passing along the reduced value. + +If `initialReduction` is not provided, the first item in the Collection will be used. + +@see `Array#reduce`. + +(reducer: (reduction, value, key, iter: this) => R): R;`} +/> + + + +Reduces the Collection in reverse (from the right side). + +Note: Similar to `this.reverse().reduce()`, and provided for parity with `Array#reduceRight`. + +(reducer: (reduction, value, key, iter: this) => R): R;`} +/> + + + +True if `predicate` returns true for all entries in the Collection. + + boolean, + context?: unknown + ): boolean;`} +/> + + + +True if `predicate` returns true for any entry in the Collection. + + boolean, + context?: unknown + ): boolean;`} +/> + + + +Joins values together as a string, inserting a separator between each. The default separator is `","`. + + + + + +Returns true if this Collection includes no values. + +For some lazy `Seq`, `isEmpty` might need to iterate to determine emptiness. At most one iteration will occur. + + + + + +Returns the size of this Collection. + +Regardless of if this Collection can describe its size lazily (some Seqs cannot), this method will always return the correct size. E.g. it evaluates a lazy `Seq` if necessary. + +If `predicate` is provided, then this returns the count of entries in the Collection for which the `predicate` returns true. + + + boolean, context?: unknown): number;`} +/> + + + +Returns a `Seq.Keyed` of counts, grouped by the return value of the `grouper` function. + +(grouper: (value: V, key: K, iter: this) => G, context?: unknown): Map;`} +/> + +Note: This is not a lazy operation. + +## Search for value + + + +Returns the first value for which the `predicate` returns true. + + boolean, + context?: unknown, + notSetValue?: V + ): V | undefined;`} +/> + + + +Returns the last value for which the `predicate` returns true. + +Note: `predicate` will be called for each entry in reverse. + + boolean, + context?: unknown, + notSetValue?: V + ): V | undefined;`} +/> + + + +Returns the first [key, value] entry for which the `predicate` returns true. + + boolean, + context?: unknown, + notSetValue?: V + ): [K, V] | undefined;`} +/> + + + +Returns the last [key, value] entry for which the `predicate` returns true. + +Note: `predicate` will be called for each entry in reverse. + + boolean, + context?: unknown, + notSetValue?: V + ): [K, V] | undefined;`} +/> + + + +Returns the key for which the `predicate` returns true. + + boolean, + context?: unknown + ): K | undefined;`} +/> + + + +Returns the last key for which the `predicate` returns true. + + boolean, + context?: unknown + ): K | undefined;`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the key associated with the search value, or undefined. + + + + + +Returns the last key associated with the search value, or undefined. + + + + + +Returns the maximum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): V | undefined;`} /> + +The `comparator` is used in the same way as . If it is not provided, the default comparator is `>`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `max` will operate independent of the order of input as long as the comparator is commutative. The default comparator `>` is commutative _only_ when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `max`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means: + +( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): V | undefined;`} +/> + + i.avgHit); +`} +/> + + + +Returns the minimum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): V | undefined;`} /> + +The `comparator` is used in the same way as . If it is not provided, the default comparator is `<`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `min` will operate independent of the order of input as long as the comparator is commutative. The default comparator `<` is commutative _only_ when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `min`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means: + +( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): V | undefined;`} +/> + + i.avgHit); +`} +/> + +## Comparison + + + +True if `iter` includes every value in this Collection. + +): boolean;`} /> + + + +True if this Collection includes every value in `iter`. + +): boolean;`} /> diff --git a/website/docs/Set.mdx b/website/docs/Set.mdx new file mode 100644 index 0000000000..e87ff08558 --- /dev/null +++ b/website/docs/Set.mdx @@ -0,0 +1,860 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# Set + +A Collection of unique values with `O(log32 N)` adds and has. + + extends Collection.Set`} /> + +When iterating a Set, the entries will be (value, value) pairs. Iteration order of a Set is undefined, however is stable. Multiple iterations of the same Set will iterate in the same order. + +Set values, like Map keys, may be of any type. Equality is determined by `Immutable.is` enabling Sets to uniquely include other Immutable collections, custom value types, and NaN. + +## Construction + + + +Create a new Immutable Set. + +(collection?: Iterable | ArrayLike): Set`} /> + +Note: `Set` is a factory function and not a class, and does not use the `new` keyword during construction. + + + +## Static Methods + + + +True if the provided value is a Set. + + + + + +Creates a new Set containing `values`. + +(...values: Array): Set`} /> + + + +`Set.fromKeys()` creates a new immutable Set containing the keys from this Collection or JavaScript Object. + +(iter: Collection.Keyed): Set +Set.fromKeys(iter: Collection): Set +Set.fromKeys(obj: { [key: string]: unknown }): Set`} +/> + + + +Creates a Set that contains every value shared between all of the provided Sets. + +(sets: Iterable>): Set`} /> + + + + + +Creates a Set that contains all values contained in any of the provided Sets. + +(sets: Iterable>): Set`} /> + + + +## Members + + + +The number of items in this Set. + + + +## Persistent changes + + + +Returns a new Set which includes this value. + +`} /> + +Note: `add` can be used in `withMutations`. + + + +Returns a new Set which excludes this value. + +`} /> + +Note: `delete` cannot be safely used in IE8, use `remove` if supporting old browsers. + +Note: `delete` can be used in `withMutations`. + + + +Returns a new Set containing no values. + +`} /> + +Note: `clear` can be used in `withMutations`. + + + +Returns a Set including any value from `collections` that does not already exist in this Set. + +(...collections: Array>): Set`} /> + +Note: `union` can be used in `withMutations`. + + + +Returns a Set which has removed any values not also contained within `collections`. + +>): Set`} /> + +Note: `intersect` can be used in `withMutations`. + + + +Returns a Set excluding any values contained within `collections`. + +>): Set`} /> + + + +Note: `subtract` can be used in `withMutations`. + +## Transient changes + + + +Note: Not all methods can be used on a mutable collection or within `withMutations`! Check the documentation for each method to see if it allows being used in `withMutations`. + + unknown): Set`} +/> + + + +`} /> + +Note: Not all methods can be used on a mutable collection or within `withMutations`! Check the documentation for each method to see if it allows being used in `withMutations`. + + + +Returns true if this is a mutable copy (see `asMutable()`) and mutative alterations have been applied. + + + + + +The yin to `asMutable`'s yang. Because it applies to mutable collections, this operation is _mutable_ and may return itself (though may not return itself, i.e. if the result is an empty collection). Once performed, the original mutable copy must no longer be mutated since it may be the immutable result. + +`} /> + +If possible, use `withMutations` to work with temporary mutable copies as it provides an easier to use API and considers many common optimizations. + +## Sequence algorithms + + + +Returns a new Set with values passed through a `mapper` function. + +(mapper: (value: T, key: T, iter: this) => M, context?: unknown): Set`} +/> + + 10 * x)`} /> + + + +Flat-maps the Set, returning a new Set. + +Similar to `set.map(...).flatten(true)`. + +(mapper: (value: T, key: T, iter: this) => Iterable, context?: unknown): Set`} +/> + + + +Returns a new Set with only the values for which the `predicate` function returns true. + +Note: `filter()` always returns a new instance, even if it results in not filtering out any values. + + boolean, context?: unknown): Set`} +/> + + + +Returns a new Set with only the values for which the `predicate` function returns false. + + boolean, context?: unknown): Set`} +/> + +Note: `filterNot()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new Set with the values for which the `predicate` function returns false and another for which is returns true. + + boolean, context?: C): [Set, Set]`} +/> + + + +Returns an OrderedSet of the same type which includes the same entries, stably sorted by using a `comparator`. + +): OrderedSet`} /> + +If a `comparator` is not provided, a default comparator uses `<` and `>`. + +`comparator(valueA, valueB)`: + +- Returns `0` if the elements should not be swapped. +- Returns `-1` (or any negative number) if `valueA` comes before `valueB` +- Returns `1` (or any positive number) if `valueA` comes after `valueB` +- Alternatively, can return a value of the `PairSorting` enum type +- Is pure, i.e. it must always return the same value for the same pair of values. + +Note: `sort()` Always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Like `sort`, but also accepts a `comparatorValueMapper` which allows for sorting by more sophisticated means: + +(comparatorValueMapper: (value: T, key: T, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): this & OrderedSet`} +/> + + person.age)`} +/> + +Note: `sortBy()` Always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Returns a new Set with the order of the values reversed. + +`} /> + + + +Returns a `Map` of `Set`, grouped by the return value of the `grouper` function. + +(grouper: (value: T, key: T, iter: this) => G, context?: unknown): Map>`} +/> + +Note: This is not a lazy operation. + +## Conversion to JavaScript types + + + +Deeply converts this Set to equivalent native JavaScript Array. + +>`} /> + + + +Shallowly converts this Set to equivalent native JavaScript Array. + +`} /> + + + +Shallowly converts this collection to an Array. + +`} /> + + + +Shallowly converts this Collection to an Object. + + + +Converts keys to Strings. + +## Conversion to Seq + + + +Returns itself. + +`} /> + + + +Returns a Seq.Keyed from this Collection where indices are treated as keys. + +This is useful if you want to operate on a Collection and preserve the [value, value] pairs. + +`} /> + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +`} /> + + + +Returns a Seq.Set of the values of this Collection, discarding keys. + +`} /> + +## Value equality + + + +True if this and the other Collection have value equality, as defined by `Immutable.is()`. + + + +Note: This is equivalent to `Immutable.is(this, other)`, but provided to allow for chained expressions. + + + +Computes and returns the hashed identity for this Collection. + +The `hashCode` of a Collection is used to determine potential equality, and is used when adding this to a `Set` or as a key in a `Map`, enabling lookup via a different instance. + + + + + +If two values have the same `hashCode`, they are [not guaranteed to be equal][Hash Collision]. If two values have different `hashCode`s, they must not be equal. + +[Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) + +## Reading values + + + +Returns the value associated with the provided key, or notSetValue if the Collection does not contain this key. + +Note: it is possible a key may be associated with an `undefined` value, so if `notSetValue` is not provided and this method returns `undefined`, that does not guarantee the key was not found. + +(key: T, notSetValue: NSV): T | NSV +get(key: T): T | undefined`} +/> + + + +True if a key exists within this Collection, using `Immutable.is` to determine equality. + + + + + +True if a value exists within this `Collection`, using `Immutable.is` to determine equality. + + + + + +Returns the first value in this Collection. + +(notSetValue: NSV): T | NSV +first(): T | undefined`} +/> + + + +Returns the last value in this Collection. + +(notSetValue: NSV): T | NSV +last(): T | undefined`} +/> + +## Reading deep values + + + +Returns the value found by following a path of keys or indices through nested Collections. + +, notSetValue?: unknown): unknown`} +/> + + + +Plain JavaScript Object or Arrays may be nested within an Immutable.js Collection, and getIn() can access those values as well: + + + + + +True if the result of following a path of keys or indices through nested Collections results in a set value. + +): boolean`} /> + +## Conversion to Collections + + + +Converts this Collection to a Map, Throws if keys are not hashable. + +`} /> + +Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a Map, maintaining the order of iteration. + +`} /> + +Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but provided for convenience and to allow for chained expressions. + + + +Returns itself. + +`} /> + + + +Converts this Collection to a Set, maintaining the order of iteration. + +`} /> + +Note: This is equivalent to `OrderedSet(this)`, but provided for convenience and to allow for chained expressions. + + + +Converts this Collection to a List. + +`} /> + + + +Converts this Collection to a Stack, discarding keys. Throws if values are not hashable. + +`} /> + +Note: This is equivalent to `Stack(this)`, but provided to allow for chained expressions. + +## Iterators + + + +An iterator of this `Set`'s keys. + +`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `keySeq` instead, if this is what you want. + + + +An iterator of this `Set`'s values. + +`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `valueSeq` instead, if this is what you want. + + + +An iterator of this `Set`'s entries as `[value, value]` tuples. + +`} /> + +Note: this will return an ES6 iterator which does not support Immutable.js sequence algorithms. Use `entrySeq` instead, if this is what you want. + +## Collections (Seq) + + + +Returns a new Seq.Indexed of the keys of this Collection, discarding values. + +`} /> + + + +Returns an Seq.Indexed of the values of this Collection, discarding keys. + +`} /> + + + +Returns a new Seq.Indexed of [value, value] tuples. + +`} /> + +## Side effects + + + +The `sideEffect` is executed for every entry in the Collection. + + unknown, context?: unknown): number`} +/> + +Unlike `Array#forEach`, if any call of `sideEffect` returns `false`, the iteration will stop. Returns the number of entries iterated (including the last iteration which returned false). + +## Creating subsets + + + +Returns a new Set of the same type representing a portion of this Set from start up to but not including end. + +`} /> + +If begin is negative, it is offset from the end of the Collection. e.g. `slice(-2)` returns a Collection of the last two entries. If it is not provided the new Collection will begin at the beginning of this Collection. + +If end is negative, it is offset from the end of the Collection. e.g. `slice(0, -1)` returns a Collection of everything but the last entry. If it is not provided, the new Collection will continue through the end of this Collection. + +If the requested slice is equivalent to the current Collection, then it will return itself. + + + +Returns a new Collection of the same type containing all entries except the first. + +`} /> + + + +Returns a new Collection of the same type containing all entries except the last. + +`} /> + + + +Returns a new Collection of the same type which excludes the first `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which excludes the last `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns false. + + boolean, context?: unknown): Set`} +/> + + x.match(/g/))`} +/> + + + +Returns a new Collection of the same type which includes entries starting from when `predicate` first returns true. + + boolean, context?: unknown): Set`} +/> + + x.match(/hat/))`} +/> + + + +Returns a new Collection of the same type which includes the first `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which includes the last `amount` entries from this Collection. + +`} /> + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns true. + + boolean, context?: unknown): Set`} +/> + + x.match(/o/))`} +/> + + + +Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns false. + + boolean, context?: unknown): Set`} +/> + + x.match(/at/))`} +/> + +## Combination + + + +Returns a new Set with other collections concatenated to this one. + +(...valuesOrCollections: Array | C>): Set`} +/> + + + +Flattens nested Collections. + +Will deeply flatten the Collection by default, returning a Collection of the same type, but a `depth` can be provided in the form of a number or boolean (where true means to shallowly flatten one level). A depth of 0 (or shallow: false) will deeply flatten. + +Flattens only others Collection, not Arrays or Objects. + + + + + +Flat-maps the Set, returning a new Set. + +Similar to `set.map(...).flatten(true)`. + +(mapper: (value: T, key: T, iter: this) => Iterable, context?: unknown): Set`} +/> + +## Reducing a value + + + +Reduces the Iterable to a value by calling the `reducer` for every entry in the Iterable and passing along the reduced value. + +(reducer: (reduced: R, value: T, key: T, iter: this) => R, initialValue: R): R`} +/> + +If initialValue is not provided, the first entry in the Iterable will be used as the initial value. + + + +Reduces the Iterable to a value by calling the `reducer` for every entry in the Iterable and passing along the reduced value. + +(reducer: (reduced: R, value: T, key: T, iter: this) => R, initialValue: R): R`} +/> + +Note: Similar to this.reverse().reduce(), and provided for parity with `Array#reduceRight`. + + + +Returns true if the `predicate` returns true for every entry in the Iterable. + + boolean, context?: unknown): boolean`} +/> + + + +Returns true if the `predicate` returns true for any entry in the Iterable. + + boolean, context?: unknown): boolean`} +/> + + + +Returns a string of all the entries in the Iterable, separated by `separator`. + + + + + +Returns true if the Iterable is empty. + + + + + +Returns the number of entries in the Iterable. + + + + + +Returns a Map of the number of occurrences of each value in the Iterable. + +(grouper: (value: T, key: T, iter: this) => G, context?: unknown): Map`} +/> + +## Search for value + + + +Returns the first value for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): T | undefined`} +/> + + + +Returns the last value for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): T | undefined`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the first [value, value] entry for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): [T, T] | undefined`} +/> + + + +Returns the last [value, value] entry for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): [T, T] | undefined`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the first key for which the `predicate` returns true. + + boolean, context?: unknown): T | undefined`} +/> + + + +Returns the last key for which the `predicate` returns true. + + boolean, context?: unknown): T | undefined`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the key associated with the search value, or undefined. + + + + + +Returns the last key associated with the search value, or undefined. + + + + + +Returns the maximum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): T | undefined`} /> + +The comparator is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `>`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `max` will operate independent of the order of input as long as the comparator is commutative. The default comparator `>` is commutative only when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `max`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means: + +(comparatorValueMapper: (value: T, key: T, iter: this) => C, comparator?: Comparator): T | undefined`} +/> + + person.age)`} +/> + + + +Returns the minimum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): T | undefined`} /> + +The comparator is used in the same way as `Collection#sort`. If it is not provided, the default comparator is `<`. + +When two values are considered equivalent, the first encountered will be returned. Otherwise, `min` will operate independent of the order of input as long as the comparator is commutative. The default comparator `<` is commutative only when types do not differ. + +If `comparator` returns 0 and either value is NaN, undefined, or null, that value will be returned. + + + +Like `min`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means: + +(comparatorValueMapper: (value: T, key: T, iter: this) => C, comparator?: Comparator): T | undefined`} +/> + + person.age)`} +/> + +## Comparison + + + +True if `iter` includes every value in this Collection. + +): boolean`} /> + + + +True if this Collection includes every value in `iter`. + +): boolean`} /> diff --git a/website/docs/Stack.mdx b/website/docs/Stack.mdx new file mode 100644 index 0000000000..c4e14605dd --- /dev/null +++ b/website/docs/Stack.mdx @@ -0,0 +1,847 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# Stack + +Stacks are indexed collections which support very efficient `O(1)` addition and removal from the front using `unshift(v)` and `shift()`. + + extends Collection.Indexed`} /> + +For familiarity, Stack also provides `push(v)`, `pop()`, and `peek()`, but be aware that they also operate on the front of the list, unlike List or a JavaScript Array. + +Note: `reverse()` or any inherent reverse traversal (`reduceRight`, `lastIndexOf`, etc.) is not efficient with a Stack. + +Stack is implemented with a Single-Linked List. + +## Construction + + + +Create a new immutable Stack containing the values of the provided collection-like. + +(collection?: Iterable | ArrayLike): Stack`} +/> + +Note: `Stack` is a factory function and not a class, and does not use the `new` keyword during construction. + +## Static Methods + + + +True if the provided value is a Stack. + +`} +/> + + + +Creates a new Stack containing `values`. + +(...values: Array): Stack`} /> + +## Members + + + +The number of items in this Stack. + + + +## Reading values + + + +Alias for `Stack.first()`. + + + + + +Returns the value associated with the provided key, or notSetValue if the Collection does not contain this key. + +(key: number, notSetValue: NSV): T | NSV +get(key: number): T | undefined`} +/> + + + +True if a key exists within this Collection, using `Immutable.is` to determine equality. + + + + + +True if a value exists within this Collection, using `Immutable.is` to determine equality. + + + + + +Returns the first value in this Collection. + + + + + +Returns the last value in this Collection. + + + +## Persistent changes + + + +Returns a new Stack with 0 size and no values. + +`} /> + +Note: `clear` can be used in `withMutations`. + + + +Returns a new Stack with the provided `values` prepended, shifting other values ahead to higher indices. + +): Stack`} /> + +This is very efficient for Stack. + +Note: `unshift` can be used in `withMutations`. + + + +Like `Stack#unshift`, but accepts a collection rather than varargs. + +): Stack`} /> + +Note: `unshiftAll` can be used in `withMutations`. + + + +Returns a new Stack with a size ones less than this Stack, excluding the first item in this Stack, shifting all other values to a lower index. + +`} /> + +Note: this differs from `Array#shift` because it returns a new Stack rather than the removed value. Use `first()` or `peek()` to get the first value in this Stack. + +Note: `shift` can be used in `withMutations`. + + + +Alias for `Stack#unshift` and is not equivalent to `List#push`. + +): Stack`} /> + + + +Alias for `Stack#unshiftAll`. + +): Stack`} /> + + + +Alias for `Stack#shift` and is not equivalent to `List#pop`. + +`} /> + + + +Returns a new Stack with an updated value at `index` with the return value of calling `updater` with the existing value. + + T | undefined): this +update(updater: (value: this) => R): R`} +/> + +## Transient changes + + + +Note: Not all methods can be used on a mutable collection or within `withMutations`! Check the documentation for each method to see if it mentions being safe to use in `withMutations`. + + unknown): this`} /> + + + +Note: Not all methods can be used on a mutable collection or within `withMutations`! Check the documentation for each method to see if it mentions being safe to use in `withMutations`. + + + + + + + + + + + +## Sequence algorithms + + + +Returns a new Stack with other collections concatenated to this one. + +(...valuesOrCollections: Array | C>): Stack`} +/> + + + +Returns a new Stack with values passed through a `mapper` function. + +(mapper: (value: T, key: number, iter: this) => M, context?: unknown): Stack`} +/> + +Note: `map()` always returns a new instance, even if it produced the same value at every step. + + + +Flat-maps the Stack, returning a new Stack. + +Similar to `stack.map(...).flatten(true)`. + +(mapper: (value: T, key: number, iter: this) => Iterable, context?: unknown): Stack`} +/> + + + +Returns a new Set with only the values for which the `predicate` function returns true. + +(predicate: (value: T, index: number, iter: this) => value is F, context?: unknown): Set +filter(predicate: (value: T, index: number, iter: this) => unknown, context?: unknown): this`} +/> + +Note: `filter()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new Stack with the values for which the `predicate` function returns false and another for which it returns true. + +(predicate: (this: C, value: T, index: number, iter: this) => value is F, context?: C): [Stack, Stack] +partition(predicate: (this: C, value: T, index: number, iter: this) => unknown, context?: C): [this, this]`} +/> + + + +Returns a Stack "zipped" with the provided collections. + +Like `zipWith`, but using the default `zipper`: creating an `Array`. + +(other: Collection): Stack<[T, U]> +zip(other: Collection, other2: Collection): Stack<[T, U, V]> +zip(...collections: Array>): Stack`} +/> + +Example: + +```js +const a = Stack([1, 2, 3]); +const b = Stack([4, 5, 6]); +const c = a.zip(b); // Stack [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] +``` + + + +Returns a Stack "zipped" with the provided collections. + +Unlike `zip`, `zipAll` continues zipping until the longest collection is exhausted. Missing values from shorter collections are filled with `undefined`. + +(other: Collection): Stack<[T, U]> +zipAll(other: Collection, other2: Collection): Stack<[T, U, V]> +zipAll(...collections: Array>): Stack`} +/> + +Example: + +```js +const a = Stack([1, 2]); +const b = Stack([3, 4, 5]); +const c = a.zipAll(b); // Stack [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] +``` + +Note: Since zipAll will return a collection as large as the largest input, some results may contain undefined values. TypeScript cannot account for these without cases (as of v2.5). + + + +Returns a Stack "zipped" with the provided collections by using a custom `zipper` function. + +(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection): Stack +zipWith(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection, thirdCollection: Collection): Stack +zipWith(zipper: (...values: Array) => Z, ...collections: Array>): Stack`} +/> + +Example: + +```js +const a = Stack([1, 2, 3]); +const b = Stack([4, 5, 6]); +const c = a.zipWith((a, b) => a + b, b); +// Stack [ 5, 7, 9 ] +``` + +## Sequence algorithms + + + + + +Returns an iterator of this Stack. + +`} /> + + + +Returns a new Stack with only the values for which the `predicate` function returns false. + + boolean, context?: unknown): this`} +/> + +Note: `filterNot()` always returns a new instance, even if it results in not filtering out any values. + + + +Returns a new Stack with the order of the values reversed. + + + + + +Returns Stack of the same type which includes the same entries, stably sorted by using a comparator. + +): this`} /> + +If a comparator is not provided, a default comparator uses `<` and `>`. + +`comparator(valueA, valueB)`: + +- Returns `0` if the elements should not be swapped. +- Returns `-1` (or any negative number) if `valueA` comes before `valueB` +- Returns `1` (or any positive number) if `valueA` comes after `valueB` +- Alternatively, can return a value of the `PairSorting` enum type +- Is pure, i.e. it must always return the same value for the same pair of values. + +Note: `sort()` always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Like `sort`, but also accepts a `comparatorValueMapper` which allows for sorting by more sophisticated means. + +(comparatorValueMapper: (value: T, key: number, iter: this) => C, comparator?: Comparator): this`} +/> + +Note: `sortBy()` always returns a new instance, even if the original was already sorted. + +Note: This is always an eager operation. + + + +Returns a `Map` of `Stack`, grouped by the return value of the `grouper` function. + +(grouper: (value: T, key: number, iter: this) => G, context?: unknown): Map>`} +/> + +Note: This is not a lazy operation. + +## Conversion to JavaScript types + + + +Deeply converts this Stack to equivalent native JavaScript Array. + +>`} /> + + + +Shallowly converts this Stack to equivalent native JavaScript Array. + +`} /> + + + +Shallowly converts this collection to an Array. + +`} /> + + + +Shallowly converts this Stack to a JavaScript Object. + + + +## Conversion to Seq + + + +Returns a Seq.Indexed of the values of this Stack. + +`} /> + + + +If this is a collection of [key, value] entry tuples, it will return a Seq.Keyed of those entries. + +`} /> + + + +Returns a Seq.Keyed from this Stack where indices are treated as keys. + +`} /> + + + +Returns a Seq.Indexed of the values of this Stack, discarding keys. + +`} /> + + + +Returns a Seq.Set of the values of this Stack, discarding keys. + +`} /> + +## Combination + + + +Returns a new Stack with the separator inserted between each value in this Stack. + +`} /> + + + +Returns a new Stack with the values from each collection interleaved. + +>): Stack`} +/> + + + +Returns a new Stack by replacing a region of this Stack with new values. If values are not provided, it only skips the region to be removed. + +): Stack`} +/> + + + +Returns a new flattened Stack, optionally only flattening to a particular depth. + + +flatten(shallow?: boolean): Stack`} +/> + +## Search for value + + + +Returns the first index at which a given value can be found in the Stack, or -1 if it is not present. + + + + + +Returns the last index at which a given value can be found in the Stack, or -1 if it is not present. + + + + + +Returns the first index in the Stack where a value satisfies the provided predicate function. Otherwise -1 is returned. + + boolean, context?: unknown): number`} +/> + + + +Returns the last index in the Stack where a value satisfies the provided predicate function. Otherwise -1 is returned. + + boolean, context?: unknown): number`} +/> + + + +Returns the first value for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): T | undefined`} +/> + + + +Returns the last value for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): T | undefined`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the first [key, value] entry for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): [number, T] | undefined`} +/> + + + +Returns the last [key, value] entry for which the `predicate` returns true. + + boolean, context?: unknown, notSetValue?: T): [number, T] | undefined`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the first key for which the `predicate` returns true. + + boolean, context?: unknown): number | undefined`} +/> + + + +Returns the last key for which the `predicate` returns true. + + boolean, context?: unknown): number | undefined`} +/> + +Note: `predicate` will be called for each entry in reverse. + + + +Returns the key associated with the search value, or undefined. + + + + + +Returns the last key associated with the search value, or undefined. + + + + + +Returns the maximum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): T | undefined`} /> + + + +Like `max`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means. + +(comparatorValueMapper: (value: T, key: number, iter: this) => C, comparator?: Comparator): T | undefined`} +/> + + + +Returns the minimum value in this collection. If any values are comparatively equivalent, the first one found will be returned. + +): T | undefined`} /> + + + +Like `min`, but also accepts a `comparatorValueMapper` which allows for comparing by more sophisticated means. + +(comparatorValueMapper: (value: T, key: number, iter: this) => C, comparator?: Comparator): T | undefined`} +/> + +## Value equality + + + +True if this and the other Collection have value equality, as defined by `Immutable.is()`. + + + +Note: This is equivalent to `Immutable.is(this, other)`, but provided to allow for chained expressions. + + + +Computes and returns the hashed identity for this Collection. + + + +## Reading deep values + + + +Returns the value found by following a path of keys or indices through nested Collections. + +, notSetValue?: unknown): unknown`} +/> + + + +True if the result of following a path of keys or indices through nested Collections results in a set value. + +): boolean`} /> + +## Conversion to Collections + + + +Converts this Stack to a Map, Throws if keys are not hashable. + +`} /> + + + +Converts this Stack to a Map, maintaining the order of iteration. + +`} /> + + + +Converts this Stack to a Set, discarding keys. + +`} /> + + + +Converts this Stack to a Set, maintaining the order of iteration and discarding keys. + +`} /> + + + +Converts this Stack to a List, discarding keys. + +`} /> + + + +Returns itself. + +`} /> + +## Iterators + + + +An iterator of this Stack's keys. + +`} /> + + + +An iterator of this Stack's values. + +`} /> + + + +An iterator of this Stack's entries as [key, value] tuples. + +`} /> + +## Collections (Seq) + + + +Returns a new Seq.Indexed of the keys of this Stack, discarding values. + +`} /> + + + +Returns an Seq.Indexed of the values of this Stack, discarding keys. + +`} /> + + + +Returns a new Seq.Indexed of [key, value] tuples. + +`} /> + +## Side effects + + + +The `sideEffect` is executed for every entry in the Stack. + + unknown, context?: unknown): number`} +/> + +## Creating subsets + + + +Returns a new Stack representing a portion of this Stack from start up to but not including end. + +`} /> + + + +Returns a new Stack containing all entries except the first. + +`} /> + + + +Returns a new Stack containing all entries except the last. + +`} /> + + + +Returns a new Stack which excludes the first `amount` entries from this Stack. + +`} /> + + + +Returns a new Stack which excludes the last `amount` entries from this Stack. + +`} /> + + + +Returns a new Stack which includes entries starting from when `predicate` first returns false. + + boolean, context?: unknown): Stack`} +/> + + + +Returns a new Stack which includes entries starting from when `predicate` first returns true. + + boolean, context?: unknown): Stack`} +/> + + + +Returns a new Stack which includes the first `amount` entries from this Stack. + +`} /> + + + +Returns a new Stack which includes the last `amount` entries from this Stack. + +`} /> + + + +Returns a new Stack which includes entries from this Stack as long as the `predicate` returns true. + + boolean, context?: unknown): Stack`} +/> + + + +Returns a new Stack which includes entries from this Stack as long as the `predicate` returns false. + + boolean, context?: unknown): Stack`} +/> + +## Reducing a value + + + +Reduces the Stack to a value by calling the `reducer` for every entry in the Stack and passing along the reduced value. + +(reducer: (reduction: R, value: T, key: number, iter: this) => R, initialReduction: R, context?: unknown): R +reduce(reducer: (reduction: T | R, value: T, key: number, iter: this) => R): R`} +/> + + + +Reduces the Stack in reverse (from the right side). + +(reducer: (reduction: R, value: T, key: number, iter: this) => R, initialReduction: R, context?: unknown): R +reduceRight(reducer: (reduction: T | R, value: T, key: number, iter: this) => R): R`} +/> + + + +True if `predicate` returns true for all entries in the Stack. + + boolean, context?: unknown): boolean`} +/> + + + +True if `predicate` returns true for any entry in the Stack. + + boolean, context?: unknown): boolean`} +/> + + + +Joins values together as a string, inserting a separator between each. The default separator is `","`. + + + + + +Returns true if this Stack includes no values. + + + + + +Returns the size of this Stack. + + boolean, context?: unknown): number`} +/> + + + +Returns a `Map` of counts, grouped by the return value of the `grouper` function. + +(grouper: (value: T, key: number, iter: this) => G, context?: unknown): Map`} +/> + +## Comparison + + + +True if `iter` includes every value in this Stack. + +): boolean`} /> + + + +True if this Stack includes every value in `iter`. + +): boolean`} /> diff --git a/website/docs/ValueObject.mdx b/website/docs/ValueObject.mdx new file mode 100644 index 0000000000..e58cd247e9 --- /dev/null +++ b/website/docs/ValueObject.mdx @@ -0,0 +1,49 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# ValueObject + +The interface to fulfill to qualify as a Value Object. + +## Members + + + +True if this and the other Collection have value equality, as defined +by `Immutable.is()`. + + + +Note: This is equivalent to `Immutable.is(this, other)`, but provided to +allow for chained expressions. + + +Computes and returns the hashed identity for this Collection. + + + +The `hashCode` of a Collection is used to determine potential equality, +and is used when adding this to a `Set` or as a key in a `Map`, enabling +lookup via a different instance. + + + +Note: hashCode() MUST return a Uint32 number. The easiest way to +guarantee this is to return `myHash | 0` from a custom implementation. + +If two values have the same `hashCode`, they are [not guaranteed +to be equal][Hash Collision]. If two values have different `hashCode`s, +they must not be equal. + +Note: `hashCode()` is not guaranteed to always be called before +`equals()`. Most but not all Immutable.js collections use hash codes to +organize their internal data structures, while all Immutable.js +collections use equality during lookups. + +[Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) diff --git a/website/docs/fromJS().mdx b/website/docs/fromJS().mdx new file mode 100644 index 0000000000..2d1d9504d7 --- /dev/null +++ b/website/docs/fromJS().mdx @@ -0,0 +1,80 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# fromJS() + +Deeply converts plain JS objects and arrays to Immutable Maps and Lists. + + unknown + ): Collection; +`} +/> + +`fromJS` will convert Arrays and [array-like objects][2] to a List, and +plain objects (without a custom prototype) to a Map. [Iterable objects][3] +may be converted to List, Map, or Set. + +If a `reviver` is optionally provided, it will be called with every +collection as a Seq (beginning with the most nested collections +and proceeding to the top-level collection itself), along with the key +referring to each collection and the parent JS object provided as `this`. +For the top level, object, the key will be `""`. This `reviver` is expected +to return a new Immutable Collection, allowing for custom conversions from +deep JS objects. Finally, a `path` is provided which is the sequence of +keys to this value from the starting value. + +`reviver` acts similarly to the [same parameter in `JSON.parse`][1]. + +If `reviver` is not provided, the default behavior will convert Objects +into Maps and Arrays into Lists like so: + +```js +import { fromJS, isKeyed } from 'immutable'; + +function (key, value) { + return isKeyed(value) ? value.toMap() : value.toList() +} +``` + +Accordingly, this example converts native JS data to OrderedMap and List: + +```js +import { fromJS, isKeyed } from 'immutable'; + +fromJS({ a: { b: [10, 20, 30] }, c: 40 }, function (key, value, path) { + console.log(key, value, path); + return isKeyed(value) ? value.toOrderedMap() : value.toList(); +}) > 'b', + [10, 20, 30], + ['a', 'b'] > 'a', + { b: [10, 20, 30] }, + ['a'] > '', + { a: { b: [10, 20, 30] }, c: 40 }, + []; +``` + +Keep in mind, when using JS objects to construct Immutable Maps, that +JavaScript Object properties are always strings, even if written in a +quote-less shorthand, while Immutable Maps accept keys of any type. + +```js +import { Map } from 'immutable'; + +let obj = { 1: 'one' }; +Object.keys(obj); // [ "1" ] +assert.equal(obj['1'], obj[1]); // "one" === "one" + +let map = Map(obj); +assert.notEqual(map.get('1'), map.get(1)); // "one" !== undefined +``` + +Property access for JavaScript Objects first converts the key to a string, +but since Immutable Map keys can be of any type the argument to `get()` is +not altered. + +[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter 'Using the reviver parameter' +[2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects 'Working with array-like objects' +[3]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol 'The iterable protocol' diff --git a/website/docs/get().mdx b/website/docs/get().mdx new file mode 100644 index 0000000000..508655840f --- /dev/null +++ b/website/docs/get().mdx @@ -0,0 +1,16 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# get() + +Returns the value within the provided collection associated with the provided key, or notSetValue if the key is not defined in the collection. + + + +A functional alternative to `collection.get(key)` which will also work on plain Objects and Arrays as an alternative for `collection[key]`. + + + + + + diff --git a/website/docs/getIn().mdx b/website/docs/getIn().mdx new file mode 100644 index 0000000000..9c71db59f1 --- /dev/null +++ b/website/docs/getIn().mdx @@ -0,0 +1,15 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# getIn() + +Returns the value at the provided key path starting at the provided collection, or notSetValue if the key path is not defined. + +A functional alternative to `collection.getIn(keypath)` which will also work with plain Objects and Arrays. + + + + + diff --git a/website/docs/has().mdx b/website/docs/has().mdx new file mode 100644 index 0000000000..92da8b77b6 --- /dev/null +++ b/website/docs/has().mdx @@ -0,0 +1,15 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# has() + +Returns true if the key is defined in the provided collection. + + + +A functional alternative to `collection.has(key)` which will also work with plain Objects and Arrays as an alternative for `collection.hasOwnProperty(key)`. + + + + + diff --git a/website/docs/hasIn().mdx b/website/docs/hasIn().mdx new file mode 100644 index 0000000000..cdea2910b9 --- /dev/null +++ b/website/docs/hasIn().mdx @@ -0,0 +1,13 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# hasIn() + +Returns true if the key path is defined in the provided collection. + +A functional alternative to `collection.hasIn(keypath)` which will also work with plain Objects and Arrays. + + + + + diff --git a/website/docs/hash().mdx b/website/docs/hash().mdx new file mode 100644 index 0000000000..36fe2b28cb --- /dev/null +++ b/website/docs/hash().mdx @@ -0,0 +1,27 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# hash() + +The `hash()` function is an important part of how Immutable determines if +two values are equivalent and is used to determine how to store those +values. Provided with any value, `hash()` will return a 31-bit integer. + + + +When designing Objects which may be equal, it's important that when a +`.equals()` method returns true, that both values `.hashCode()` method +return the same value. `hash()` may be used to produce those values. + +For non-Immutable Objects that do not provide a `.hashCode()` functions +(including plain Objects, plain Arrays, Date objects, etc), a unique hash +value will be created for each _instance_. That is, the create hash +represents referential equality, and not value equality for Objects. This +ensures that if that Object is mutated over time that its hash code will +remain consistent, allowing Objects to be used as keys and values in +Immutable.js collections. + +Note that `hash()` attempts to balance between speed and avoiding +collisions, however it makes no attempt to produce secure hashes. + +_New in Version 4.0_ diff --git a/website/docs/is().mdx b/website/docs/is().mdx new file mode 100644 index 0000000000..d663122105 --- /dev/null +++ b/website/docs/is().mdx @@ -0,0 +1,30 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# is() + +Value equality check with semantics similar to `Object.is`, but treats +Immutable `Collection`s as values, equal if the second `Collection` includes +equivalent values. + + + +It's used throughout Immutable when checking for equality, including `Map` +key equality and `Set` membership. + +```js +import { Map, is } from 'immutable'; + +const map1 = Map({ a: 1, b: 1, c: 1 }); +const map2 = Map({ a: 1, b: 1, c: 1 }); +assert.equal(map1 !== map2, true); +assert.equal(Object.is(map1, map2), false); +assert.equal(is(map1, map2), true); +``` + +`is()` compares primitive types like strings and numbers, Immutable.js +collections like `Map` and `List`, but also any custom object which +implements `ValueObject` by providing `equals()` and `hashCode()` methods. + +Note: Unlike `Object.is`, `Immutable.is` assumes `0` and `-0` are the same +value, matching the behavior of ES6 Map key equality. diff --git a/website/docs/isAssociative().mdx b/website/docs/isAssociative().mdx new file mode 100644 index 0000000000..6acbf1746b --- /dev/null +++ b/website/docs/isAssociative().mdx @@ -0,0 +1,19 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# isAssociative() + +True if `maybeAssociative` is either a Keyed or Indexed Collection. + + + +```js +import { isAssociative, Map, List, Stack, Set } from 'immutable'; + +isAssociative([]); // false +isAssociative({}); // false +isAssociative(Map()); // true +isAssociative(List()); // true +isAssociative(Stack()); // true +isAssociative(Set()); // false +``` diff --git a/website/docs/isCollection().mdx b/website/docs/isCollection().mdx new file mode 100644 index 0000000000..70e0ff8398 --- /dev/null +++ b/website/docs/isCollection().mdx @@ -0,0 +1,18 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# isCollection() + +True if `maybeCollection` is a Collection, or any of its subclasses. + + + +```js +import { isCollection, Map, List, Stack } from 'immutable'; + +isCollection([]); // false +isCollection({}); // false +isCollection(Map()); // true +isCollection(List()); // true +isCollection(Stack()); // true +``` diff --git a/website/docs/isImmutable().mdx b/website/docs/isImmutable().mdx new file mode 100644 index 0000000000..993ecaeacd --- /dev/null +++ b/website/docs/isImmutable().mdx @@ -0,0 +1,20 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# isImmutable() + +True if `maybeImmutable` is an Immutable Collection or Record. + + + +Note: Still returns true even if the collections is within a `withMutations()`. + +```js +const { isImmutable, Map, List, Stack } = require('immutable'); +isImmutable([]); // false +isImmutable({}); // false +isImmutable(Map()); // true +isImmutable(List()); // true +isImmutable(Stack()); // true +isImmutable(Map().asMutable()); // true +``` diff --git a/website/docs/isIndexed().mdx b/website/docs/isIndexed().mdx new file mode 100644 index 0000000000..6fa794c39c --- /dev/null +++ b/website/docs/isIndexed().mdx @@ -0,0 +1,19 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# isIndexed() + +True if `maybeIndexed` is a Collection.Indexed, or any of its subclasses. + + + +```js +import { isIndexed, Map, List, Stack, Set } from 'immutable'; + +isIndexed([]); // false +isIndexed({}); // false +isIndexed(Map()); // false +isIndexed(List()); // true +isIndexed(Stack()); // true +isIndexed(Set()); // false +``` diff --git a/website/docs/isKeyed().mdx b/website/docs/isKeyed().mdx new file mode 100644 index 0000000000..574f4a4d87 --- /dev/null +++ b/website/docs/isKeyed().mdx @@ -0,0 +1,17 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# isKeyed() + +True if `maybeKeyed` is a Collection.Keyed, or any of its subclasses. + + + +```js +const { isKeyed, Map, List, Stack } = require('immutable'); +isKeyed([]); // false +isKeyed({}); // false +isKeyed(Map()); // true +isKeyed(List()); // false +isKeyed(Stack()); // false +``` diff --git a/website/docs/isList().mdx b/website/docs/isList().mdx new file mode 100644 index 0000000000..25c1980fc2 --- /dev/null +++ b/website/docs/isList().mdx @@ -0,0 +1,8 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# isList() + +True if `maybeList` is a List. + + diff --git a/website/docs/isMap().mdx b/website/docs/isMap().mdx new file mode 100644 index 0000000000..90bc1e9b75 --- /dev/null +++ b/website/docs/isMap().mdx @@ -0,0 +1,10 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# isMap() + +True if `maybeMap` is a Map. + + + +Also true for OrderedMaps. diff --git a/website/docs/isOrdered().mdx b/website/docs/isOrdered().mdx new file mode 100644 index 0000000000..6a5c54c502 --- /dev/null +++ b/website/docs/isOrdered().mdx @@ -0,0 +1,19 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# isOrdered() + +True if `maybeOrdered` is a Collection where iteration order is well defined. True for Collection.Indexed as well as OrderedMap and OrderedSet. + + + +```js +import { isOrdered, Map, OrderedMap, List, Set } from 'immutable'; + +isOrdered([]); // false +isOrdered({}); // false +isOrdered(Map()); // false +isOrdered(OrderedMap()); // true +isOrdered(List()); // true +isOrdered(Set()); // false +``` diff --git a/website/docs/isOrderedMap().mdx b/website/docs/isOrderedMap().mdx new file mode 100644 index 0000000000..5adfeddd7c --- /dev/null +++ b/website/docs/isOrderedMap().mdx @@ -0,0 +1,8 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# isOrderedMap() + +True if `maybeOrderedMap` is an OrderedMap. + + diff --git a/website/docs/isOrderedSet().mdx b/website/docs/isOrderedSet().mdx new file mode 100644 index 0000000000..99f4fa7e0e --- /dev/null +++ b/website/docs/isOrderedSet().mdx @@ -0,0 +1,8 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# isOrderedSet() + +True if `maybeOrderedSet` is an OrderedSet. + + diff --git a/website/docs/isRecord().mdx b/website/docs/isRecord().mdx new file mode 100644 index 0000000000..1da196c1ff --- /dev/null +++ b/website/docs/isRecord().mdx @@ -0,0 +1,8 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# isRecord() + +True if `maybeRecord` is a Record. + + diff --git a/website/docs/isSeq().mdx b/website/docs/isSeq().mdx new file mode 100644 index 0000000000..a0448edb65 --- /dev/null +++ b/website/docs/isSeq().mdx @@ -0,0 +1,8 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# isSeq() + +True if `maybeSeq` is a Seq. + + diff --git a/website/docs/isSet().mdx b/website/docs/isSet().mdx new file mode 100644 index 0000000000..77a7bb2df6 --- /dev/null +++ b/website/docs/isSet().mdx @@ -0,0 +1,10 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# isSet() + +True if `maybeSet` is a Set. + + + +Also true for OrderedSets. diff --git a/website/docs/isStack().mdx b/website/docs/isStack().mdx new file mode 100644 index 0000000000..03b2fbabbc --- /dev/null +++ b/website/docs/isStack().mdx @@ -0,0 +1,8 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# isStack() + +True if `maybeStack` is a Stack. + + diff --git a/website/docs/isValueObject().mdx b/website/docs/isValueObject().mdx new file mode 100644 index 0000000000..4a9726f09b --- /dev/null +++ b/website/docs/isValueObject().mdx @@ -0,0 +1,10 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# isValueObject() + +True if `maybeValue` is a JavaScript Object which has _both_ `equals()` and `hashCode()` methods. + + + +Any two instances of value objects can be compared for value equality with `Immutable.is()` and can be used as keys in a `Map` or members in a `Set`. diff --git a/website/docs/merge().mdx b/website/docs/merge().mdx new file mode 100644 index 0000000000..f6020d9a9b --- /dev/null +++ b/website/docs/merge().mdx @@ -0,0 +1,17 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# merge() + +Returns a new collection with the provided collections merged in. + +A functional alternative to `collection.merge()` which will also work with plain Objects and Arrays + +(collection: C, ...collections: Array>): C;`} +/> + + diff --git a/website/docs/mergeDeep().mdx b/website/docs/mergeDeep().mdx new file mode 100644 index 0000000000..3a7b51006f --- /dev/null +++ b/website/docs/mergeDeep().mdx @@ -0,0 +1,26 @@ +import Repl from '@/repl/Repl.tsx'; + +# mergeDeep() + +Like [`merge()`](<../merge()>), but when two compatible collections are encountered with +the same key, it merges them as well, recursing deeply through the nested +data. Two collections are considered to be compatible (and thus will be +merged together) if they both fall into one of three categories: keyed +(e.g., [`Map`](../Map)s, [`Record`](../Record)s, and objects), indexed (e.g., [`List`](../List)s and +arrays), or set-like (e.g., [`Set`](../Set)s). If they fall into separate +categories, [`mergeDeep`](<../mergeDeep()>) will replace the existing collection with the +collection being merged in. This behavior can be customized by using +[`mergeDeepWith()`](<../mergeDeepWith()>). + + + +Note: Indexed and set-like collections are merged using +`concat()`/`union()` and therefore do not recurse. + +A functional alternative to `collection.mergeDeep()` which will also work +with plain Objects and Arrays. + + diff --git a/website/docs/mergeDeepWith().mdx b/website/docs/mergeDeepWith().mdx new file mode 100644 index 0000000000..2a613e1554 --- /dev/null +++ b/website/docs/mergeDeepWith().mdx @@ -0,0 +1,28 @@ +import Repl from '@/repl/Repl.tsx'; + +# mergeDeepWith() + +Like[`mergeDeep()`](<../mergeDeep()>), but when two non-collections or incompatible +collections are encountered at the same key, it uses the `merger` function +to determine the resulting value. Collections are considered incompatible +if they fall into separate categories between keyed, indexed, and set-like. + + any, + collection, + ...collections + )`} +/> + +A functional alternative to `collection.mergeDeepWith()` which will also +work with plain Objects and Arrays. + + oldVal + newVal, + original, + { x: { y: 456 }} +)`} +/> diff --git a/website/docs/mergeWith().mdx b/website/docs/mergeWith().mdx new file mode 100644 index 0000000000..a0334efafd --- /dev/null +++ b/website/docs/mergeWith().mdx @@ -0,0 +1,17 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# mergeWith() + +Returns a copy of the collection with the remaining collections merged in, calling the `merger` function whenever an existing value is encountered. + +A functional alternative to `collection.mergeWith()` which will also work with plain Objects and Arrays. + + oldVal + newVal, + original, + { y: 789, z: 'abc' } +)`} +/> diff --git a/website/docs/remove().mdx b/website/docs/remove().mdx new file mode 100644 index 0000000000..b61fb9881d --- /dev/null +++ b/website/docs/remove().mdx @@ -0,0 +1,20 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# remove() + +Returns a copy of the collection with the value at key removed. + + + +A functional alternative to `collection.remove(key)` which will also work with plain Objects and Arrays as an alternative for `delete collectionCopy[key]`. + + + + diff --git a/website/docs/removeIn().mdx b/website/docs/removeIn().mdx new file mode 100644 index 0000000000..f0be9558e4 --- /dev/null +++ b/website/docs/removeIn().mdx @@ -0,0 +1,15 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# removeIn() + +Returns a copy of the collection with the value at the key path removed. + +A functional alternative to `collection.removeIn(keypath)` which will also work with plain Objects and Arrays. + + + + diff --git a/website/docs/set().mdx b/website/docs/set().mdx new file mode 100644 index 0000000000..cd73154eb6 --- /dev/null +++ b/website/docs/set().mdx @@ -0,0 +1,20 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# set() + +Returns a copy of the collection with the value at key set to the provided value. + +A functional alternative to `collection.set(key, value)` which will also work with plain Objects and Arrays as an alternative for `collectionCopy[key] = value`. + + + + + + diff --git a/website/docs/setIn().mdx b/website/docs/setIn().mdx new file mode 100644 index 0000000000..f5093948fd --- /dev/null +++ b/website/docs/setIn().mdx @@ -0,0 +1,15 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# setIn() + +Returns a copy of the collection with the value at the key path set to the provided value. + +A functional alternative to `collection.setIn(keypath)` which will also work with plain Objects and Arrays. + + + + diff --git a/website/docs/update().mdx b/website/docs/update().mdx new file mode 100644 index 0000000000..0d85809e4e --- /dev/null +++ b/website/docs/update().mdx @@ -0,0 +1,20 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# update() + +Returns a copy of the collection with the value at key set to the result of providing the existing value to the updating function. + +A functional alternative to `collection.update(key, fn)` which will also work with plain Objects and Arrays as an alternative for `collectionCopy[key] = fn(collection[key])`. + + + + val.toUpperCase()); // [ 'dog', 'FROG', 'cat' ]`} +/> + + val * 6); // { x: 738, y: 456 }`} +/> diff --git a/website/docs/updateIn().mdx b/website/docs/updateIn().mdx new file mode 100644 index 0000000000..fe5a07e351 --- /dev/null +++ b/website/docs/updateIn().mdx @@ -0,0 +1,12 @@ +import Repl from '@/repl/Repl.tsx'; +import CodeLink from '@/mdx-components/CodeLink.tsx'; + +# updateIn() + +Returns a copy of the collection with the value at the key path set to the result of providing the existing value to the updating function. + +A functional alternative to `collection.updateIn(keypath, fn)` which will also work with plain Objects and Arrays. + + any): C;`} +/> diff --git a/website/next.config.js b/website/next.config.js deleted file mode 100644 index 61576f7219..0000000000 --- a/website/next.config.js +++ /dev/null @@ -1,6 +0,0 @@ -// eslint-disable-next-line no-undef -module.exports = { - reactStrictMode: true, - trailingSlash: true, - output: 'export', -}; diff --git a/website/next.config.mjs b/website/next.config.mjs new file mode 100644 index 0000000000..a25be9ea0c --- /dev/null +++ b/website/next.config.mjs @@ -0,0 +1,18 @@ +import createMDX from '@next/mdx'; + +/** @type {import('next').NextConfig} */ +const nextConfig = { + // Configure `pageExtensions` to include markdown and MDX files + pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'], + + reactStrictMode: true, + trailingSlash: true, + output: 'export', +}; + +const withMDX = createMDX({ + // Add markdown plugins here, as desired +}); + +// Merge MDX config with Next.js config +export default withMDX(nextConfig); diff --git a/website/src/Sidebar.tsx b/website/src/Sidebar.tsx index 7779a7d86e..d7d41f660f 100644 --- a/website/src/Sidebar.tsx +++ b/website/src/Sidebar.tsx @@ -5,6 +5,7 @@ import { Fragment, useEffect, useState } from 'react'; import type { TypeDefinition } from './TypeDefs'; import { collectMemberGroups } from './collectMemberGroups'; import { ArrowDown } from './ArrowDown'; +import { SIDEBAR_LINKS } from './app/docs/currentVersion'; export type SidebarLinks = Array<{ label: string; url: string }>; @@ -130,14 +131,14 @@ function Focus({ } export function SideBar({ - links, + links = SIDEBAR_LINKS, focus, toggleShowInherited, toggleShowInGroups, showInherited, showInGroups, }: { - links: SidebarLinks; + links?: SidebarLinks; focus?: TypeDefinition; toggleShowInherited?: () => void; toggleShowInGroups?: () => void; diff --git a/website/src/TypeDocumentation.tsx b/website/src/TypeDocumentation.tsx index fbb381c164..c8118de8c2 100644 --- a/website/src/TypeDocumentation.tsx +++ b/website/src/TypeDocumentation.tsx @@ -75,7 +75,7 @@ export function TypeDocumentation({ function FunctionDoc({ def }: { def: MemberDefinition }) { return (

-

{def.label}

+

{def.label}

{def.doc && ( )} @@ -128,7 +128,7 @@ function TypeDoc({ return (
-

{def.qualifiedName}

+

{def.qualifiedName}

{def.doc && ( )} diff --git a/website/src/app/docs/[version]/[type]/page.tsx b/website/src/app/docs/[version]/[type]/page.tsx index 044775a215..900fa40374 100644 --- a/website/src/app/docs/[version]/[type]/page.tsx +++ b/website/src/app/docs/[version]/[type]/page.tsx @@ -1,11 +1,11 @@ import { getSidebarLinks } from '../../../../getSidebarLinks'; import { getTypeDefs } from '../../../../static/getTypeDefs'; -import { getVersions } from '../../../../static/getVersions'; +import { getVersionFromGitTag } from '../../../../static/getVersions'; import { TypeDocumentation } from '../../../../TypeDocumentation'; import { getVersionFromParams } from '../../../getVersionFromParams'; export async function generateStaticParams() { - return getVersions() + return getVersionFromGitTag() .map((version) => Object.values(getTypeDefs(version).types).map((def) => ({ version, diff --git a/website/src/app/docs/[version]/page.tsx b/website/src/app/docs/[version]/page.tsx index aaaa1c535c..124eef6a4c 100644 --- a/website/src/app/docs/[version]/page.tsx +++ b/website/src/app/docs/[version]/page.tsx @@ -1,5 +1,5 @@ import { Metadata } from 'next'; -import { getVersions } from '../../../static/getVersions'; +import { getVersionFromGitTag } from '../../../static/getVersions'; import { getTypeDefs } from '../../../static/getTypeDefs'; import { DocOverview, getOverviewData } from '../../../DocOverview'; import { DocSearch } from '../../../DocSearch'; @@ -8,7 +8,7 @@ import { getSidebarLinks } from '../../../getSidebarLinks'; import { getVersionFromParams } from '../../getVersionFromParams'; export async function generateStaticParams() { - return [...getVersions().map((version) => ({ version }))]; + return [...getVersionFromGitTag().map((version) => ({ version }))]; } type Params = { @@ -40,7 +40,7 @@ export default async function OverviewDocPage(props: Props) {
-

Immutable.js ({version})

+

Immutable.js ({version})

diff --git a/website/src/app/docs/currentVersion.tsx b/website/src/app/docs/currentVersion.tsx new file mode 100644 index 0000000000..92f8c53754 --- /dev/null +++ b/website/src/app/docs/currentVersion.tsx @@ -0,0 +1,261 @@ +export const VERSION = 'v5'; + +export const SIDEBAR_LINKS = [ + { + label: 'List', + description: + 'Lists are ordered indexed dense collections, much like a JavaScript Array.', + url: `/docs/${VERSION}/List`, + }, + { + label: 'Map', + description: + 'Immutable Map is an unordered Collection.Keyed of (key, value) pairs with O(log32 N) gets and O(log32 N) persistent sets.', + url: `/docs/${VERSION}/Map`, + }, + { + label: 'OrderedMap', + description: + 'A type of Map that has the additional guarantee that the iteration order of entries will be the order in which they were set().', + url: `/docs/${VERSION}/OrdererMap`, + }, + { + label: 'Set', + description: 'A Collection of unique values with O(log32 N) adds and has.', + url: `/docs/${VERSION}/Set`, + }, + { + label: 'OrderedSet', + description: + 'A type of Set that has the additional guarantee that the iteration order of values will be the order in which they were added.', + url: `/docs/${VERSION}/OrderedSet`, + }, + { + label: 'Stack', + description: + 'Stacks are indexed collections which support very efficient O(1) addition and removal from the front using unshift(v) and shift().', + url: `/docs/${VERSION}/Stack`, + }, + { + label: 'Range()', + description: + 'Returns a Seq.Indexed of numbers from start (inclusive) to end (exclusive), by step, where start defaults to 0, step to 1, and end to infinity. When start is equal to end, returns empty range.', + url: `/docs/${VERSION}/Range()`, + }, + { + label: 'Repeat()', + description: + 'Returns a Seq.Indexed of value repeated times times. When times is not defined, returns an infinite Seq of value.', + url: `/docs/${VERSION}/Repeat()`, + }, + { + label: 'Record', + description: + 'A record is similar to a JS object, but enforces a specific set of allowed string keys, and has default values.', + url: `/docs/${VERSION}/Record`, + }, + { + label: 'Record.Factory', + description: + 'A Record.Factory is created by the Record() function. Record instances are created by passing it some of the accepted values for that Record type:', + url: `/docs/${VERSION}/Record.Factory`, + }, + { + label: 'Seq', + description: + 'Seq describes a lazy operation, allowing them to efficiently chain use of all the higher-order collection methods (such as map and filter) by not creating intermediate collections.', + url: `/docs/${VERSION}/Seq`, + }, + { + label: 'Seq.Keyed', + description: 'Seq which represents key-value pairs.', + url: `/docs/${VERSION}/Seq.Keyed`, + }, + { + label: 'Seq.Indexed', + description: 'Seq which represents an ordered indexed list of values.', + url: `/docs/${VERSION}/Seq.Indexed`, + }, + { + label: 'Seq.Set', + description: 'Seq which represents a set of values.', + url: `/docs/${VERSION}/Seq.Set`, + }, + { + label: 'Collection', + description: + 'The Collection is a set of (key, value) entries which can be iterated, and is the base class for all collections in immutable, allowing them to make use of all the Collection methods (such as map and filter).', + url: `/docs/${VERSION}/Collection`, + }, + { + label: 'Collection.Keyed', + description: 'Keyed Collections have discrete keys tied to each value.', + url: `/docs/${VERSION}/Collection.Keyed`, + }, + { + label: 'Collection.Indexed', + description: + "Indexed Collections have incrementing numeric keys. They exhibit slightly different behavior than Collection.Keyed for some methods in order to better mirror the behavior of JavaScript's Array, and add methods which do not make sense on non-indexed Collections such as indexOf.", + url: `/docs/${VERSION}/Collection.Indexed`, + }, + { + label: 'Collection.Set', + description: + 'Set Collections only represent values. They have no associated keys or indices. Duplicate values are possible in the lazy Seq.Sets, however the concrete Set Collection does not allow duplicate values.', + url: `/docs/${VERSION}/Collection.Set`, + }, + { + label: 'ValueObject', + description: '', + url: `/docs/${VERSION}/ValueObject`, + }, + { + label: 'OrderedCollection', + description: '', + url: `/docs/${VERSION}/OrderedCollection`, + }, + + // functions + { label: 'fromJS()', description: '', url: `/docs/${VERSION}/fromJS()` }, + { + label: 'is()', + description: + 'Value equality check with semantics similar to Object.is, but treats Immutable Collections as values, equal if the second Collection includes equivalent values.', + url: `/docs/${VERSION}/is()`, + }, + { + label: 'hash()', + description: + 'The hash() function is an important part of how Immutable determines if two values are equivalent and is used to determine how to store those values. Provided with any value, hash() will return a 31-bit integer.', + url: `/docs/${VERSION}/hash()`, + }, + { + label: 'isImmutable()', + description: 'True if maybeImmutable is an Immutable Collection or Record.', + url: `/docs/${VERSION}/isImmutable()`, + }, + { + label: 'isCollection()', + description: + 'True if maybeCollection is a Collection, or any of its subclasses.', + url: `/docs/${VERSION}/isCollection()`, + }, + { + label: 'isKeyed()', + description: + 'True if maybeKeyed is a Collection.Keyed, or any of its subclasses.', + url: `/docs/${VERSION}/isKeyed()`, + }, + { + label: 'isIndexed()', + description: + 'True if maybeIndexed is a Collection.Indexed, or any of its subclasses.', + url: `/docs/${VERSION}/isIndexed()`, + }, + { + label: 'isAssociative()', + description: + 'True if maybeAssociative is either a Keyed or Indexed Collection.', + url: `/docs/${VERSION}/isAssociative()`, + }, + { + label: 'isOrdered()', + description: '', + url: `/docs/${VERSION}/isOrdered()`, + }, + { + label: 'isValueObject()', + description: + 'True if maybeValue is a JavaScript Object which has both equals() and hashCode() methods.', + url: `/docs/${VERSION}/isValueObject()`, + }, + { + label: 'isSeq()', + description: 'True if maybeSeq is a Seq.', + url: `/docs/${VERSION}/isSeq()`, + }, + { + label: 'isList()', + description: 'True if maybeList is a List.', + url: `/docs/${VERSION}/isList()`, + }, + { + label: 'isMap()', + description: 'True if maybeMap is a Map.', + url: `/docs/${VERSION}/isMap()`, + }, + { + label: 'isOrderedMap()', + description: 'True if maybeOrderedMap is an OrderedMap.', + url: `/docs/${VERSION}/isOrderedMap()`, + }, + { + label: 'isStack()', + description: 'True if maybeStack is a Stack.', + url: `/docs/${VERSION}/isStack()`, + }, + { + label: 'isSet()', + description: 'True if maybeSet is a Set.', + url: `/docs/${VERSION}/isSet()`, + }, + { + label: 'isOrderedSet()', + description: 'True if maybeOrderedSet is an OrderedSet.', + url: `/docs/${VERSION}/isOrderedSet()`, + }, + { + label: 'isRecord()', + description: 'True if maybeRecord is a Record.', + url: `/docs/${VERSION}/isRecord()`, + }, + { + label: 'get()', + description: + 'Returns true if the key is defined in the provided collection.', + url: `/docs/${VERSION}/get()`, + }, + { label: 'has()', description: '', url: `/docs/${VERSION}/has()` }, + { label: 'remove()', description: '', url: `/docs/${VERSION}/remove()` }, + { label: 'set()', description: '', url: `/docs/${VERSION}/set()` }, + { label: 'update()', description: '', url: `/docs/${VERSION}/update()` }, + { label: 'getIn()', description: '', url: `/docs/${VERSION}/getIn()` }, + { label: 'hasIn()', description: '', url: `/docs/${VERSION}/hasIn()` }, + { + label: 'removeIn()', + description: + 'Returns a copy of the collection with the value at the key path removed.', + url: `/docs/${VERSION}/removeIn()`, + }, + { + label: 'setIn()', + description: + 'Returns a copy of the collection with the value at the key path set to the provided value.', + url: `/docs/${VERSION}/setIn()`, + }, + { label: 'updateIn()', description: '', url: `/docs/${VERSION}/updateIn()` }, + { + label: 'merge()', + description: + 'Returns a copy of the collection with the remaining collections merged in.', + url: `/docs/${VERSION}/merge()`, + }, + { + label: 'mergeWith()', + description: + 'Returns a copy of the collection with the remaining collections merged in, calling the merger function whenever an existing value is encountered.', + url: `/docs/${VERSION}/mergeWith()`, + }, + { + label: 'mergeDeep()', + description: + 'Like merge(), but when two compatible collections are encountered with the same key, it merges them as well, recursing deeply through the nested data. Two collections are considered to be compatible (and thus will be merged together) if they both fall into one of three categories: keyed (e.g., Maps, Records, and objects), indexed (e.g., Lists and arrays), or set-like (e.g., Sets). If they fall into separate categories, mergeDeep will replace the existing collection with the collection being merged in. This behavior can be customized by using mergeDeepWith().', + url: `/docs/${VERSION}/mergeDeep()`, + }, + { + label: 'mergeDeepWith()', + description: + 'Like mergeDeep(), but when two non-collections or incompatible collections are encountered at the same key, it uses the merger function to determine the resulting value. Collections are considered incompatible if they fall into separate categories between keyed, indexed, and set-like.', + url: `/docs/${VERSION}/mergeDeepWith()`, + }, +]; diff --git a/website/src/app/docs/v5/[type]/page.tsx b/website/src/app/docs/v5/[type]/page.tsx new file mode 100644 index 0000000000..326c86246c --- /dev/null +++ b/website/src/app/docs/v5/[type]/page.tsx @@ -0,0 +1,38 @@ +import { getDocFiles } from '../../../../utils/doc'; + +export async function generateStaticParams() { + const docFiles = getDocFiles(); + + return docFiles.map((file) => ({ + type: file.slug, + })); +} + +type Params = { + version: string; + type: string; +}; + +type Props = { + params: Promise; +}; + +export async function generateMetadata(props: Props) { + const params = await props.params; + + console.log('params', params); + + return { + title: `${params.type} — Immutable.js`, + }; +} + +export default async function TypeDocPage(props: Props) { + const params = await props.params; + + const { type } = params; + + const { default: MdxContent } = await import(`@/docs/${type}.mdx`); + + return ; +} diff --git a/website/src/app/docs/v5/layout.tsx b/website/src/app/docs/v5/layout.tsx new file mode 100644 index 0000000000..ca54797ef9 --- /dev/null +++ b/website/src/app/docs/v5/layout.tsx @@ -0,0 +1,32 @@ +import { SideBar } from '../../../Sidebar'; +import { DocSearch } from '../../../DocSearch'; +import { DocHeader } from '../../../DocHeader'; +import { ImmutableConsole } from '../../../ImmutableConsole'; +import { getVersions } from '../../../static/getVersions'; +import { VERSION } from '../currentVersion'; + +export default async function VersionLayout(props: { + children: React.ReactNode; + params: Promise<{ version: string }>; +}) { + const { children } = props; + + const versions = getVersions(); + + return ( +
+ + +
+
+ + +
+ + {children} +
+
+
+
+ ); +} diff --git a/website/src/app/docs/v5/page.tsx b/website/src/app/docs/v5/page.tsx new file mode 100644 index 0000000000..0134bbf098 --- /dev/null +++ b/website/src/app/docs/v5/page.tsx @@ -0,0 +1,36 @@ +import { Metadata } from 'next'; +import Link from 'next/link'; +import { SIDEBAR_LINKS, VERSION } from '../currentVersion'; + +export async function generateMetadata(): Promise { + return { + title: `Documentation v5 — Immutable.js`, + }; +} + +export default async function OverviewDocPage() { + const { default: MdxContent } = await import(`@/docs/Intro.mdx`); + + console.log('MdxContent', MdxContent); + + return ( + <> +
+

Immutable.js ({VERSION})

+ {/* */} + + + {SIDEBAR_LINKS.map((link) => ( +
+

+ {link.label} +

+
+

{link.description}

+
+
+ ))} +
+ + ); +} diff --git a/website/src/app/play/page.tsx b/website/src/app/play/page.tsx index b5599d9723..47406aabab 100644 --- a/website/src/app/play/page.tsx +++ b/website/src/app/play/page.tsx @@ -1,13 +1,11 @@ import { Metadata } from 'next'; -import { getVersions } from '../../static/getVersions'; -import { getTypeDefs } from '../../static/getTypeDefs'; import { DocSearch } from '../../DocSearch'; import { SideBar } from '../../Sidebar'; -import { getSidebarLinks } from '../../getSidebarLinks'; import Playground from './Playground'; +import { VERSION } from '../docs/currentVersion'; export async function generateStaticParams() { - return [...getVersions().map((version) => ({ version }))]; + // return [...getVersions().map((version) => ({ version }))]; } export async function generateMetadata(): Promise { @@ -17,18 +15,12 @@ export async function generateMetadata(): Promise { } export default function OverviewDocPage() { - const versions = getVersions(); - const version = versions[0]; - const defs = getTypeDefs(version); - - const sidebarLinks = getSidebarLinks(defs); - return ( <> - +
-

Playgroud ({version})

+

Playgroud (${VERSION})

You can share or bookmark the url to get access to this playground.
diff --git a/website/src/mdx-components.tsx b/website/src/mdx-components.tsx new file mode 100644 index 0000000000..2fa6b33e98 --- /dev/null +++ b/website/src/mdx-components.tsx @@ -0,0 +1,78 @@ +import type { MDXComponents } from 'mdx/types'; +import Prism from 'prismjs'; +import loadLanguages from 'prismjs/components/'; + +loadLanguages(['ts']); + +export function useMDXComponents(components: MDXComponents): MDXComponents { + return { + code: ({ className, children, ...rest }) => { + if (!className) { + // no classname : no need to handle syntax highlighting + return {children}; + } + + const language = className.replace('language-', ''); + const html = Prism.highlight( + String(children).trim(), + Prism.languages[language] || Prism.languages.plaintext, + language + ); + + return ( + + ); + }, + MemberLabel: ({ label, alias }: { label: string; alias?: string }) => { + return ( +
+

+ + {label} + § + +

+ {alias && ( + <> +

Alias:

+ {alias} + + )} +
+ ); + }, + See: ({ code }: { code: string }) => { + return ( + <> +

See

+ {code} + + ); + }, + Signature: ({ code }) => { + const language = 'ts'; + const html = Prism.highlight( + String(code).trim(), + Prism.languages[language], + language + ); + + return ( +
+

Method signature

+
+            
+          
+
+ ); + }, + ...components, + }; +} diff --git a/website/src/mdx-components/CodeLink.tsx b/website/src/mdx-components/CodeLink.tsx new file mode 100644 index 0000000000..5d3a2a6b90 --- /dev/null +++ b/website/src/mdx-components/CodeLink.tsx @@ -0,0 +1,18 @@ +import { JSX } from 'react'; + +type Props = { + to: string; + children?: React.ReactNode; +}; + +export default function CodeLink({ to, children }: Props): JSX.Element { + const href = to.includes('#') || to.startsWith('.') ? to : `#${to}`; + + const text = children || to.replace(/^[./]*/g, ''); + + return ( + + {text} + + ); +} diff --git a/website/src/repl/Editor.tsx b/website/src/repl/Editor.tsx index 532de7aff4..cc9f0681f5 100644 --- a/website/src/repl/Editor.tsx +++ b/website/src/repl/Editor.tsx @@ -1,6 +1,6 @@ import { useEffect, useRef, type JSX } from 'react'; -import { basicSetup } from 'codemirror'; -import { EditorView, keymap } from '@codemirror/view'; +import { basicSetup, minimalSetup } from 'codemirror'; +import { EditorView, gutter, keymap } from '@codemirror/view'; import { defaultKeymap, indentWithTab } from '@codemirror/commands'; import { EditorState, Extension } from '@codemirror/state'; import { javascript } from '@codemirror/lang-javascript'; @@ -10,7 +10,7 @@ import useDarkMode from '../useDarkMode'; type Props = { value: string; - onChange: (value: string) => void; + onChange?: (value: string) => void; }; export function Editor({ value, onChange }: Props): JSX.Element { @@ -18,22 +18,29 @@ export function Editor({ value, onChange }: Props): JSX.Element { const darkMode = useDarkMode(); const onUpdate = EditorView.updateListener.of((v) => { - onChange(v.state.doc.toString()); + if (onChange) { + onChange(v.state.doc.toString()); + } }); useEffect(() => { if (!editor.current) { return; } + + const readOnly = !onChange; + const startState = EditorState.create({ doc: value, + // readOnly: !onChange, extensions: [ - basicSetup, + readOnly ? minimalSetup : basicSetup, keymap.of([...defaultKeymap, indentWithTab]), javascript(), darkMode ? oneDark : undefined, - - onUpdate, + readOnly ? undefined : onUpdate, + EditorState.readOnly.of(readOnly), + readOnly ? gutter({}) : undefined, ].filter( (value: Extension | undefined): value is Extension => typeof value !== 'undefined' @@ -50,5 +57,5 @@ export function Editor({ value, onChange }: Props): JSX.Element { }; }, [darkMode]); - return
; + return
; } diff --git a/website/src/repl/FormatterOutput.tsx b/website/src/repl/FormatterOutput.tsx index a27b9d44d1..26f86043ca 100644 --- a/website/src/repl/FormatterOutput.tsx +++ b/website/src/repl/FormatterOutput.tsx @@ -9,13 +9,13 @@ import { Element, JsonMLElementList } from '../worker/jsonml-types'; * The `jsonml-html` package can convert jsonml to HTML. */ type Props = { - output: JsonMLElementList | Element; + output: undefined | JsonMLElementList | Element; }; export default function FormatterOutput({ output }: Props): JSX.Element { const header = useRef(null); - const htmlHeader = toHTML(output); + const htmlHeader = output ? toHTML(output) : undefined; useEffect(() => { if (header.current && htmlHeader) { diff --git a/website/src/repl/Repl.tsx b/website/src/repl/Repl.tsx index dc5f7868ec..e702fe5571 100644 --- a/website/src/repl/Repl.tsx +++ b/website/src/repl/Repl.tsx @@ -6,9 +6,13 @@ import FormatterOutput from './FormatterOutput'; import './repl.css'; import { Element, JsonMLElementList } from '../worker/jsonml-types'; -type Props = { defaultValue: string; onRun?: (code: string) => void }; +type Props = { + defaultValue: string; + onRun?: (code: string) => void; + imports?: Array; +}; -function Repl({ defaultValue, onRun }: Props): JSX.Element { +function Repl({ defaultValue, onRun, imports }: Props): JSX.Element { const [code, setCode] = useState(defaultValue); const [output, setOutput] = useState([]); const workerRef = useRef(null); @@ -30,13 +34,17 @@ function Repl({ defaultValue, onRun }: Props): JSX.Element { const runCode = () => { if (workerRef.current) { + // ignore import statements as we do unpack all immutable data in the worker + // but it might be useful in the documentation + const cleanedCode = code; // .replace(/^import.*/m, ''); + // notify parent if (onRun) { - onRun(code); + onRun(cleanedCode); } // send message to worker - workerRef.current.postMessage(code); + workerRef.current.postMessage(cleanedCode); workerRef.current.onmessage = (event) => { if (event.data.error) { setOutput(['div', 'Error: ' + event.data.error]); @@ -58,16 +66,26 @@ function Repl({ defaultValue, onRun }: Props): JSX.Element {

Live example

- +
+ {imports && ( + + )} + + +
-
-        
-      
+ {output && ( +
+          
+        
+ )}
); } diff --git a/website/src/repl/repl.css b/website/src/repl/repl.css index 0a64e04596..aba5313646 100644 --- a/website/src/repl/repl.css +++ b/website/src/repl/repl.css @@ -11,7 +11,7 @@ border: 1px solid var(--code-block-bg-color); } -textarea { +.js-repl textarea { width: 100%; height: 100px; margin-bottom: 10px; @@ -23,7 +23,7 @@ textarea { resize: none; } -button { +.js-repl button { padding: 10px 15px; font-size: 14px; background-color: var(--link-color); @@ -33,11 +33,11 @@ button { cursor: pointer; } -button:hover { +.js-repl button:hover { background-color: var(--link-hover-color); } -pre { +.js-repl pre.repl-output { background-color: var(--code-block-bg-color); padding: 10px; border: 1px solid #ccc; diff --git a/website/src/static/genMarkdownDoc.ts b/website/src/static/genMarkdownDoc.ts index 0180c9ffb6..5e16fd48b4 100644 --- a/website/src/static/genMarkdownDoc.ts +++ b/website/src/static/genMarkdownDoc.ts @@ -1,11 +1,28 @@ import { markdown } from './markdown'; -import { getTypeDefs } from './getTypeDefs'; +import { SIDEBAR_LINKS } from '../app/docs/currentVersion'; export function genMarkdownDoc(version: string, typeDefSource: string): string { return markdown( typeDefSource .replace(/\n[^\n]+?Build Status[^\n]+?\n/, '\n') .replace('website/public', ''), - { defs: getTypeDefs(version) } + { + defs: { + version, + types: Object.fromEntries( + SIDEBAR_LINKS.map((link) => { + const qualifiedName = link.label.replace(/\(\)$/g, ''); + return [ + qualifiedName, + { + qualifiedName, + label: link.label, + url: link.url, + }, + ]; + }) + ), + }, + } ); } diff --git a/website/src/static/getVersions.js b/website/src/static/getVersions.js index ea34e81903..2e794ce128 100644 --- a/website/src/static/getVersions.js +++ b/website/src/static/getVersions.js @@ -2,30 +2,44 @@ const { execSync } = require('child_process'); let versions; +let versionsFromGitTag; /** @returns {Array} */ function getVersions() { if (!versions) { - const tags = execSync('git tag -l --sort=-creatordate', { - encoding: 'utf8', - }).split('\n'); - const latestV5Tag = tags.find((t) => t.match(/^v?5/)); - const latestV4Tag = tags.find((t) => t.match(/^v?4/)); - const latestV3Tag = tags.find((t) => t.match(/^v?3/)); - versions = []; - if (latestV5Tag) { - versions.push(latestV5Tag); - } - if (latestV4Tag) { - versions.push(latestV4Tag); - } - if (latestV3Tag) { - versions.push(latestV3Tag); - } - versions.push('latest@main'); + // VERSION does not work in sitemap generation + versions = ['v5'].concat(getVersionFromGitTag()); } return versions; } +/** @returns {Array} */ +function getVersionFromGitTag() { + if (versionsFromGitTag) { + return versionsFromGitTag; + } + + let versions = []; + const tags = execSync('git tag -l --sort=-creatordate', { + encoding: 'utf8', + }).split('\n'); + // const latestV5Tag = tags.find((t) => t.match(/^v?5/)); + const latestV4Tag = tags.find((t) => t.match(/^v?4/)); + const latestV3Tag = tags.find((t) => t.match(/^v?3/)); + + if (latestV4Tag) { + versions.push(latestV4Tag); + } + if (latestV3Tag) { + versions.push(latestV3Tag); + } + + versionsFromGitTag = versions; + + return versions; +} + // eslint-disable-next-line no-undef exports.getVersions = getVersions; +// eslint-disable-next-line no-undef +exports.getVersionFromGitTag = getVersionFromGitTag; diff --git a/website/src/utils/doc.tsx b/website/src/utils/doc.tsx new file mode 100644 index 0000000000..d519730bb4 --- /dev/null +++ b/website/src/utils/doc.tsx @@ -0,0 +1,26 @@ +import fs from 'node:fs'; +import path from 'node:path'; + +function getMDXFiles(dir: string): Array { + return fs.readdirSync(dir).filter((file) => path.extname(file) === '.mdx'); +} + +function getMDXData(dir: string): Array<{ slug: string }> { + const files = getMDXFiles(dir); + + console.log('files', files); + + return files.map((file) => { + const slug = path.basename(file, path.extname(file)); + + return { + slug, + }; + }); +} + +export function getDocFiles() { + const docsDir = path.join(process.cwd(), 'docs'); + + return getMDXData(docsDir); +} diff --git a/website/src/worker/index.ts b/website/src/worker/index.ts index a668d3a19b..1df4dc9eea 100644 --- a/website/src/worker/index.ts +++ b/website/src/worker/index.ts @@ -87,9 +87,48 @@ self.onmessage = function (event) { }, 2000); try { - const result = eval(event.data); + // track globalThis variables to remove them later + + // if (!globalThis.globalThisKeysBefore) { + // globalThis.globalThisKeysBefore = [...Object.keys(globalThis)]; + // } + + const code = event.data; + + // track const and let variables into global scope to record them + + // it might make a userland code fail with a conflict. + + // We might want to indicate the user in the REPL that they should not use let/const if they want to have the result returned + + // code = code.replace(/^(const|let|var) /gm, ''); + + const result = eval(code); + + // const globalThisKeys = Object.keys(globalThis).filter((key) => { + + // return !globalThisKeysBefore.includes(key) && key !== 'globalThisKeysBefore'; + + // }); + + // console.log(globalThisKeys) + clearTimeout(timeoutId); + // TODO handle more than one result + + // if (!result) { + + // // result = globalThis[globalThisKeys[0]]; + + // result = globalThisKeys.map((key) => { + + // globalThis[key]; + + // }); + + // } + self.postMessage({ output: normalizeResult(immutableFormaters, result) }); } catch (error) { console.log(error); diff --git a/website/styles/globals.css b/website/styles/globals.css index b1efab8675..fcd08657db 100644 --- a/website/styles/globals.css +++ b/website/styles/globals.css @@ -13,6 +13,7 @@ body { --body-color: #626466; --code-block-bg-color: #f4f4f4; --code-block-color: #484a4c; + --anchor-link-color: #9ca0a3; background-color: #ffffff; color: var(--body-color); @@ -35,6 +36,7 @@ body { --body-color: #c0c0c0; --code-block-bg-color: #2e2e2e; --code-block-color: #d1d5da; + --anchor-link-color: #616161; background-color: #121212; } @@ -64,8 +66,24 @@ h6 { color: var(--header-color); } +h1 { + color: light-dark(#555, #fff); + font-size: 1.5em; + margin: 1rem 0; + font-weight: bold; +} + +h1.mainTitle { + font-size: 2em; + margin: 1.34rem 0; +} + h2 { - margin: 4rem 0 1rem; + margin: 4rem 0 1 rem; + color: #9a9c9e; + font-size: 1.5em; + font-weight: 300; + margin: 3rem 0 2rem; } h3 { @@ -74,9 +92,11 @@ h3 { h4 { margin: 1rem 0 0; + color: var(--body-color); } -a { +a, +a > code { color: var(--link-color); text-decoration: none; } @@ -116,6 +136,7 @@ blockquote > :last-child { /* Markdown */ +pre > code, .codeBlock { -webkit-overflow-scrolling: touch; background: var(--code-block-bg-color); @@ -174,6 +195,7 @@ a.try-it { .contents > .docContents { flex-grow: 1; + max-width: calc(1024px - 340px); /* contents width minus sidebar */ } img { @@ -518,14 +540,6 @@ img { background-color: rgba(112, 170, 220, 0.2); } -.typeHeader { - color: light-dark(#555, #fff); - font-size: 1.5em; - font-weight: normal; - margin: 1rem 0; - font-weight: bold; -} - .interfaceMember { padding-top: 4rem; margin-top: -5rem; @@ -596,3 +610,13 @@ img { p:last-child { margin-bottom: 0; } + +.memberLabel .anchorLink { + display: none; + margin-left: 0.25em; + color: var(--anchor-link-color); +} + +.memberLabel:hover .anchorLink { + display: inline; +} diff --git a/website/tsconfig.json b/website/tsconfig.json index 1fa50167bb..182bdd6a14 100644 --- a/website/tsconfig.json +++ b/website/tsconfig.json @@ -14,6 +14,11 @@ "isolatedModules": true, "jsx": "preserve", "incremental": true, + "baseUrl": "src/", + "paths": { + "@/docs/*": ["../docs/*"], + "@/*": ["./*"] + }, "plugins": [ { "name": "next" From 2b47de5c967b6b1e0cc68f391635c3a3c44752db Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Fri, 23 May 2025 22:13:27 +0000 Subject: [PATCH 28/59] Remove runkit --- README.md | 94 +-- src/functional/get.ts | 9 - src/functional/getIn.ts | 8 - src/functional/has.ts | 10 - src/functional/hasIn.ts | 8 - src/functional/remove.ts | 12 - src/functional/removeIn.ts | 9 - src/functional/set.ts | 12 - src/functional/setIn.ts | 9 - src/functional/update.ts | 12 - src/functional/updateIn.ts | 9 - type-definitions/immutable.d.ts | 1123 +------------------------------ website/src/RunkitEmbed.tsx | 153 ----- website/src/static/markdown.ts | 33 - 14 files changed, 33 insertions(+), 1468 deletions(-) delete mode 100644 website/src/RunkitEmbed.tsx diff --git a/README.md b/README.md index b9216576fa..e823a42136 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,6 @@ bun add immutable Then require it into any module. - - ```js const { Map } = require('immutable'); const map1 = Map({ a: 1, b: 2, c: 3 }); @@ -136,8 +134,6 @@ lib. Include either `"target": "es2015"` or `"lib": "es2015"` in your `tsconfig.json`, or provide `--target es2015` or `--lib es2015` to the `tsc` command. - - ```js const { Map } = require('immutable'); const map1 = Map({ a: 1, b: 2, c: 3 }); @@ -187,8 +183,6 @@ treat Immutable.js collections as values, it's important to use the `Immutable.is()` function or `.equals()` method to determine _value equality_ instead of the `===` operator which determines object _reference identity_. - - ```js const { Map } = require('immutable'); const map1 = Map({ a: 1, b: 2, c: 3 }); @@ -205,8 +199,6 @@ which would prefer to re-run the function if a deeper equality check could potentially be more costly. The `===` equality check is also used internally by `Immutable.is` and `.equals()` as a performance optimization. - - ```js const { Map } = require('immutable'); const map1 = Map({ a: 1, b: 2, c: 3 }); @@ -219,8 +211,6 @@ to it instead of copying the entire object. Because a reference is much smaller than the object itself, this results in memory savings and a potential boost in execution speed for programs which rely on copies (such as an undo-stack). - - ```js const { Map } = require('immutable'); const map = Map({ a: 1, b: 2, c: 3 }); @@ -230,7 +220,6 @@ const mapCopy = map; // Look, "copies" are free! [React]: https://reactjs.org/ [Flux]: https://facebook.github.io/flux/docs/in-depth-overview/ - ## JavaScript-first API While Immutable.js is inspired by Clojure, Scala, Haskell and other functional @@ -248,8 +237,6 @@ the collection, like `push`, `set`, `unshift` or `splice`, instead return a new immutable collection. Methods which return new arrays, like `slice` or `concat`, instead return new immutable collections. - - ```js const { List } = require('immutable'); const list1 = List([1, 2]); @@ -268,8 +255,6 @@ Almost all of the methods on [Array][] will be found in similar form on found on `Immutable.Set`, including collection operations like `forEach()` and `map()`. - - ```js const { Map } = require('immutable'); const alpha = Map({ a: 1, b: 2, c: 3, d: 4 }); @@ -283,8 +268,6 @@ Designed to inter-operate with your existing JavaScript, Immutable.js accepts plain JavaScript Arrays and Objects anywhere a method expects a `Collection`. - - ```js const { Map, List } = require('immutable'); const map1 = Map({ a: 1, b: 2, c: 3, d: 4 }); @@ -305,13 +288,11 @@ collection methods on JavaScript Objects, which otherwise have a very sparse native API. Because Seq evaluates lazily and does not cache intermediate results, these operations can be extremely efficient. - - ```js const { Seq } = require('immutable'); const myObject = { a: 1, b: 2, c: 3 }; Seq(myObject) - .map(x => x * x) + .map((x) => x * x) .toObject(); // { a: 1, b: 4, c: 9 } ``` @@ -320,8 +301,6 @@ Keep in mind, when using JS objects to construct Immutable Maps, that JavaScript Object properties are always strings, even if written in a quote-less shorthand, while Immutable Maps accept keys of any type. - - ```js const { fromJS } = require('immutable'); @@ -345,8 +324,6 @@ All Immutable Collections also implement `toJSON()` allowing them to be passed to `JSON.stringify` directly. They also respect the custom `toJSON()` methods of nested objects. - - ```js const { Map, List } = require('immutable'); const deep = Map({ a: 1, b: 2, c: List([3, 4, 5]) }); @@ -369,7 +346,7 @@ browsers, they need to be translated to ES5. ```js // ES2015 -const mapped = foo.map(x => x * x); +const mapped = foo.map((x) => x * x); // ES5 var mapped = foo.map(function (x) { return x * x; @@ -379,8 +356,6 @@ var mapped = foo.map(function (x) { All Immutable.js collections are [Iterable][iterators], which allows them to be used anywhere an Iterable is expected, such as when spreading into an Array. - - ```js const { List } = require('immutable'); const aList = List([1, 2, 3]); @@ -395,14 +370,11 @@ not always be well defined, as is the case for the `Map` and `Set`. [Classes]: https://wiki.ecmascript.org/doku.php?id=strawman:maximally_minimal_classes [Modules]: https://www.2ality.com/2014/09/es6-modules-final.html - ## Nested Structures The collections in Immutable.js are intended to be nested, allowing for deep trees of data, similar to JSON. - - ```js const { fromJS } = require('immutable'); const nested = fromJS({ a: { b: { c: [3, 4, 5] } } }); @@ -413,8 +385,6 @@ A few power-tools allow for reading and operating on nested data. The most useful are `mergeDeep`, `getIn`, `setIn`, and `updateIn`, found on `List`, `Map` and `OrderedMap`. - - ```js const { fromJS } = require('immutable'); const nested = fromJS({ a: { b: { c: [3, 4, 5] } } }); @@ -424,11 +394,11 @@ const nested2 = nested.mergeDeep({ a: { b: { d: 6 } } }); console.log(nested2.getIn(['a', 'b', 'd'])); // 6 -const nested3 = nested2.updateIn(['a', 'b', 'd'], value => value + 1); +const nested3 = nested2.updateIn(['a', 'b', 'd'], (value) => value + 1); console.log(nested3); // Map { a: Map { b: Map { c: List [ 3, 4, 5 ], d: 7 } } } -const nested4 = nested3.updateIn(['a', 'b', 'c'], list => list.push(6)); +const nested4 = nested3.updateIn(['a', 'b', 'c'], (list) => list.push(6)); // Map { a: Map { b: Map { c: List [ 3, 4, 5, 6 ], d: 7 } } } ``` @@ -443,8 +413,6 @@ determines if two variables represent references to the same object instance. Consider the example below where two identical `Map` instances are not _reference equal_ but are _value equal_. - - ```js // First consider: const obj1 = { a: 1, b: 2, c: 3 }; @@ -462,8 +430,6 @@ is(map1, map2); // alternatively can use the is() function Value equality allows Immutable.js collections to be used as keys in Maps or values in Sets, and retrieved with different but equivalent collections: - - ```js const { Map, Set } = require('immutable'); const map1 = Map({ a: 1, b: 2, c: 3 }); @@ -502,8 +468,6 @@ When possible, Immutable.js avoids creating new objects for updates where no change in _value_ occurred, to allow for efficient _reference equality_ checking to quickly determine if no change occurred. - - ```js const { Map } = require('immutable'); const originalMap = Map({ a: 1, b: 2, c: 3 }); @@ -515,8 +479,6 @@ However updates which do result in a change will return a new reference. Each of these operations occur independently, so two similar updates will not return the same reference: - - ```js const { Map } = require('immutable'); const originalMap = Map({ a: 1, b: 2, c: 3 }); @@ -549,8 +511,6 @@ exactly how Immutable.js applies complex mutations itself. As an example, building `list2` results in the creation of 1, not 3, new immutable Lists. - - ```js const { List } = require('immutable'); const list1 = List([1, 2, 3]); @@ -592,8 +552,8 @@ For example, the following performs no work, because the resulting ```js const { Seq } = require('immutable'); const oddSquares = Seq([1, 2, 3, 4, 5, 6, 7, 8]) - .filter(x => x % 2 !== 0) - .map(x => x * x); + .filter((x) => x % 2 !== 0) + .map((x) => x * x); ``` Once the `Seq` is used, it performs only the work necessary. In this @@ -606,8 +566,6 @@ oddSquares.get(1); // 9 Any collection can be converted to a lazy Seq with `Seq()`. - - ```js const { Map, Seq } = require('immutable'); const map = Map({ a: 1, b: 2, c: 3 }); @@ -620,7 +578,7 @@ expression of logic that can otherwise be very tedious: ```js lazySeq .flip() - .map(key => key.toUpperCase()) + .map((key) => key.toUpperCase()) .flip(); // Seq { A: 1, B: 2, C: 3 } ``` @@ -628,14 +586,12 @@ lazySeq As well as expressing logic that would otherwise seem memory or time limited, for example `Range` is a special kind of Lazy sequence. - - ```js const { Range } = require('immutable'); Range(1, Infinity) .skip(1000) - .map(n => -n) - .filter(n => n % 2 === 0) + .map((n) => -n) + .filter((n) => n % 2 === 0) .take(2) .reduce((r, n) => r * n, 1); // 1006008 @@ -646,8 +602,8 @@ Range(1, Infinity) The `filter()`, `groupBy()`, and `partition()` methods are similar in that they all divide a collection into parts based on applying a function to each element. All three call the predicate or grouping function once for each item in the -input collection. All three return zero or more collections of the same type as -their input. The returned collections are always distinct from the input +input collection. All three return zero or more collections of the same type as +their input. The returned collections are always distinct from the input (according to `===`), even if the contents are identical. Of these methods, `filter()` is the only one that is lazy and the only one which @@ -658,21 +614,21 @@ methods to form a pipeline of operations. The `partition()` method is similar to an eager version of `filter()`, but it returns two collections; the first contains the items that would have been discarded by `filter()`, and the second contains the items that would have been -kept. It always returns an array of exactly two collections, which can make it -easier to use than `groupBy()`. Compared to making two separate calls to +kept. It always returns an array of exactly two collections, which can make it +easier to use than `groupBy()`. Compared to making two separate calls to `filter()`, `partition()` makes half as many calls it the predicate passed to it. The `groupBy()` method is a more generalized version of `partition()` that can -group by an arbitrary function rather than just a predicate. It returns a map +group by an arbitrary function rather than just a predicate. It returns a map with zero or more entries, where the keys are the values returned by the grouping function, and the values are nonempty collections of the corresponding -arguments. Although `groupBy()` is more powerful than `partition()`, it can be +arguments. Although `groupBy()` is more powerful than `partition()`, it can be harder to use because it is not always possible predict in advance how many entries the returned map will have and what their keys will be. | Summary | `filter` | `partition` | `groupBy` | -|:------------------------------|:---------|:------------|:---------------| +| :---------------------------- | :------- | :---------- | :------------- | | ease of use | easiest | moderate | hardest | | generality | least | moderate | most | | laziness | lazy | eager | eager | @@ -684,49 +640,63 @@ entries the returned map will have and what their keys will be. ## Additional Tools and Resources - [Atom-store](https://github.com/jameshopkins/atom-store/) + - A Clojure-inspired atom implementation in Javascript with configurability for external persistance. - [Chai Immutable](https://github.com/astorije/chai-immutable) + - If you are using the [Chai Assertion Library](https://chaijs.com/), this provides a set of assertions to use against Immutable.js collections. - [Fantasy-land](https://github.com/fantasyland/fantasy-land) + - Specification for interoperability of common algebraic structures in JavaScript. - [Immutagen](https://github.com/pelotom/immutagen) + - A library for simulating immutable generators in JavaScript. - [Immutable-cursor](https://github.com/redbadger/immutable-cursor) + - Immutable cursors incorporating the Immutable.js interface over - Clojure-inspired atom. + Clojure-inspired atom. - [Immutable-ext](https://github.com/DrBoolean/immutable-ext) + - Fantasyland extensions for immutablejs - [Immutable-js-tools](https://github.com/madeinfree/immutable-js-tools) + - Util tools for immutable.js - [Immutable-Redux](https://github.com/gajus/redux-immutable) + - redux-immutable is used to create an equivalent function of Redux - combineReducers that works with Immutable.js state. + combineReducers that works with Immutable.js state. - [Immutable-Treeutils](https://github.com/lukasbuenger/immutable-treeutils) + - Functional tree traversal helpers for ImmutableJS data structures. - [Irecord](https://github.com/ericelliott/irecord) + - An immutable store that exposes an RxJS observable. Great for React. - [Mudash](https://github.com/brianneisler/mudash) + - Lodash wrapper providing Immutable.JS support. - [React-Immutable-PropTypes](https://github.com/HurricaneJames/react-immutable-proptypes) + - PropType validators that work with Immutable.js. - [Redux-Immutablejs](https://github.com/indexiatech/redux-immutablejs) + - Redux Immutable facilities. - [Rxstate](https://github.com/yamalight/rxstate) + - Simple opinionated state management library based on RxJS and Immutable.js. - [Transit-Immutable-js](https://github.com/glenjamin/transit-immutable-js) diff --git a/src/functional/get.ts b/src/functional/get.ts index e6306b8f58..9ec97d8070 100644 --- a/src/functional/get.ts +++ b/src/functional/get.ts @@ -8,15 +8,6 @@ import { has } from './has'; * * A functional alternative to `collection.get(key)` which will also work on * plain Objects and Arrays as an alternative for `collection[key]`. - * - * - * ```js - * import { get } from 'immutable'; - * - * get([ 'dog', 'frog', 'cat' ], 1) // 'frog' - * get({ x: 123, y: 456 }, 'x') // 123 - * get({ x: 123, y: 456 }, 'z', 'ifNotSet') // 'ifNotSet' - * ``` */ export function get(collection: Collection, key: K): V | undefined; export function get( diff --git a/src/functional/getIn.ts b/src/functional/getIn.ts index 11f9cdf384..080e07238a 100644 --- a/src/functional/getIn.ts +++ b/src/functional/getIn.ts @@ -14,14 +14,6 @@ type Key = GetTypeParameters[1]; * * A functional alternative to `collection.getIn(keypath)` which will also * work with plain Objects and Arrays. - * - * - * ```js - * import { getIn } from 'immutable'; - * - * getIn({ x: { y: { z: 123 }}}, ['x', 'y', 'z']) // 123 - * getIn({ x: { y: { z: 123 }}}, ['x', 'q', 'p'], 'ifNotSet') // 'ifNotSet' - * ``` */ export function getIn( collection: CollectionType, diff --git a/src/functional/has.ts b/src/functional/has.ts index 322370314e..09a1620275 100644 --- a/src/functional/has.ts +++ b/src/functional/has.ts @@ -8,16 +8,6 @@ import isDataStructure from '../utils/isDataStructure'; * A functional alternative to `collection.has(key)` which will also work with * plain Objects and Arrays as an alternative for * `collection.hasOwnProperty(key)`. - * - * - * ```js - * import { has } from 'immutable'; - * - * has([ 'dog', 'frog', 'cat' ], 2) // true - * has([ 'dog', 'frog', 'cat' ], 5) // false - * has({ x: 123, y: 456 }, 'x') // true - * has({ x: 123, y: 456 }, 'z') // false - * ``` */ export function has(collection: object, key: unknown): boolean { return isImmutable(collection) diff --git a/src/functional/hasIn.ts b/src/functional/hasIn.ts index 28041a7323..30e6a0e781 100644 --- a/src/functional/hasIn.ts +++ b/src/functional/hasIn.ts @@ -8,14 +8,6 @@ type GetInParameters = Parameters; * * A functional alternative to `collection.hasIn(keypath)` which will also * work with plain Objects and Arrays. - * - * - * ```js - * import { hasIn } from 'immutable'; - * - * hasIn({ x: { y: { z: 123 }}}, ['x', 'y', 'z']) // true - * hasIn({ x: { y: { z: 123 }}}, ['x', 'q', 'p']) // false - * ``` */ export function hasIn( collection: GetInParameters[0], diff --git a/src/functional/remove.ts b/src/functional/remove.ts index 60aff0fa36..970384dce6 100644 --- a/src/functional/remove.ts +++ b/src/functional/remove.ts @@ -10,18 +10,6 @@ import shallowCopy from '../utils/shallowCopy'; * A functional alternative to `collection.remove(key)` which will also work * with plain Objects and Arrays as an alternative for * `delete collectionCopy[key]`. - * - * - * ```js - * import { remove } from 'immutable'; - * - * const originalArray = [ 'dog', 'frog', 'cat' ] - * remove(originalArray, 1) // [ 'dog', 'cat' ] - * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] - * const originalObject = { x: 123, y: 456 } - * remove(originalObject, 'x') // { y: 456 } - * console.log(originalObject) // { x: 123, y: 456 } - * ``` */ export function remove>( collection: C, diff --git a/src/functional/removeIn.ts b/src/functional/removeIn.ts index 3b97be0dcd..70155a359a 100644 --- a/src/functional/removeIn.ts +++ b/src/functional/removeIn.ts @@ -7,15 +7,6 @@ import type { KeyPath } from '../../type-definitions/immutable'; * * A functional alternative to `collection.removeIn(keypath)` which will also * work with plain Objects and Arrays. - * - * - * ```js - * import { removeIn } from 'immutable'; - * - * const original = { x: { y: { z: 123 }}} - * removeIn(original, ['x', 'y', 'z']) // { x: { y: {}}} - * console.log(original) // { x: { y: { z: 123 }}} - * ``` */ export function removeIn< K extends PropertyKey, diff --git a/src/functional/set.ts b/src/functional/set.ts index e8e688abd0..2f1d41dd5b 100644 --- a/src/functional/set.ts +++ b/src/functional/set.ts @@ -11,18 +11,6 @@ import shallowCopy from '../utils/shallowCopy'; * A functional alternative to `collection.set(key, value)` which will also * work with plain Objects and Arrays as an alternative for * `collectionCopy[key] = value`. - * - * - * ```js - * import { set } from 'immutable'; - * - * const originalArray = [ 'dog', 'frog', 'cat' ] - * set(originalArray, 1, 'cow') // [ 'dog', 'cow', 'cat' ] - * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] - * const originalObject = { x: 123, y: 456 } - * set(originalObject, 'x', 789) // { x: 789, y: 456 } - * console.log(originalObject) // { x: 123, y: 456 } - * ``` */ export function set>( collection: C, diff --git a/src/functional/setIn.ts b/src/functional/setIn.ts index 7955e3e38d..f1590a03f1 100644 --- a/src/functional/setIn.ts +++ b/src/functional/setIn.ts @@ -8,15 +8,6 @@ import type { KeyPath } from '../../type-definitions/immutable'; * * A functional alternative to `collection.setIn(keypath)` which will also * work with plain Objects and Arrays. - * - * - * ```js - * import { setIn } from 'immutable'; - * - * const original = { x: { y: { z: 123 }}} - * setIn(original, ['x', 'y', 'z'], 456) // { x: { y: { z: 456 }}} - * console.log(original) // { x: { y: { z: 123 }}} - * ``` */ export function setIn< K extends PropertyKey, diff --git a/src/functional/update.ts b/src/functional/update.ts index 81d5426539..b073b5a1c2 100644 --- a/src/functional/update.ts +++ b/src/functional/update.ts @@ -11,18 +11,6 @@ type UpdaterFunctionWithNSV = (value: V | NSV) => V; * A functional alternative to `collection.update(key, fn)` which will also * work with plain Objects and Arrays as an alternative for * `collectionCopy[key] = fn(collection[key])`. - * - * - * ```js - * import { update } from 'immutable'; - * - * const originalArray = [ 'dog', 'frog', 'cat' ] - * update(originalArray, 1, val => val.toUpperCase()) // [ 'dog', 'FROG', 'cat' ] - * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] - * const originalObject = { x: 123, y: 456 } - * update(originalObject, 'x', val => val * 6) // { x: 738, y: 456 } - * console.log(originalObject) // { x: 123, y: 456 } - * ``` */ export function update>( collection: C, diff --git a/src/functional/updateIn.ts b/src/functional/updateIn.ts index 99eed7980e..8c3cf1c1cc 100644 --- a/src/functional/updateIn.ts +++ b/src/functional/updateIn.ts @@ -20,15 +20,6 @@ import type { * * A functional alternative to `collection.updateIn(keypath)` which will also * work with plain Objects and Arrays. - * - * - * ```js - * import { updateIn } from 'immutable' - * - * const original = { x: { y: { z: 123 }}} - * updateIn(original, ['x', 'y', 'z'], val => val * 6) // { x: { y: { z: 738 }}} - * console.log(original) // { x: { y: { z: 123 }}} - * ``` */ export type PossibleCollection = diff --git a/type-definitions/immutable.d.ts b/type-definitions/immutable.d.ts index 27567b5b03..b545b80f96 100644 --- a/type-definitions/immutable.d.ts +++ b/type-definitions/immutable.d.ts @@ -195,34 +195,13 @@ declare namespace Immutable { namespace List { /** * True if the provided value is a List - * - * - * ```js - * const { List } = require('immutable'); - * List.isList([]); // false - * List.isList(List()); // true - * ``` */ function isList(maybeList: unknown): maybeList is List; /** * Creates a new List containing `values`. * - * - * ```js - * const { List } = require('immutable'); - * List.of(1, 2, 3, 4) - * // List [ 1, 2, 3, 4 ] - * ``` - * * Note: Values are not altered or converted in any way. - * - * - * ```js - * const { List } = require('immutable'); - * List.of({x:1}, 2, [3], 4) - * // List [ { x: 1 }, 2, [ 3 ], 4 ] - * ``` */ function of(...values: Array): List; } @@ -233,30 +212,6 @@ declare namespace Immutable { * * Note: `List` is a factory function and not a class, and does not use the * `new` keyword during construction. - * - * - * ```js - * const { List, Set } = require('immutable') - * - * const emptyList = List() - * // List [] - * - * const plainArray = [ 1, 2, 3, 4 ] - * const listFromPlainArray = List(plainArray) - * // List [ 1, 2, 3, 4 ] - * - * const plainSet = Set([ 1, 2, 3, 4 ]) - * const listFromPlainSet = List(plainSet) - * // List [ 1, 2, 3, 4 ] - * - * const arrayIterator = plainArray[Symbol.iterator]() - * const listFromCollectionArray = List(arrayIterator) - * // List [ 1, 2, 3, 4 ] - * - * listFromPlainArray.equals(listFromCollectionArray) // true - * listFromPlainSet.equals(listFromCollectionArray) // true - * listFromPlainSet.equals(listFromPlainArray) // true - * ``` */ function List(collection?: Iterable | ArrayLike): List; @@ -278,23 +233,6 @@ declare namespace Immutable { * If `index` larger than `size`, the returned List's `size` will be large * enough to include the `index`. * - * - * ```js - * const originalList = List([ 0 ]); - * // List [ 0 ] - * originalList.set(1, 1); - * // List [ 0, 1 ] - * originalList.set(0, 'overwritten'); - * // List [ "overwritten" ] - * originalList.set(2, 2); - * // List [ 0, undefined, 2 ] - * - * List().set(50000, 'value').size; - * // 50001 - * ``` - * * Note: `set` can be used in `withMutations`. */ set(index: number, value: T): List; @@ -311,14 +249,6 @@ declare namespace Immutable { * * Note: `delete` cannot be safely used in IE8 * - * - * ```js - * List([ 0, 1, 2, 3, 4 ]).delete(0); - * // List [ 1, 2, 3, 4 ] - * ``` - * * Since `delete()` re-indexes values, it produces a complete copy, which * has `O(N)` complexity. * @@ -335,14 +265,6 @@ declare namespace Immutable { * * This is synonymous with `list.splice(index, 0, value)`. * - * - * ```js - * List([ 0, 1, 2, 3, 4 ]).insert(6, 5) - * // List [ 0, 1, 2, 3, 4, 5 ] - * ``` - * * Since `insert()` re-indexes values, it produces a complete copy, which * has `O(N)` complexity. * @@ -353,14 +275,6 @@ declare namespace Immutable { /** * Returns a new List with 0 size and no values in constant time. * - * - * ```js - * List([ 1, 2, 3, 4 ]).clear() - * // List [] - * ``` - * * Note: `clear` can be used in `withMutations`. */ clear(): List; @@ -369,14 +283,6 @@ declare namespace Immutable { * Returns a new List with the provided `values` appended, starting at this * List's `size`. * - * - * ```js - * List([ 1, 2, 3, 4 ]).push(5) - * // List [ 1, 2, 3, 4, 5 ] - * ``` - * * Note: `push` can be used in `withMutations`. */ push(...values: Array): List; @@ -402,14 +308,6 @@ declare namespace Immutable { * Returns a new List with the provided `values` prepended, shifting other * values ahead to higher indices. * - * - * ```js - * List([ 2, 3, 4]).unshift(1); - * // List [ 1, 2, 3, 4 ] - * ``` - * * Note: `unshift` can be used in `withMutations`. */ unshift(...values: Array): List; @@ -422,14 +320,6 @@ declare namespace Immutable { * List rather than the removed value. Use `first()` to get the first * value in this List. * - * - * ```js - * List([ 0, 1, 2, 3, 4 ]).shift(); - * // List [ 1, 2, 3, 4 ] - * ``` - * * Note: `shift` can be used in `withMutations`. */ shift(): List; @@ -443,35 +333,11 @@ declare namespace Immutable { * `index` may be a negative number, which indexes back from the end of the * List. `v.update(-1)` updates the last item in the List. * - * - * ```js - * const list = List([ 'a', 'b', 'c' ]) - * const result = list.update(2, val => val.toUpperCase()) - * // List [ "a", "b", "C" ] - * ``` - * * This can be very useful as a way to "chain" a normal function into a * sequence of methods. RxJS calls this "let" and lodash calls it "thru". * * For example, to sum a List after mapping and filtering: * - * - * ```js - * function sum(collection) { - * return collection.reduce((sum, x) => sum + x, 0) - * } - * - * List([ 1, 2, 3 ]) - * .map(x => x + 1) - * .filter(x => x % 2 === 0) - * .update(sum) - * // 6 - * ``` - * * Note: `update(index)` can be used in `withMutations`. * * @see `Map#update` @@ -504,26 +370,10 @@ declare namespace Immutable { * Index numbers are used as keys to determine the path to follow in * the List. * - * - * ```js - * const { List } = require('immutable') - * const list = List([ 0, 1, 2, List([ 3, 4 ])]) - * list.setIn([3, 0], 999); - * // List [ 0, 1, 2, List [ 999, 4 ] ] - * ``` - * * Plain JavaScript Object or Arrays may be nested within an Immutable.js * Collection, and setIn() can update those values as well, treating them * immutably by creating new copies of those values with the changes applied. * - * - * ```js - * const { List } = require('immutable') - * const list = List([ 0, 1, 2, { plain: 'object' }]) - * list.setIn([3, 'plain'], 'value'); - * // List([ 0, 1, 2, { plain: 'value' }]) - * ``` - * * Note: `setIn` can be used in `withMutations`. */ setIn(keyPath: Iterable, value: unknown): this; @@ -532,26 +382,10 @@ declare namespace Immutable { * Returns a new List having removed the value at this `keyPath`. If any * keys in `keyPath` do not exist, no change will occur. * - * - * ```js - * const { List } = require('immutable') - * const list = List([ 0, 1, 2, List([ 3, 4 ])]) - * list.deleteIn([3, 0]); - * // List [ 0, 1, 2, List [ 4 ] ] - * ``` - * * Plain JavaScript Object or Arrays may be nested within an Immutable.js * Collection, and removeIn() can update those values as well, treating them * immutably by creating new copies of those values with the changes applied. * - * - * ```js - * const { List } = require('immutable') - * const list = List([ 0, 1, 2, { plain: 'object' }]) - * list.removeIn([3, 'plain']); - * // List([ 0, 1, 2, {}]) - * ``` - * * Note: `deleteIn` *cannot* be safely used in `withMutations`. * * @alias removeIn @@ -638,14 +472,6 @@ declare namespace Immutable { /** * Returns a new List with values passed through a * `mapper` function. - * - * - * ```js - * List([ 1, 2 ]).map(x => 10 * x) - * // List [ 10, 20 ] - * ``` */ map( mapper: (value: T, key: number, iter: this) => M, @@ -695,15 +521,6 @@ declare namespace Immutable { * Returns a List "zipped" with the provided collection. * * Like `zipWith`, but using the default `zipper`: creating an `Array`. - * - * - * ```js - * const a = List([ 1, 2, 3 ]); - * const b = List([ 4, 5, 6 ]); - * const c = a.zip(b); // List [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] - * ``` */ zip(other: Collection): List<[T, U]>; zip( @@ -718,15 +535,6 @@ declare namespace Immutable { * Unlike `zip`, `zipAll` continues zipping until the longest collection is * exhausted. Missing values from shorter collections are filled with `undefined`. * - * - * ```js - * const a = List([ 1, 2 ]); - * const b = List([ 3, 4, 5 ]); - * const c = a.zipAll(b); // List [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] - * ``` - * * Note: Since zipAll will return a collection as large as the largest * input, some results may contain undefined values. TypeScript cannot * account for these without cases (as of v2.5). @@ -741,16 +549,6 @@ declare namespace Immutable { /** * Returns a List "zipped" with the provided collections by using a * custom `zipper` function. - * - * - * ```js - * const a = List([ 1, 2, 3 ]); - * const b = List([ 4, 5, 6 ]); - * const c = a.zipWith((a, b) => a + b, b); - * // List [ 5, 7, 9 ] - * ``` */ zipWith( zipper: (value: T, otherValue: U) => Z, @@ -789,13 +587,6 @@ declare namespace Immutable { * Immutable collections are treated as values, any Immutable collection may * be used as a key. * - * - * ```js - * const { Map, List } = require('immutable'); - * Map().set(List([ 1 ]), 'listofone').get(List([ 1 ])); - * // 'listofone' - * ``` - * * Any JavaScript object may be used as a key, however strict identity is used * to evaluate key equality. Two similar looking objects will represent two * different keys. @@ -805,13 +596,6 @@ declare namespace Immutable { namespace Map { /** * True if the provided value is a Map - * - * - * ```js - * const { Map } = require('immutable') - * Map.isMap({}) // false - * Map.isMap(Map()) // true - * ``` */ function isMap(maybeMap: unknown): maybeMap is Map; } @@ -825,29 +609,10 @@ declare namespace Immutable { * Note: `Map` is a factory function and not a class, and does not use the * `new` keyword during construction. * - * - * ```js - * const { Map } = require('immutable') - * Map({ key: "value" }) - * Map([ [ "key", "value" ] ]) - * ``` - * * Keep in mind, when using JS objects to construct Immutable Maps, that * JavaScript Object properties are always strings, even if written in a * quote-less shorthand, while Immutable Maps accept keys of any type. * - * - * ```js - * let obj = { 1: "one" } - * Object.keys(obj) // [ "1" ] - * assert.equal(obj["1"], obj[1]) // "one" === "one" - * - * let map = Map(obj) - * assert.notEqual(map.get("1"), map.get(1)) // "one" !== undefined - * ``` - * * Property access for JavaScript Objects first converts the key to a string, * but since Immutable Map keys can be of any type the argument to `get()` is * not altered. @@ -965,21 +730,6 @@ declare namespace Immutable { * Returns a new Map also containing the new key, value pair. If an equivalent * key already exists in this Map, it will be replaced. * - * - * ```js - * const { Map } = require('immutable') - * const originalMap = Map() - * const newerMap = originalMap.set('key', 'value') - * const newestMap = newerMap.set('key', 'newer value') - * - * originalMap - * // Map {} - * newerMap - * // Map { "key": "value" } - * newestMap - * // Map { "key": "newer value" } - * ``` - * * Note: `set` can be used in `withMutations`. */ set(key: K, value: V): this; @@ -990,18 +740,6 @@ declare namespace Immutable { * Note: `delete` cannot be safely used in IE8, but is provided to mirror * the ES6 collection API. * - * - * ```js - * const { Map } = require('immutable') - * const originalMap = Map({ - * key: 'value', - * otherKey: 'other value' - * }) - * // Map { "key": "value", "otherKey": "other value" } - * originalMap.delete('otherKey') - * // Map { "key": "value" } - * ``` - * * Note: `delete` can be used in `withMutations`. * * @alias remove @@ -1012,14 +750,6 @@ declare namespace Immutable { /** * Returns a new Map which excludes the provided `keys`. * - * - * ```js - * const { Map } = require('immutable') - * const names = Map({ a: "Aaron", b: "Barry", c: "Connor" }) - * names.deleteAll([ 'a', 'c' ]) - * // Map { "b": "Barry" } - * ``` - * * Note: `deleteAll` can be used in `withMutations`. * * @alias removeAll @@ -1030,13 +760,6 @@ declare namespace Immutable { /** * Returns a new Map containing no keys or values. * - * - * ```js - * const { Map } = require('immutable') - * Map({ key: 'value' }).clear() - * // Map {} - * ``` - * * Note: `clear` can be used in `withMutations`. */ clear(): this; @@ -1047,100 +770,31 @@ declare namespace Immutable { * * Similar to: `map.set(key, updater(map.get(key)))`. * - * - * ```js - * const { Map } = require('immutable') - * const aMap = Map({ key: 'value' }) - * const newMap = aMap.update('key', value => value + value) - * // Map { "key": "valuevalue" } - * ``` - * * This is most commonly used to call methods on collections within a * structure of data. For example, in order to `.push()` onto a nested `List`, * `update` and `push` can be used together: * - * - * ```js - * const aMap = Map({ nestedList: List([ 1, 2, 3 ]) }) - * const newMap = aMap.update('nestedList', list => list.push(4)) - * // Map { "nestedList": List [ 1, 2, 3, 4 ] } - * ``` - * * When a `notSetValue` is provided, it is provided to the `updater` * function when the value at the key does not exist in the Map. * - * - * ```js - * const aMap = Map({ key: 'value' }) - * const newMap = aMap.update('noKey', 'no value', value => value + value) - * // Map { "key": "value", "noKey": "no valueno value" } - * ``` - * * However, if the `updater` function returns the same value it was called * with, then no change will occur. This is still true if `notSetValue` * is provided. * - * - * ```js - * const aMap = Map({ apples: 10 }) - * const newMap = aMap.update('oranges', 0, val => val) - * // Map { "apples": 10 } - * assert.strictEqual(newMap, map); - * ``` - * * For code using ES2015 or later, using `notSetValue` is discourged in * favor of function parameter default values. This helps to avoid any * potential confusion with identify functions as described above. * * The previous example behaves differently when written with default values: * - * - * ```js - * const aMap = Map({ apples: 10 }) - * const newMap = aMap.update('oranges', (val = 0) => val) - * // Map { "apples": 10, "oranges": 0 } - * ``` - * * If no key is provided, then the `updater` function return value is * returned as well. * - * - * ```js - * const aMap = Map({ key: 'value' }) - * const result = aMap.update(aMap => aMap.get('key')) - * // "value" - * ``` - * * This can be very useful as a way to "chain" a normal function into a * sequence of methods. RxJS calls this "let" and lodash calls it "thru". * * For example, to sum the values in a Map * - * - * ```js - * function sum(collection) { - * return collection.reduce((sum, x) => sum + x, 0) - * } - * - * Map({ x: 1, y: 2, z: 3 }) - * .map(x => x + 1) - * .filter(x => x % 2 === 0) - * .update(sum) - * // 6 - * ``` - * * Note: `update(key)` can be used in `withMutations`. */ update(key: K, notSetValue: V, updater: (value: V) => V): this; @@ -1154,14 +808,6 @@ declare namespace Immutable { * * Note: Values provided to `merge` are shallowly converted before being * merged. No nested values are altered. - * - * - * ```js - * const { Map } = require('immutable') - * const one = Map({ a: 10, b: 20, c: 30 }) - * const two = Map({ b: 40, a: 50, d: 60 }) - * one.merge(two) // Map { "a": 50, "b": 40, "c": 30, "d": 60 } - * two.merge(one) // Map { "b": 20, "a": 10, "d": 60, "c": 30 } * ``` * * Note: `merge` can be used in `withMutations`. @@ -1187,17 +833,6 @@ declare namespace Immutable { * the provided Collections (or JS objects) into this Map, but uses the * `merger` function for dealing with conflicts. * - * - * ```js - * const { Map } = require('immutable') - * const one = Map({ a: 10, b: 20, c: 30 }) - * const two = Map({ b: 40, a: 50, d: 60 }) - * one.mergeWith((oldVal, newVal) => oldVal / newVal, two) - * // { "a": 0.2, "b": 0.5, "c": 30, "d": 60 } - * two.mergeWith((oldVal, newVal) => oldVal / newVal, one) - * // { "b": 2, "a": 5, "d": 60, "c": 30 } - * ``` - * * Note: `mergeWith` can be used in `withMutations`. */ mergeWith( @@ -1223,19 +858,6 @@ declare namespace Immutable { * Note: Indexed and set-like collections are merged using * `concat()`/`union()` and therefore do not recurse. * - * - * ```js - * const { Map } = require('immutable') - * const one = Map({ a: Map({ x: 10, y: 10 }), b: Map({ x: 20, y: 50 }) }) - * const two = Map({ a: Map({ x: 2 }), b: Map({ y: 5 }), c: Map({ z: 3 }) }) - * one.mergeDeep(two) - * // Map { - * // "a": Map { "x": 2, "y": 10 }, - * // "b": Map { "x": 20, "y": 5 }, - * // "c": Map { "z": 3 } - * // } - * ``` - * * Note: `mergeDeep` can be used in `withMutations`. */ mergeDeep( @@ -1252,19 +874,6 @@ declare namespace Immutable { * incompatible if they fall into separate categories between keyed, * indexed, and set-like. * - * - * ```js - * const { Map } = require('immutable') - * const one = Map({ a: Map({ x: 10, y: 10 }), b: Map({ x: 20, y: 50 }) }) - * const two = Map({ a: Map({ x: 2 }), b: Map({ y: 5 }), c: Map({ z: 3 }) }) - * one.mergeDeepWith((oldVal, newVal) => oldVal / newVal, two) - * // Map { - * // "a": Map { "x": 5, "y": 10 }, - * // "b": Map { "x": 20, "y": 10 }, - * // "c": Map { "z": 3 } - * // } - * ``` - * * Note: `mergeDeepWith` can be used in `withMutations`. */ mergeDeepWith( @@ -1278,63 +887,10 @@ declare namespace Immutable { * Returns a new Map having set `value` at this `keyPath`. If any keys in * `keyPath` do not exist, a new immutable Map will be created at that key. * - * - * ```js - * const { Map } = require('immutable') - * const originalMap = Map({ - * subObject: Map({ - * subKey: 'subvalue', - * subSubObject: Map({ - * subSubKey: 'subSubValue' - * }) - * }) - * }) - * - * const newMap = originalMap.setIn(['subObject', 'subKey'], 'ha ha!') - * // Map { - * // "subObject": Map { - * // "subKey": "ha ha!", - * // "subSubObject": Map { "subSubKey": "subSubValue" } - * // } - * // } - * - * const newerMap = originalMap.setIn( - * ['subObject', 'subSubObject', 'subSubKey'], - * 'ha ha ha!' - * ) - * // Map { - * // "subObject": Map { - * // "subKey": "subvalue", - * // "subSubObject": Map { "subSubKey": "ha ha ha!" } - * // } - * // } - * ``` - * * Plain JavaScript Object or Arrays may be nested within an Immutable.js * Collection, and setIn() can update those values as well, treating them * immutably by creating new copies of those values with the changes applied. * - * - * ```js - * const { Map } = require('immutable') - * const originalMap = Map({ - * subObject: { - * subKey: 'subvalue', - * subSubObject: { - * subSubKey: 'subSubValue' - * } - * } - * }) - * - * originalMap.setIn(['subObject', 'subKey'], 'ha ha!') - * // Map { - * // "subObject": { - * // subKey: "ha ha!", - * // subSubObject: { subSubKey: "subSubValue" } - * // } - * // } - * ``` - * * If any key in the path exists but cannot be updated (such as a primitive * like number or a custom Object like Date), an error will be thrown. * @@ -1360,70 +916,26 @@ declare namespace Immutable { * This is most commonly used to call methods on collections nested within a * structure of data. For example, in order to `.push()` onto a nested `List`, * `updateIn` and `push` can be used together: - * - * - * ```js - * const { Map, List } = require('immutable') - * const map = Map({ inMap: Map({ inList: List([ 1, 2, 3 ]) }) }) - * const newMap = map.updateIn(['inMap', 'inList'], list => list.push(4)) - * // Map { "inMap": Map { "inList": List [ 1, 2, 3, 4 ] } } - * ``` + * * If any keys in `keyPath` do not exist, new Immutable `Map`s will * be created at those keys. If the `keyPath` does not already contain a * value, the `updater` function will be called with `notSetValue`, if * provided, otherwise `undefined`. * - * - * ```js - * const map = Map({ a: Map({ b: Map({ c: 10 }) }) }) - * const newMap = map.updateIn(['a', 'b', 'c'], val => val * 2) - * // Map { "a": Map { "b": Map { "c": 20 } } } - * ``` - * * If the `updater` function returns the same value it was called with, then * no change will occur. This is still true if `notSetValue` is provided. * - * - * ```js - * const map = Map({ a: Map({ b: Map({ c: 10 }) }) }) - * const newMap = map.updateIn(['a', 'b', 'x'], 100, val => val) - * // Map { "a": Map { "b": Map { "c": 10 } } } - * assert.strictEqual(newMap, aMap) - * ``` - * * For code using ES2015 or later, using `notSetValue` is discourged in * favor of function parameter default values. This helps to avoid any * potential confusion with identify functions as described above. * * The previous example behaves differently when written with default values: * - * - * ```js - * const map = Map({ a: Map({ b: Map({ c: 10 }) }) }) - * const newMap = map.updateIn(['a', 'b', 'x'], (val = 100) => val) - * // Map { "a": Map { "b": Map { "c": 10, "x": 100 } } } - * ``` - * * Plain JavaScript Object or Arrays may be nested within an Immutable.js * Collection, and updateIn() can update those values as well, treating them * immutably by creating new copies of those values with the changes applied. * - * - * ```js - * const map = Map({ a: { b: { c: 10 } } }) - * const newMap = map.updateIn(['a', 'b', 'c'], val => val * 2) - * // Map { "a": { b: { c: 20 } } } - * ``` - * * If any key in the path exists but cannot be updated (such as a primitive * like number or a custom Object like Date), an error will be thrown. * @@ -1485,17 +997,6 @@ declare namespace Immutable { * * As an example, this results in the creation of 2, not 4, new Maps: * - * - * ```js - * const { Map } = require('immutable') - * const map1 = Map() - * const map2 = map1.withMutations(map => { - * map.set('a', 1).set('b', 2).set('c', 3) - * }) - * assert.equal(map1.size, 0) - * assert.equal(map2.size, 3) - * ``` - * * Note: Not all methods can be used on a mutable collection or within * `withMutations`! Read the documentation for each method to see if it * is safe to use in `withMutations`. @@ -1637,17 +1138,6 @@ declare namespace Immutable { * * Is pure, i.e. it must always return the same value for the same pair * of values. * - * - * ```js - * const { Map } = require('immutable') - * Map({ "c": 3, "a": 1, "b": 2 }).sort((a, b) => { - * if (a < b) { return -1; } - * if (a > b) { return 1; } - * if (a === b) { return 0; } - * }); - * // OrderedMap { "a": 1, "b": 2, "c": 3 } - * ``` - * * Note: `sort()` Always returns a new instance, even if the original was * already sorted. * @@ -1659,18 +1149,6 @@ declare namespace Immutable { * Like `sort`, but also accepts a `comparatorValueMapper` which allows for * sorting by more sophisticated means: * - * - * ```js - * const { Map } = require('immutable') - * const beattles = Map({ - * John: { name: "Lennon" }, - * Paul: { name: "McCartney" }, - * George: { name: "Harrison" }, - * Ringo: { name: "Starr" }, - * }); - * beattles.sortBy(member => member.name); - * ``` - * * Note: `sortBy()` Always returns a new instance, even if the original was * already sorted. * @@ -1731,18 +1209,6 @@ declare namespace Immutable { * equivalent key already exists in this OrderedMap, it will be replaced * while maintaining the existing order. * - * - * ```js - * const { OrderedMap } = require('immutable') - * const originalMap = OrderedMap({a:1, b:1, c:1}) - * const updatedMap = originalMap.set('b', 2) - * - * originalMap - * // OrderedMap {a: 1, b: 1, c: 1} - * updatedMap - * // OrderedMap {a: 1, b: 2, c: 1} - * ``` - * * Note: `set` can be used in `withMutations`. */ set(key: K, value: V): this; @@ -1755,15 +1221,6 @@ declare namespace Immutable { * Note: Values provided to `merge` are shallowly converted before being * merged. No nested values are altered. * - * - * ```js - * const { OrderedMap } = require('immutable') - * const one = OrderedMap({ a: 10, b: 20, c: 30 }) - * const two = OrderedMap({ b: 40, a: 50, d: 60 }) - * one.merge(two) // OrderedMap { "a": 50, "b": 40, "c": 30, "d": 60 } - * two.merge(one) // OrderedMap { "b": 20, "a": 10, "d": 60, "c": 30 } - * ``` - * * Note: `merge` can be used in `withMutations`. * * @alias concat @@ -2008,13 +1465,6 @@ declare namespace Immutable { /** * Returns a Set excluding any values contained within `collections`. * - * - * ```js - * const { OrderedSet } = require('immutable') - * OrderedSet([ 1, 2, 3 ]).subtract([1, 3]) - * // OrderedSet [2] - * ``` - * * Note: `subtract` can be used in `withMutations`. */ subtract(...collections: Array>): this; @@ -2117,17 +1567,6 @@ declare namespace Immutable { * * Is pure, i.e. it must always return the same value for the same pair * of values. * - * - * ```js - * const { Set } = require('immutable') - * Set(['b', 'a', 'c']).sort((a, b) => { - * if (a < b) { return -1; } - * if (a > b) { return 1; } - * if (a === b) { return 0; } - * }); - * // OrderedSet { "a":, "b", "c" } - * ``` - * * Note: `sort()` Always returns a new instance, even if the original was * already sorted. * @@ -2139,18 +1578,6 @@ declare namespace Immutable { * Like `sort`, but also accepts a `comparatorValueMapper` which allows for * sorting by more sophisticated means: * - * - * ```js - * const { Set } = require('immutable') - * const beattles = Set([ - * { name: "Lennon" }, - * { name: "McCartney" }, - * { name: "Harrison" }, - * { name: "Starr" }, - * ]); - * beattles.sortBy(member => member.name); - * ``` - * * Note: `sortBy()` Always returns a new instance, even if the original was * already sorted. * @@ -2821,48 +2248,9 @@ declare namespace Immutable { * are created by passing it some of the accepted values for that Record * type: * - * - * ```js - * // makePerson is a Record Factory function - * const makePerson = Record({ name: null, favoriteColor: 'unknown' }); - * - * // alan is a Record instance - * const alan = makePerson({ name: 'Alan' }); - * ``` - * * Note that Record Factories return `Record & Readonly`, * this allows use of both the Record instance API, and direct property * access on the resulting instances: - * - * - * ```js - * // Use the Record API - * console.log('Record API: ' + alan.get('name')) - * - * // Or direct property access (Readonly) - * console.log('property access: ' + alan.name) - * ``` - * - * **Flow Typing Records:** - * - * Use the `RecordFactory` Flow type to get high quality type checking of - * Records: - * - * ```js - * import type { RecordFactory, RecordOf } from 'immutable'; - * - * // Use RecordFactory for defining new Record factory functions. - * type PersonProps = { name: ?string, favoriteColor: string }; - * const makePerson: RecordFactory = Record({ name: null, favoriteColor: 'unknown' }); - * - * // Use RecordOf for defining new instances of that Record. - * type Person = RecordOf; - * const alan: Person = makePerson({ name: 'Alan' }); - * ``` */ namespace Factory {} @@ -3077,13 +2465,6 @@ declare namespace Immutable { * * Any collection can be converted to a lazy Seq with `Seq()`. * - * - * ```js - * const { Map } = require('immutable') - * const map = Map({ a: 1, b: 2, c: 3 }) - * const lazySeq = Seq(map) - * ``` - * * `Seq` allows for the efficient chaining of operations, allowing for the * expression of logic that can otherwise be very tedious: * @@ -3098,18 +2479,6 @@ declare namespace Immutable { * As well as expressing logic that would otherwise seem memory or time * limited, for example `Range` is a special kind of Lazy sequence. * - * - * ```js - * const { Range } = require('immutable') - * Range(1, Infinity) - * .skip(1000) - * .map(n => -n) - * .filter(n => n % 2 === 0) - * .take(2) - * .reduce((r, n) => r * n, 1) - * // 1006008 - * ``` - * * Seq is often used to provide a rich collection API to JavaScript Object. * * ```js @@ -3784,13 +3153,6 @@ declare namespace Immutable { /** * Returns a new Collection.Keyed of the same type where the keys and values * have been flipped. - * - * - * ```js - * const { Map } = require('immutable') - * Map({ a: 'z', b: 'y' }).flip() - * // Map { "z": "a", "y": "b" } - * ``` */ flip(): Collection.Keyed; @@ -3826,13 +3188,6 @@ declare namespace Immutable { * Returns a new Collection.Keyed of the same type with keys passed through * a `mapper` function. * - * - * ```js - * const { Map } = require('immutable') - * Map({ a: 1, b: 2 }).mapKeys(x => x.toUpperCase()) - * // Map { "A": 1, "B": 2 } - * ``` - * * Note: `mapKeys()` always returns a new instance, even if it produced * the same key at every step. */ @@ -3845,14 +3200,6 @@ declare namespace Immutable { * Returns a new Collection.Keyed of the same type with entries * ([key, value] tuples) passed through a `mapper` function. * - * - * ```js - * const { Map } = require('immutable') - * Map({ a: 1, b: 2 }) - * .mapEntries(([ k, v ]) => [ k.toUpperCase(), v * 2 ]) - * // Map { "A": 2, "B": 4 } - * ``` - * * Note: `mapEntries()` always returns a new instance, even if it produced * the same entry at every step. * @@ -3994,28 +3341,8 @@ declare namespace Immutable { * The resulting Collection includes the first item from each, then the * second from each, etc. * - * - * ```js - * const { List } = require('immutable') - * List([ 1, 2, 3 ]).interleave(List([ 'A', 'B', 'C' ])) - * // List [ 1, "A", 2, "B", 3, "C" ] - * ``` - * * The shortest Collection stops interleave. * - * - * ```js - * List([ 1, 2, 3 ]).interleave( - * List([ 'A', 'B' ]), - * List([ 'X', 'Y', 'Z' ]) - * ) - * // List [ 1, "A", "X", 2, "B", "Y" ] - * ``` - * * Since `interleave()` re-indexes values, it produces a complete copy, * which has `O(N)` complexity. * @@ -4031,13 +3358,6 @@ declare namespace Immutable { * `index` may be a negative number, which indexes back from the end of the * Collection. `s.splice(-2)` splices after the second to last item. * - * - * ```js - * const { List } = require('immutable') - * List([ 'a', 'b', 'c', 'd' ]).splice(1, 2, 'q', 'r', 's') - * // List [ "a", "q", "r", "s", "d" ] - * ``` - * * Since `splice()` re-indexes values, it produces a complete copy, which * has `O(N)` complexity. * @@ -4050,16 +3370,6 @@ declare namespace Immutable { * collections. * * Like `zipWith`, but using the default `zipper`: creating an `Array`. - * - * - * - * ```js - * const a = List([ 1, 2, 3 ]); - * const b = List([ 4, 5, 6 ]); - * const c = a.zip(b); // List [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] - * ``` */ zip(other: Collection): Collection.Indexed<[T, U]>; zip( @@ -4094,16 +3404,6 @@ declare namespace Immutable { /** * Returns a Collection of the same type "zipped" with the provided * collections by using a custom `zipper` function. - * - * - * ```js - * const a = List([ 1, 2, 3 ]); - * const b = List([ 4, 5, 6 ]); - * const c = a.zipWith((a, b) => a + b, b); - * // List [ 5, 7, 9 ] - * ``` */ zipWith( zipper: (value: T, otherValue: U) => Z, @@ -4388,17 +3688,6 @@ declare namespace Immutable { * and is used when adding this to a `Set` or as a key in a `Map`, enabling * lookup via a different instance. * - * - * ```js - * const a = List([ 1, 2, 3 ]); - * const b = List([ 1, 2, 3 ]); - * assert.notStrictEqual(a, b); // different instances - * const set = Set([ a ]); - * assert.equal(set.has(b), true); - * ``` - * * If two values have the same `hashCode`, they are [not guaranteed * to be equal][Hash Collision]. If two values have different `hashCode`s, * they must not be equal. @@ -4458,22 +3747,8 @@ declare namespace Immutable { * Returns the value found by following a path of keys or indices through * nested Collections. * - * - * ```js - * const { Map, List } = require('immutable') - * const deepData = Map({ x: List([ Map({ y: 123 }) ]) }); - * deepData.getIn(['x', 0, 'y']) // 123 - * ``` - * * Plain JavaScript Object or Arrays may be nested within an Immutable.js * Collection, and getIn() can access those values as well: - * - * - * ```js - * const { Map, List } = require('immutable') - * const deepData = Map({ x: [ { y: 123 } ] }); - * deepData.getIn(['x', 0, 'y']) // 123 - * ``` */ getIn(searchKeyPath: Iterable, notSetValue?: unknown): unknown; @@ -4490,21 +3765,6 @@ declare namespace Immutable { * sequence of methods. RxJS calls this "let" and lodash calls it "thru". * * For example, to sum a Seq after mapping and filtering: - * - * - * ```js - * const { Seq } = require('immutable') - * - * function sum(collection) { - * return collection.reduce((sum, x) => sum + x, 0) - * } - * - * Seq([ 1, 2, 3 ]) - * .map(x => x + 1) - * .filter(x => x % 2 === 0) - * .update(sum) - * // 6 - * ``` */ update(updater: (value: this) => R): R; @@ -4584,14 +3844,6 @@ declare namespace Immutable { * expressions. However, when called on `Map` or other keyed collections, * `collection.toList()` discards the keys and creates a list of only the * values, whereas `List(collection)` creates a list of entry tuples. - * - * - * ```js - * const { Map, List } = require('immutable') - * var myMap = Map({ a: 'Apple', b: 'Banana' }) - * List(myMap) // List [ [ "a", "Apple" ], [ "b", "Banana" ] ] - * myMap.toList() // List [ "Apple", "Banana" ] - * ``` */ toList(): List; @@ -4620,19 +3872,6 @@ declare namespace Immutable { * * The returned Seq will have identical iteration order as * this Collection. - * - * - * ```js - * const { Seq } = require('immutable') - * const indexedSeq = Seq([ 'A', 'B', 'C' ]) - * // Seq [ "A", "B", "C" ] - * indexedSeq.filter(v => v === 'B') - * // Seq [ "B" ] - * const keyedSeq = indexedSeq.toKeyedSeq() - * // Seq { 0: "A", 1: "B", 2: "C" } - * keyedSeq.filter(v => v === 'B') - * // Seq { 1: "B" } - * ``` */ toKeyedSeq(): Seq.Keyed; @@ -4701,13 +3940,6 @@ declare namespace Immutable { * Returns a new Collection of the same type with values passed through a * `mapper` function. * - * - * ```js - * const { Collection } = require('immutable') - * Collection({ a: 1, b: 2 }).map(x => 10 * x) - * // Seq { "a": 10, "b": 20 } - * ``` - * * Note: `map()` always returns a new instance, even if it produced the same * value at every step. */ @@ -4728,13 +3960,6 @@ declare namespace Immutable { * Returns a new Collection of the same type with only the entries for which * the `predicate` function returns true. * - * - * ```js - * const { Map } = require('immutable') - * Map({ a: 1, b: 2, c: 3, d: 4}).filter(x => x % 2 === 0) - * // Map { "b": 2, "d": 4 } - * ``` - * * Note: `filter()` always returns a new instance, even if it results in * not filtering out any values. */ @@ -4751,13 +3976,6 @@ declare namespace Immutable { * Returns a new Collection of the same type with only the entries for which * the `predicate` function returns false. * - * - * ```js - * const { Map } = require('immutable') - * Map({ a: 1, b: 2, c: 3, d: 4}).filterNot(x => x % 2 === 0) - * // Map { "a": 1, "c": 3 } - * ``` - * * Note: `filterNot()` always returns a new instance, even if it results in * not filtering out any values. */ @@ -4802,17 +4020,6 @@ declare namespace Immutable { * When sorting collections which have no defined order, their ordered * equivalents will be returned. e.g. `map.sort()` returns OrderedMap. * - * - * ```js - * const { Map } = require('immutable') - * Map({ "c": 3, "a": 1, "b": 2 }).sort((a, b) => { - * if (a < b) { return -1; } - * if (a > b) { return 1; } - * if (a === b) { return 0; } - * }); - * // OrderedMap { "a": 1, "b": 2, "c": 3 } - * ``` - * * Note: `sort()` Always returns a new instance, even if the original was * already sorted. * @@ -4824,18 +4031,6 @@ declare namespace Immutable { * Like `sort`, but also accepts a `comparatorValueMapper` which allows for * sorting by more sophisticated means: * - * - * ```js - * const { Map } = require('immutable') - * const beattles = Map({ - * John: { name: "Lennon" }, - * Paul: { name: "McCartney" }, - * George: { name: "Harrison" }, - * Ringo: { name: "Starr" }, - * }); - * beattles.sortBy(member => member.name); - * ``` - * * Note: `sortBy()` Always returns a new instance, even if the original was * already sorted. * @@ -4851,24 +4046,6 @@ declare namespace Immutable { * value of the `grouper` function. * * Note: This is always an eager operation. - * - * - * ```js - * const { List, Map } = require('immutable') - * const listOfMaps = List([ - * Map({ v: 0 }), - * Map({ v: 1 }), - * Map({ v: 1 }), - * Map({ v: 0 }), - * Map({ v: 2 }) - * ]) - * const groupsOfMaps = listOfMaps.groupBy(x => x.get('v')) - * // Map { - * // 0: List [ Map{ "v": 0 }, Map { "v": 0 } ], - * // 1: List [ Map{ "v": 1 }, Map { "v": 1 } ], - * // 2: List [ Map{ "v": 2 } ], - * // } - * ``` */ groupBy( grouper: (value: V, key: K, iter: this) => G, @@ -4936,14 +4113,6 @@ declare namespace Immutable { /** * Returns a new Collection of the same type which includes entries starting * from when `predicate` first returns false. - * - * - * ```js - * const { List } = require('immutable') - * List([ 'dog', 'frog', 'cat', 'hat', 'god' ]) - * .skipWhile(x => x.match(/g/)) - * // List [ "cat", "hat", "god" ] - * ``` */ skipWhile( predicate: (value: V, key: K, iter: this) => boolean, @@ -4953,14 +4122,6 @@ declare namespace Immutable { /** * Returns a new Collection of the same type which includes entries starting * from when `predicate` first returns true. - * - * - * ```js - * const { List } = require('immutable') - * List([ 'dog', 'frog', 'cat', 'hat', 'god' ]) - * .skipUntil(x => x.match(/hat/)) - * // List [ "hat", "god" ] - * ``` */ skipUntil( predicate: (value: V, key: K, iter: this) => boolean, @@ -4982,14 +4143,6 @@ declare namespace Immutable { /** * Returns a new Collection of the same type which includes entries from this * Collection as long as the `predicate` returns true. - * - * - * ```js - * const { List } = require('immutable') - * List([ 'dog', 'frog', 'cat', 'hat', 'god' ]) - * .takeWhile(x => x.match(/o/)) - * // List [ "dog", "frog" ] - * ``` */ takeWhile( predicate: (value: V, key: K, iter: this) => boolean, @@ -4999,14 +4152,6 @@ declare namespace Immutable { /** * Returns a new Collection of the same type which includes entries from this * Collection as long as the `predicate` returns false. - * - * - * ```js - * const { List } = require('immutable') - * List([ 'dog', 'frog', 'cat', 'hat', 'god' ]) - * .takeUntil(x => x.match(/at/)) - * // List [ "dog", "frog" ] - * ``` */ takeUntil( predicate: (value: V, key: K, iter: this) => boolean, @@ -5246,17 +4391,6 @@ declare namespace Immutable { /** * Like `max`, but also accepts a `comparatorValueMapper` which allows for * comparing by more sophisticated means: - * - * - * ```js - * const { List, } = require('immutable'); - * const l = List([ - * { name: 'Bob', avgHit: 1 }, - * { name: 'Max', avgHit: 3 }, - * { name: 'Lili', avgHit: 2 } , - * ]); - * l.maxBy(i => i.avgHit); // will output { name: 'Max', avgHit: 3 } - * ``` */ maxBy( comparatorValueMapper: (value: V, key: K, iter: this) => C, @@ -5283,17 +4417,6 @@ declare namespace Immutable { /** * Like `min`, but also accepts a `comparatorValueMapper` which allows for * comparing by more sophisticated means: - * - * - * ```js - * const { List, } = require('immutable'); - * const l = List([ - * { name: 'Bob', avgHit: 1 }, - * { name: 'Max', avgHit: 3 }, - * { name: 'Lili', avgHit: 2 } , - * ]); - * l.minBy(i => i.avgHit); // will output { name: 'Bob', avgHit: 1 } - * ``` */ minBy( comparatorValueMapper: (value: V, key: K, iter: this) => C, @@ -5333,16 +4456,6 @@ declare namespace Immutable { * and is used when adding this to a `Set` or as a key in a `Map`, enabling * lookup via a different instance. * - * - * ```js - * const { List, Set } = require('immutable'); - * const a = List([ 1, 2, 3 ]); - * const b = List([ 1, 2, 3 ]); - * assert.notStrictEqual(a, b); // different instances - * const set = Set([ a ]); - * assert.equal(set.has(b), true); - * ``` - * * Note: hashCode() MUST return a Uint32 number. The easiest way to * guarantee this is to return `myHash | 0` from a custom implementation. * @@ -5395,44 +4508,12 @@ declare namespace Immutable { * If `reviver` is not provided, the default behavior will convert Objects * into Maps and Arrays into Lists like so: * - * - * ```js - * const { fromJS, isKeyed } = require('immutable') - * function (key, value) { - * return isKeyed(value) ? value.toMap() : value.toList() - * } - * ``` - * * Accordingly, this example converts native JS data to OrderedMap and List: * - * - * ```js - * const { fromJS, isKeyed } = require('immutable') - * fromJS({ a: {b: [10, 20, 30]}, c: 40}, function (key, value, path) { - * console.log(key, value, path) - * return isKeyed(value) ? value.toOrderedMap() : value.toList() - * }) - * - * > "b", [ 10, 20, 30 ], [ "a", "b" ] - * > "a", {b: [10, 20, 30]}, [ "a" ] - * > "", {a: {b: [10, 20, 30]}, c: 40}, [] - * ``` - * * Keep in mind, when using JS objects to construct Immutable Maps, that * JavaScript Object properties are always strings, even if written in a * quote-less shorthand, while Immutable Maps accept keys of any type. * - * - * ```js - * const { Map } = require('immutable') - * let obj = { 1: "one" }; - * Object.keys(obj); // [ "1" ] - * assert.equal(obj["1"], obj[1]); // "one" === "one" - * - * let map = Map(obj); - * assert.notEqual(map.get("1"), map.get(1)); // "one" !== undefined - * ``` - * * Property access for JavaScript Objects first converts the key to a string, * but since Immutable Map keys can be of any type the argument to `get()` is * not altered. @@ -5487,16 +4568,6 @@ declare namespace Immutable { * It's used throughout Immutable when checking for equality, including `Map` * key equality and `Set` membership. * - * - * ```js - * const { Map, is } = require('immutable') - * const map1 = Map({ a: 1, b: 1, c: 1 }) - * const map2 = Map({ a: 1, b: 1, c: 1 }) - * assert.equal(map1 !== map2, true) - * assert.equal(Object.is(map1, map2), false) - * assert.equal(is(map1, map2), true) - * ``` - * * `is()` compares primitive types like strings and numbers, Immutable.js * collections like `Map` and `List`, but also any custom object which * implements `ValueObject` by providing `equals()` and `hashCode()` methods. @@ -5534,17 +4605,6 @@ declare namespace Immutable { * True if `maybeImmutable` is an Immutable Collection or Record. * * Note: Still returns true even if the collections is within a `withMutations()`. - * - * - * ```js - * const { isImmutable, Map, List, Stack } = require('immutable'); - * isImmutable([]); // false - * isImmutable({}); // false - * isImmutable(Map()); // true - * isImmutable(List()); // true - * isImmutable(Stack()); // true - * isImmutable(Map().asMutable()); // true - * ``` */ function isImmutable( maybeImmutable: unknown @@ -5552,16 +4612,6 @@ declare namespace Immutable { /** * True if `maybeCollection` is a Collection, or any of its subclasses. - * - * - * ```js - * const { isCollection, Map, List, Stack } = require('immutable'); - * isCollection([]); // false - * isCollection({}); // false - * isCollection(Map()); // true - * isCollection(List()); // true - * isCollection(Stack()); // true - * ``` */ function isCollection( maybeCollection: unknown @@ -5569,16 +4619,6 @@ declare namespace Immutable { /** * True if `maybeKeyed` is a Collection.Keyed, or any of its subclasses. - * - * - * ```js - * const { isKeyed, Map, List, Stack } = require('immutable'); - * isKeyed([]); // false - * isKeyed({}); // false - * isKeyed(Map()); // true - * isKeyed(List()); // false - * isKeyed(Stack()); // false - * ``` */ function isKeyed( maybeKeyed: unknown @@ -5586,17 +4626,6 @@ declare namespace Immutable { /** * True if `maybeIndexed` is a Collection.Indexed, or any of its subclasses. - * - * - * ```js - * const { isIndexed, Map, List, Stack, Set } = require('immutable'); - * isIndexed([]); // false - * isIndexed({}); // false - * isIndexed(Map()); // false - * isIndexed(List()); // true - * isIndexed(Stack()); // true - * isIndexed(Set()); // false - * ``` */ function isIndexed( maybeIndexed: unknown @@ -5604,17 +4633,6 @@ declare namespace Immutable { /** * True if `maybeAssociative` is either a Keyed or Indexed Collection. - * - * - * ```js - * const { isAssociative, Map, List, Stack, Set } = require('immutable'); - * isAssociative([]); // false - * isAssociative({}); // false - * isAssociative(Map()); // true - * isAssociative(List()); // true - * isAssociative(Stack()); // true - * isAssociative(Set()); // false - * ``` */ function isAssociative( maybeAssociative: unknown @@ -5625,17 +4643,6 @@ declare namespace Immutable { /** * True if `maybeOrdered` is a Collection where iteration order is well * defined. True for Collection.Indexed as well as OrderedMap and OrderedSet. - * - * - * ```js - * const { isOrdered, Map, OrderedMap, List, Set } = require('immutable'); - * isOrdered([]); // false - * isOrdered({}); // false - * isOrdered(Map()); // false - * isOrdered(OrderedMap()); // true - * isOrdered(List()); // true - * isOrdered(Set()); // false - * ``` */ function isOrdered( maybeOrdered: Iterable @@ -5712,14 +4719,6 @@ declare namespace Immutable { * * A functional alternative to `collection.get(key)` which will also work on * plain Objects and Arrays as an alternative for `collection[key]`. - * - * - * ```js - * const { get } = require('immutable') - * get([ 'dog', 'frog', 'cat' ], 2) // 'frog' - * get({ x: 123, y: 456 }, 'x') // 123 - * get({ x: 123, y: 456 }, 'z', 'ifNotSet') // 'ifNotSet' - * ``` */ function get(collection: Collection, key: K): V | undefined; function get( @@ -5759,15 +4758,6 @@ declare namespace Immutable { * A functional alternative to `collection.has(key)` which will also work with * plain Objects and Arrays as an alternative for * `collection.hasOwnProperty(key)`. - * - * - * ```js - * const { has } = require('immutable') - * has([ 'dog', 'frog', 'cat' ], 2) // true - * has([ 'dog', 'frog', 'cat' ], 5) // false - * has({ x: 123, y: 456 }, 'x') // true - * has({ x: 123, y: 456 }, 'z') // false - * ``` */ function has(collection: object, key: unknown): boolean; @@ -5777,17 +4767,6 @@ declare namespace Immutable { * A functional alternative to `collection.remove(key)` which will also work * with plain Objects and Arrays as an alternative for * `delete collectionCopy[key]`. - * - * - * ```js - * const { remove } = require('immutable') - * const originalArray = [ 'dog', 'frog', 'cat' ] - * remove(originalArray, 1) // [ 'dog', 'cat' ] - * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] - * const originalObject = { x: 123, y: 456 } - * remove(originalObject, 'x') // { y: 456 } - * console.log(originalObject) // { x: 123, y: 456 } - * ``` */ function remove>( collection: C, @@ -5812,17 +4791,6 @@ declare namespace Immutable { * A functional alternative to `collection.set(key, value)` which will also * work with plain Objects and Arrays as an alternative for * `collectionCopy[key] = value`. - * - * - * ```js - * const { set } = require('immutable') - * const originalArray = [ 'dog', 'frog', 'cat' ] - * set(originalArray, 1, 'cow') // [ 'dog', 'cow', 'cat' ] - * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] - * const originalObject = { x: 123, y: 456 } - * set(originalObject, 'x', 789) // { x: 789, y: 456 } - * console.log(originalObject) // { x: 123, y: 456 } - * ``` */ function set>( collection: C, @@ -5849,17 +4817,6 @@ declare namespace Immutable { * A functional alternative to `collection.update(key, fn)` which will also * work with plain Objects and Arrays as an alternative for * `collectionCopy[key] = fn(collection[key])`. - * - * - * ```js - * const { update } = require('immutable') - * const originalArray = [ 'dog', 'frog', 'cat' ] - * update(originalArray, 1, val => val.toUpperCase()) // [ 'dog', 'FROG', 'cat' ] - * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] - * const originalObject = { x: 123, y: 456 } - * update(originalObject, 'x', val => val * 6) // { x: 738, y: 456 } - * console.log(originalObject) // { x: 123, y: 456 } - * ``` */ function update>( collection: C, @@ -5931,13 +4888,6 @@ declare namespace Immutable { * * A functional alternative to `collection.getIn(keypath)` which will also * work with plain Objects and Arrays. - * - * - * ```js - * const { getIn } = require('immutable') - * getIn({ x: { y: { z: 123 }}}, ['x', 'y', 'z']) // 123 - * getIn({ x: { y: { z: 123 }}}, ['x', 'q', 'p'], 'ifNotSet') // 'ifNotSet' - * ``` */ function getIn>( object: C, @@ -5960,13 +4910,6 @@ declare namespace Immutable { * * A functional alternative to `collection.hasIn(keypath)` which will also * work with plain Objects and Arrays. - * - * - * ```js - * const { hasIn } = require('immutable') - * hasIn({ x: { y: { z: 123 }}}, ['x', 'y', 'z']) // true - * hasIn({ x: { y: { z: 123 }}}, ['x', 'q', 'p']) // false - * ``` */ function hasIn( collection: string | boolean | number, @@ -5979,14 +4922,6 @@ declare namespace Immutable { * * A functional alternative to `collection.removeIn(keypath)` which will also * work with plain Objects and Arrays. - * - * - * ```js - * const { removeIn } = require('immutable') - * const original = { x: { y: { z: 123 }}} - * removeIn(original, ['x', 'y', 'z']) // { x: { y: {}}} - * console.log(original) // { x: { y: { z: 123 }}} - * ``` */ function removeIn(collection: C, keyPath: Iterable): C; @@ -5996,14 +4931,6 @@ declare namespace Immutable { * * A functional alternative to `collection.setIn(keypath)` which will also * work with plain Objects and Arrays. - * - * - * ```js - * const { setIn } = require('immutable') - * const original = { x: { y: { z: 123 }}} - * setIn(original, ['x', 'y', 'z'], 456) // { x: { y: { z: 456 }}} - * console.log(original) // { x: { y: { z: 123 }}} - * ``` */ function setIn( collection: C, @@ -6017,14 +4944,6 @@ declare namespace Immutable { * * A functional alternative to `collection.updateIn(keypath)` which will also * work with plain Objects and Arrays. - * - * - * ```js - * const { updateIn } = require('immutable') - * const original = { x: { y: { z: 123 }}} - * updateIn(original, ['x', 'y', 'z'], val => val * 6) // { x: { y: { z: 738 }}} - * console.log(original) // { x: { y: { z: 123 }}} - * ``` */ function updateIn>( collection: C, @@ -6109,14 +5028,6 @@ declare namespace Immutable { * * A functional alternative to `collection.merge()` which will also work with * plain Objects and Arrays. - * - * - * ```js - * const { merge } = require('immutable') - * const original = { x: 123, y: 456 } - * merge(original, { y: 789, z: 'abc' }) // { x: 123, y: 789, z: 'abc' } - * console.log(original) // { x: 123, y: 456 } - * ``` */ function merge( collection: C, @@ -6133,18 +5044,6 @@ declare namespace Immutable { * * A functional alternative to `collection.mergeWith()` which will also work * with plain Objects and Arrays. - * - * - * ```js - * const { mergeWith } = require('immutable') - * const original = { x: 123, y: 456 } - * mergeWith( - * (oldVal, newVal) => oldVal + newVal, - * original, - * { y: 789, z: 'abc' } - * ) // { x: 123, y: 1245, z: 'abc' } - * console.log(original) // { x: 123, y: 456 } - * ``` */ function mergeWith( merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown, @@ -6172,14 +5071,6 @@ declare namespace Immutable { * * A functional alternative to `collection.mergeDeep()` which will also work * with plain Objects and Arrays. - * - * - * ```js - * const { mergeDeep } = require('immutable') - * const original = { x: { y: 123 }} - * mergeDeep(original, { x: { z: 456 }}) // { x: { y: 123, z: 456 }} - * console.log(original) // { x: { y: 123 }} - * ``` */ function mergeDeep( collection: C, @@ -6198,18 +5089,6 @@ declare namespace Immutable { * * A functional alternative to `collection.mergeDeepWith()` which will also * work with plain Objects and Arrays. - * - * - * ```js - * const { mergeDeepWith } = require('immutable') - * const original = { x: { y: 123 }} - * mergeDeepWith( - * (oldVal, newVal) => oldVal + newVal, - * original, - * { x: { y: 456 }} - * ) // { x: { y: 579 }} - * console.log(original) // { x: { y: 123 }} - * ``` */ function mergeDeepWith( merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown, diff --git a/website/src/RunkitEmbed.tsx b/website/src/RunkitEmbed.tsx deleted file mode 100644 index 8b394671c1..0000000000 --- a/website/src/RunkitEmbed.tsx +++ /dev/null @@ -1,153 +0,0 @@ -import Script from 'next/script'; - -export function RunkitEmbed() { - return