diff --git a/.cspell.json b/.cspell.json index c0516bd3..415659db 100644 --- a/.cspell.json +++ b/.cspell.json @@ -1,30 +1,31 @@ { - "version": "0.2", - "language": "en", - "words": [ - "decos", - "helpfeel", - "gyazo", - "coord", - "progfay", - "scrapbox", - "backquote", - "hoge", - "fuga", - "piyo", - "tsbuildinfo" - ], - "ignorePaths": [ - "node_modules/**", - "tests/**/__snapshots__/**", - "coverage/**", - "esm/**", - "lib/**", - "umd/**", - "*.tsbuildinfo", - "tests/page/input.txt", - "cc-test-reporter", - "package.json", - "package-lock.json" - ] -} \ No newline at end of file + "version": "0.2", + "language": "en", + "words": [ + "backquote", + "biomejs", + "coord", + "decos", + "fuga", + "gyazo", + "helpfeel", + "hoge", + "piyo", + "progfay", + "scrapbox", + "tsbuildinfo" + ], + "ignorePaths": [ + "node_modules/**", + "tests/**/__snapshots__/**", + "coverage/**", + "esm/**", + "lib/**", + "umd/**", + "*.tsbuildinfo", + "tests/page/input.txt", + "cc-test-reporter", + "package.json", + "package-lock.json" + ] +} diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index c14493df..00000000 --- a/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -lib -esm -umd -eslint.config.js diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index ff17e924..00000000 --- a/.prettierignore +++ /dev/null @@ -1,162 +0,0 @@ -lib -esm -umd -*.tsbuildinfo -*.json -*.yml - -### https://raw.github.com/github/gitignore/4a8e0a151becd5ccbb83e4aca6e6c195f3d506fd/Global/macOS.gitignore - -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - - -### https://raw.github.com/github/gitignore/4a8e0a151becd5ccbb83e4aca6e6c195f3d506fd/Global/Linux.gitignore - -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - - -### https://raw.github.com/github/gitignore/4a8e0a151becd5ccbb83e4aca6e6c195f3d506fd/Global/Windows.gitignore - -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - - -### https://raw.github.com/github/gitignore/4a8e0a151becd5ccbb83e4aca6e6c195f3d506fd/Node.gitignore - -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -# parcel-bundler cache (https://parceljs.org/) -.cache - -# next.js build output -.next - -# nuxt.js build output -.nuxt - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless - -# FuseBox cache -.fusebox/ - - diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..16e8e666 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["biomejs.biome"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 1b753d40..32755492 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,15 +1,17 @@ { - "cSpell.words": [ - "decos", - "helpfeel", - "gyazo", - "coord", - "progfay", - "scrapbox", - "backquote", - "hoge", - "fuga", - "piyo", - "tsbuildinfo" - ] -} \ No newline at end of file + "cSpell.words": [ + "decos", + "helpfeel", + "gyazo", + "coord", + "progfay", + "scrapbox", + "backquote", + "hoge", + "fuga", + "piyo", + "tsbuildinfo" + ], + "editor.defaultFormatter": "biomejs.biome", + "editor.formatOnSave": true +} diff --git a/biome.json b/biome.json new file mode 100644 index 00000000..b6fc070f --- /dev/null +++ b/biome.json @@ -0,0 +1,13 @@ +{ + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", + "organizeImports": { "enabled": true }, + "files": { + "ignore": ["./lib", "./esm", "./umd", "./coverage"] + }, + "linter": { + "enabled": true + }, + "formatter": { + "enabled": true + } +} diff --git a/eslint.config.js b/eslint.config.js deleted file mode 100644 index 169620d3..00000000 --- a/eslint.config.js +++ /dev/null @@ -1,30 +0,0 @@ -import eslint from "@eslint/js"; -import tsEslint from "typescript-eslint"; -import eslintConfigPrettier from "eslint-config-prettier"; -import eslintPluginVitest from "eslint-plugin-vitest"; - -/** @type {import("eslint").Linter.FlatConfig[]} */ -export default tsEslint.config( - { - ignores: ["lib/**", "esm/**", "umd/**"], - extends: [ - eslint.configs.recommended, - ...tsEslint.configs.recommended, - eslintConfigPrettier, - ], - languageOptions: { - parser: tsEslint.parser, - parserOptions: { - sourceType: "module", - project: "./tsconfig.eslint.json", - }, - }, - plugins: { - "@typescript-eslint": tsEslint.plugin, - }, - }, - { - files: ["tests/**"], - ...eslintPluginVitest.configs.recommended, - }, -); diff --git a/jsr.json b/jsr.json index ba645cfc..691871dc 100644 --- a/jsr.json +++ b/jsr.json @@ -1,5 +1,5 @@ { - "name": "@progfay/scrapbox-parser", - "version": "9.0.0", - "exports": "./src/index.ts" -} \ No newline at end of file + "name": "@progfay/scrapbox-parser", + "version": "9.0.0", + "exports": "./src/index.ts" +} diff --git a/package-lock.json b/package-lock.json index df7cba75..2df9149f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,28 +9,14 @@ "version": "9.0.0", "license": "MIT", "devDependencies": { - "@types/eslint": "9.6.0", + "@biomejs/biome": "1.8.3", "@vitest/coverage-v8": "2.0.5", "cspell": "8.13.1", - "eslint": "9.8.0", - "eslint-config-prettier": "9.1.0", - "eslint-plugin-vitest": "0.5.4", - "npm-run-all2": "6.2.2", - "prettier": "3.3.3", "typescript": "5.5.4", - "typescript-eslint": "8.0.1", "vite": "5.3.5", "vitest": "2.0.5" } }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", @@ -94,6 +80,161 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@biomejs/biome": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.8.3.tgz", + "integrity": "sha512-/uUV3MV+vyAczO+vKrPdOW0Iaet7UnJMU4bNMinggGJTAnBPjCoLEYcyYtYHNnUNYlv4xZMH6hVIQCAozq8d5w==", + "dev": true, + "hasInstallScript": true, + "bin": { + "biome": "bin/biome" + }, + "engines": { + "node": ">=14.21.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/biome" + }, + "optionalDependencies": { + "@biomejs/cli-darwin-arm64": "1.8.3", + "@biomejs/cli-darwin-x64": "1.8.3", + "@biomejs/cli-linux-arm64": "1.8.3", + "@biomejs/cli-linux-arm64-musl": "1.8.3", + "@biomejs/cli-linux-x64": "1.8.3", + "@biomejs/cli-linux-x64-musl": "1.8.3", + "@biomejs/cli-win32-arm64": "1.8.3", + "@biomejs/cli-win32-x64": "1.8.3" + } + }, + "node_modules/@biomejs/cli-darwin-arm64": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.8.3.tgz", + "integrity": "sha512-9DYOjclFpKrH/m1Oz75SSExR8VKvNSSsLnVIqdnKexj6NwmiMlKk94Wa1kZEdv6MCOHGHgyyoV57Cw8WzL5n3A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-darwin-x64": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.8.3.tgz", + "integrity": "sha512-UeW44L/AtbmOF7KXLCoM+9PSgPo0IDcyEUfIoOXYeANaNXXf9mLUwV1GeF2OWjyic5zj6CnAJ9uzk2LT3v/wAw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.8.3.tgz", + "integrity": "sha512-fed2ji8s+I/m8upWpTJGanqiJ0rnlHOK3DdxsyVLZQ8ClY6qLuPc9uehCREBifRJLl/iJyQpHIRufLDeotsPtw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64-musl": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.8.3.tgz", + "integrity": "sha512-9yjUfOFN7wrYsXt/T/gEWfvVxKlnh3yBpnScw98IF+oOeCYb5/b/+K7YNqKROV2i1DlMjg9g/EcN9wvj+NkMuQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.8.3.tgz", + "integrity": "sha512-I8G2QmuE1teISyT8ie1HXsjFRz9L1m5n83U1O6m30Kw+kPMPSKjag6QGUn+sXT8V+XWIZxFFBoTDEDZW2KPDDw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64-musl": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.8.3.tgz", + "integrity": "sha512-UHrGJX7PrKMKzPGoEsooKC9jXJMa28TUSMjcIlbDnIO4EAavCoVmNQaIuUSH0Ls2mpGMwUIf+aZJv657zfWWjA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-arm64": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.8.3.tgz", + "integrity": "sha512-J+Hu9WvrBevfy06eU1Na0lpc7uR9tibm9maHynLIoAjLZpQU3IW+OKHUtyL8p6/3pT2Ju5t5emReeIS2SAxhkQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-x64": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.8.3.tgz", + "integrity": "sha512-/PJ59vA1pnQeKahemaQf4Nyj7IKUvGQSc3Ze1uIGi+Wvr1xF7rGobSrAAG01T/gUDG21vkDsZYM03NAmPiVkqg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, "node_modules/@cspell/cspell-bundled-dicts": { "version": "8.13.1", "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.13.1.tgz", @@ -989,131 +1130,6 @@ "node": ">=12" } }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "dev": true, - "license": "MIT", - "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", - "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/config-array": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.17.1.tgz", - "integrity": "sha512-BlYOpej8AQ8Ev9xVqroV7a02JK3SkBAaN9GfMMH9W6Ch8FlQlkjGw4Ir7+FgYwfirivAf4t+GtzuAxqfukmISA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/object-schema": "^2.1.4", - "debug": "^4.3.1", - "minimatch": "^3.1.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^10.0.1", - "globals": "^14.0.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/eslintrc/node_modules/argparse": { - "version": "2.0.1", - "dev": true, - "license": "Python-2.0" - }, - "node_modules/@eslint/eslintrc/node_modules/js-yaml": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/@eslint/js": { - "version": "9.8.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.8.0.tgz", - "integrity": "sha512-MfluB7EUfxXtv3i/++oh89uzAr4PDI4nn201hsp+qaXqsjAWzinlZEHEfPgAX4doIlKvPG/i0A9dpKxOLII8yA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/object-schema": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", - "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/retry": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", - "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -1461,27 +1477,11 @@ "win32" ] }, - "node_modules/@types/eslint": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.0.tgz", - "integrity": "sha512-gi6WQJ7cHRgZxtkQEoyHMppPjq9Kxo5Tjn2prSKDSmZrCz8TZ3jSRCeTJm+WoM+oB0WG37bRqLzaaU3q7JypGg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.5", "dev": true, "license": "MIT" }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "dev": true, - "license": "MIT" - }, "node_modules/@types/node": { "version": "20.14.11", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.11.tgz", @@ -1493,663 +1493,86 @@ "undici-types": "~5.26.4" } }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.0.1.tgz", - "integrity": "sha512-5g3Y7GDFsJAnY4Yhvk8sZtFfV6YNF2caLzjrRPUBzewjPCaj0yokePB4LJSobyCzGMzjZZYFbwuzbfDHlimXbQ==", + "node_modules/@vitest/coverage-v8": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.0.5.tgz", + "integrity": "sha512-qeFcySCg5FLO2bHHSa0tAZAOnAUbp4L6/A5JDuj9+bt53JREl8hpLjLHEWF0e/gWc8INVpJaqA7+Ene2rclpZg==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.0.1", - "@typescript-eslint/type-utils": "8.0.1", - "@typescript-eslint/utils": "8.0.1", - "@typescript-eslint/visitor-keys": "8.0.1", - "graphemer": "^1.4.0", - "ignore": "^5.3.1", - "natural-compare": "^1.4.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "@ampproject/remapping": "^2.3.0", + "@bcoe/v8-coverage": "^0.2.3", + "debug": "^4.3.5", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-lib-source-maps": "^5.0.6", + "istanbul-reports": "^3.1.7", + "magic-string": "^0.30.10", + "magicast": "^0.3.4", + "std-env": "^3.7.0", + "test-exclude": "^7.0.1", + "tinyrainbow": "^1.2.0" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "vitest": "2.0.5" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.0.1.tgz", - "integrity": "sha512-NpixInP5dm7uukMiRyiHjRKkom5RIFA4dfiHvalanD2cF0CLUuQqxfg8PtEUo9yqJI2bBhF+pcSafqnG3UBnRQ==", + "node_modules/@vitest/expect": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.0.5.tgz", + "integrity": "sha512-yHZtwuP7JZivj65Gxoi8upUN2OzHTi3zVfjwdpu2WrvCZPLwsJ2Ey5ILIPccoW23dd/zQBlJ4/dhi7DWNyXCpA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.0.1", - "@typescript-eslint/visitor-keys": "8.0.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "@vitest/spy": "2.0.5", + "@vitest/utils": "2.0.5", + "chai": "^5.1.1", + "tinyrainbow": "^1.2.0" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "url": "https://opencollective.com/vitest" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.1.tgz", - "integrity": "sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==", + "node_modules/@vitest/pretty-format": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.0.5.tgz", + "integrity": "sha512-h8k+1oWHfwTkyTkb9egzwNMfJAEx4veaPSnMeKbVSjp4euqGSbQlm5+6VHwTr7u4FJslVVsUG5nopCaAYdOmSQ==", "dev": true, "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "dependencies": { + "tinyrainbow": "^1.2.0" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "url": "https://opencollective.com/vitest" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.1.tgz", - "integrity": "sha512-8V9hriRvZQXPWU3bbiUV4Epo7EvgM6RTs+sUmxp5G//dBGy402S7Fx0W0QkB2fb4obCF8SInoUzvTYtc3bkb5w==", + "node_modules/@vitest/runner": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.0.5.tgz", + "integrity": "sha512-TfRfZa6Bkk9ky4tW0z20WKXFEwwvWhRY+84CnSEtq4+3ZvDlJyY32oNTJtM7AW9ihW90tX/1Q78cb6FjoAs+ig==", "dev": true, - "license": "BSD-2-Clause", + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.0.1", - "@typescript-eslint/visitor-keys": "8.0.1", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "@vitest/utils": "2.0.5", + "pathe": "^1.1.2" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "url": "https://opencollective.com/vitest" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.0.1.tgz", - "integrity": "sha512-CBFR0G0sCt0+fzfnKaciu9IBsKvEKYwN9UZ+eeogK1fYHg4Qxk1yf/wLQkLXlq8wbU2dFlgAesxt8Gi76E8RTA==", + "node_modules/@vitest/snapshot": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.0.5.tgz", + "integrity": "sha512-SgCPUeDFLaM0mIUHfaArq8fD2WbaXG/zVXjRupthYfYGzc8ztbFbu6dUNOblBG7XLMR1kEhS/DNnfCZ2IhdDew==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.0.1", - "@typescript-eslint/types": "8.0.1", - "@typescript-eslint/typescript-estree": "8.0.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.0.1.tgz", - "integrity": "sha512-W5E+o0UfUcK5EgchLZsyVWqARmsM7v54/qEq6PY3YI5arkgmCzHiuk0zKSJJbm71V0xdRna4BGomkCTXz2/LkQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.0.1", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.0.1.tgz", - "integrity": "sha512-5IgYJ9EO/12pOUwiBKFkpU7rS3IU21mtXzB81TNwq2xEybcmAZrE9qwDtsb5uQd9aVO9o0fdabFyAmKveXyujg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@typescript-eslint/scope-manager": "8.0.1", - "@typescript-eslint/types": "8.0.1", - "@typescript-eslint/typescript-estree": "8.0.1", - "@typescript-eslint/visitor-keys": "8.0.1", - "debug": "^4.3.4" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.0.1.tgz", - "integrity": "sha512-NpixInP5dm7uukMiRyiHjRKkom5RIFA4dfiHvalanD2cF0CLUuQqxfg8PtEUo9yqJI2bBhF+pcSafqnG3UBnRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.0.1", - "@typescript-eslint/visitor-keys": "8.0.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.1.tgz", - "integrity": "sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.1.tgz", - "integrity": "sha512-8V9hriRvZQXPWU3bbiUV4Epo7EvgM6RTs+sUmxp5G//dBGy402S7Fx0W0QkB2fb4obCF8SInoUzvTYtc3bkb5w==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@typescript-eslint/types": "8.0.1", - "@typescript-eslint/visitor-keys": "8.0.1", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.0.1.tgz", - "integrity": "sha512-W5E+o0UfUcK5EgchLZsyVWqARmsM7v54/qEq6PY3YI5arkgmCzHiuk0zKSJJbm71V0xdRna4BGomkCTXz2/LkQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.0.1", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", - "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.0.1.tgz", - "integrity": "sha512-+/UT25MWvXeDX9YaHv1IS6KI1fiuTto43WprE7pgSMswHbn1Jm9GEM4Txp+X74ifOWV8emu2AWcbLhpJAvD5Ng==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/typescript-estree": "8.0.1", - "@typescript-eslint/utils": "8.0.1", - "debug": "^4.3.4", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/scope-manager": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.0.1.tgz", - "integrity": "sha512-NpixInP5dm7uukMiRyiHjRKkom5RIFA4dfiHvalanD2cF0CLUuQqxfg8PtEUo9yqJI2bBhF+pcSafqnG3UBnRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.0.1", - "@typescript-eslint/visitor-keys": "8.0.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.1.tgz", - "integrity": "sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.1.tgz", - "integrity": "sha512-8V9hriRvZQXPWU3bbiUV4Epo7EvgM6RTs+sUmxp5G//dBGy402S7Fx0W0QkB2fb4obCF8SInoUzvTYtc3bkb5w==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@typescript-eslint/types": "8.0.1", - "@typescript-eslint/visitor-keys": "8.0.1", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.0.1.tgz", - "integrity": "sha512-CBFR0G0sCt0+fzfnKaciu9IBsKvEKYwN9UZ+eeogK1fYHg4Qxk1yf/wLQkLXlq8wbU2dFlgAesxt8Gi76E8RTA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.0.1", - "@typescript-eslint/types": "8.0.1", - "@typescript-eslint/typescript-estree": "8.0.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.0.1.tgz", - "integrity": "sha512-W5E+o0UfUcK5EgchLZsyVWqARmsM7v54/qEq6PY3YI5arkgmCzHiuk0zKSJJbm71V0xdRna4BGomkCTXz2/LkQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.0.1", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", - "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", - "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", - "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/typescript-estree": "7.18.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", - "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "7.18.0", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@vitest/coverage-v8": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.0.5.tgz", - "integrity": "sha512-qeFcySCg5FLO2bHHSa0tAZAOnAUbp4L6/A5JDuj9+bt53JREl8hpLjLHEWF0e/gWc8INVpJaqA7+Ene2rclpZg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@ampproject/remapping": "^2.3.0", - "@bcoe/v8-coverage": "^0.2.3", - "debug": "^4.3.5", - "istanbul-lib-coverage": "^3.2.2", - "istanbul-lib-report": "^3.0.1", - "istanbul-lib-source-maps": "^5.0.6", - "istanbul-reports": "^3.1.7", - "magic-string": "^0.30.10", - "magicast": "^0.3.4", - "std-env": "^3.7.0", - "test-exclude": "^7.0.1", - "tinyrainbow": "^1.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "vitest": "2.0.5" - } - }, - "node_modules/@vitest/expect": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.0.5.tgz", - "integrity": "sha512-yHZtwuP7JZivj65Gxoi8upUN2OzHTi3zVfjwdpu2WrvCZPLwsJ2Ey5ILIPccoW23dd/zQBlJ4/dhi7DWNyXCpA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/spy": "2.0.5", - "@vitest/utils": "2.0.5", - "chai": "^5.1.1", - "tinyrainbow": "^1.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/pretty-format": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.0.5.tgz", - "integrity": "sha512-h8k+1oWHfwTkyTkb9egzwNMfJAEx4veaPSnMeKbVSjp4euqGSbQlm5+6VHwTr7u4FJslVVsUG5nopCaAYdOmSQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "tinyrainbow": "^1.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/runner": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.0.5.tgz", - "integrity": "sha512-TfRfZa6Bkk9ky4tW0z20WKXFEwwvWhRY+84CnSEtq4+3ZvDlJyY32oNTJtM7AW9ihW90tX/1Q78cb6FjoAs+ig==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/utils": "2.0.5", - "pathe": "^1.1.2" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/snapshot": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.0.5.tgz", - "integrity": "sha512-SgCPUeDFLaM0mIUHfaArq8fD2WbaXG/zVXjRupthYfYGzc8ztbFbu6dUNOblBG7XLMR1kEhS/DNnfCZ2IhdDew==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/pretty-format": "2.0.5", - "magic-string": "^0.30.10", - "pathe": "^1.1.2" + "@vitest/pretty-format": "2.0.5", + "magic-string": "^0.30.10", + "pathe": "^1.1.2" }, "funding": { "url": "https://opencollective.com/vitest" @@ -2184,44 +1607,6 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", - "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, - "license": "MIT", - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/ansi-regex": { "version": "5.0.1", "dev": true, @@ -2249,16 +1634,6 @@ "dev": true, "license": "MIT" }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -2273,15 +1648,6 @@ "dev": true, "license": "MIT" }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/braces": { "version": "3.0.3", "dev": true, @@ -2423,11 +1789,6 @@ "node": ">= 6" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "dev": true, - "license": "MIT" - }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", @@ -2705,310 +2066,74 @@ } }, "node_modules/deep-eql": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", - "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/deep-is": { - "version": "0.1.3", - "dev": true, - "license": "MIT" - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, - "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/env-paths": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", - "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/esbuild": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", - "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.5", - "@esbuild/android-arm": "0.21.5", - "@esbuild/android-arm64": "0.21.5", - "@esbuild/android-x64": "0.21.5", - "@esbuild/darwin-arm64": "0.21.5", - "@esbuild/darwin-x64": "0.21.5", - "@esbuild/freebsd-arm64": "0.21.5", - "@esbuild/freebsd-x64": "0.21.5", - "@esbuild/linux-arm": "0.21.5", - "@esbuild/linux-arm64": "0.21.5", - "@esbuild/linux-ia32": "0.21.5", - "@esbuild/linux-loong64": "0.21.5", - "@esbuild/linux-mips64el": "0.21.5", - "@esbuild/linux-ppc64": "0.21.5", - "@esbuild/linux-riscv64": "0.21.5", - "@esbuild/linux-s390x": "0.21.5", - "@esbuild/linux-x64": "0.21.5", - "@esbuild/netbsd-x64": "0.21.5", - "@esbuild/openbsd-x64": "0.21.5", - "@esbuild/sunos-x64": "0.21.5", - "@esbuild/win32-arm64": "0.21.5", - "@esbuild/win32-ia32": "0.21.5", - "@esbuild/win32-x64": "0.21.5" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "9.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.8.0.tgz", - "integrity": "sha512-K8qnZ/QJzT2dLKdZJVX6W4XOwBzutMYmt0lqUS+JdXgd+HTYFlonFgkJ8s44d/zMPPCnOOk0kMWCApCPhiOy9A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.11.0", - "@eslint/config-array": "^0.17.1", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.8.0", - "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.3.0", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.0.2", - "eslint-visitor-keys": "^4.0.0", - "espree": "^10.1.0", - "esquery": "^1.5.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^8.0.0", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://eslint.org/donate" - } - }, - "node_modules/eslint-config-prettier": { - "version": "9.1.0", - "dev": true, - "license": "MIT", - "bin": { - "eslint-config-prettier": "bin/cli.js" - }, - "peerDependencies": { - "eslint": ">=7.0.0" - } - }, - "node_modules/eslint-plugin-vitest": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-vitest/-/eslint-plugin-vitest-0.5.4.tgz", - "integrity": "sha512-um+odCkccAHU53WdKAw39MY61+1x990uXjSPguUCq3VcEHdqJrOb8OTMrbYlY6f9jAKx7x98kLVlIe3RJeJqoQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/utils": "^7.7.1" - }, - "engines": { - "node": "^18.0.0 || >= 20.0.0" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "vitest": "*" - }, - "peerDependenciesMeta": { - "@typescript-eslint/eslint-plugin": { - "optional": true - }, - "vitest": { - "optional": true - } - } - }, - "node_modules/eslint-scope": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.2.tgz", - "integrity": "sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/eslint/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.3" - }, "engines": { - "node": ">=10.13.0" + "node": ">=6" } }, - "node_modules/espree": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz", - "integrity": "sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==", + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/env-paths": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", + "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.12.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.0.0" - }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, - "license": "Apache-2.0", + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": ">=12" }, - "funding": { - "url": "https://opencollective.com/eslint" + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" } }, "node_modules/esprima": { @@ -3025,40 +2150,6 @@ "node": ">=4" } }, - "node_modules/esquery": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", - "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, "node_modules/estree-walker": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", @@ -3069,14 +2160,6 @@ "@types/estree": "^1.0.0" } }, - "node_modules/esutils": { - "version": "2.0.3", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/execa": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", @@ -3101,11 +2184,6 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "dev": true, - "license": "MIT" - }, "node_modules/fast-equals": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.0.1.tgz", @@ -3136,11 +2214,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "dev": true, - "license": "MIT" - }, "node_modules/fastq": { "version": "1.13.0", "dev": true, @@ -3149,19 +2222,6 @@ "reusify": "^1.0.4" } }, - "node_modules/file-entry-cache": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "flat-cache": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, "node_modules/fill-range": { "version": "7.1.1", "dev": true, @@ -3173,21 +2233,6 @@ "node": ">=8" } }, - "node_modules/find-up": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/find-up-simple": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", @@ -3200,20 +2245,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/flat-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", - "dev": true, - "license": "MIT", - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.4" - }, - "engines": { - "node": ">=16" - } - }, "node_modules/flatted": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", @@ -3319,45 +2350,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globals": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/graphemer": { - "version": "1.4.0", - "dev": true, - "license": "MIT" - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -3393,14 +2385,6 @@ "node": ">=16.17.0" } }, - "node_modules/ignore": { - "version": "5.3.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, "node_modules/import-fresh": { "version": "3.3.0", "dev": true, @@ -3445,14 +2429,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.19" - } - }, "node_modules/ini": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", @@ -3499,14 +2475,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", @@ -3595,16 +2563,6 @@ "dev": true, "license": "MIT" }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "dev": true, - "license": "MIT" - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, "node_modules/keyv": { "version": "4.5.4", "dev": true, @@ -3613,37 +2571,6 @@ "json-buffer": "3.0.1" } }, - "node_modules/levn": { - "version": "0.4.1", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "dev": true, - "license": "MIT" - }, "node_modules/loupe": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.1.tgz", @@ -3694,13 +2621,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/memorystream": { - "version": "0.3.1", - "dev": true, - "engines": { - "node": ">= 0.10.0" - } - }, "node_modules/merge-stream": { "version": "2.0.0", "dev": true, @@ -3739,17 +2659,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/minimatch": { - "version": "3.1.2", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", @@ -3768,77 +2677,18 @@ "version": "3.3.7", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "dev": true, - "license": "MIT" - }, - "node_modules/npm-normalize-package-bin": { - "version": "3.0.1", - "dev": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm-run-all2": { - "version": "6.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.2.1", - "cross-spawn": "^7.0.3", - "memorystream": "^0.3.1", - "minimatch": "^9.0.0", - "pidtree": "^0.6.0", - "read-package-json-fast": "^3.0.2", - "shell-quote": "^1.7.3" - }, - "bin": { - "npm-run-all": "bin/npm-run-all/index.js", - "npm-run-all2": "bin/npm-run-all/index.js", - "run-p": "bin/run-p/index.js", - "run-s": "bin/run-s/index.js" - }, - "engines": { - "node": "^14.18.0 || ^16.13.0 || >=18.0.0", - "npm": ">= 8" - } - }, - "node_modules/npm-run-all2/node_modules/brace-expansion": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/npm-run-all2/node_modules/minimatch": { - "version": "9.0.5", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" }, "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, "node_modules/npm-run-path": { @@ -3886,50 +2736,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/optionator": { - "version": "0.9.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/package-json-from-dist": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", @@ -3948,14 +2754,6 @@ "node": ">=8" } }, - "node_modules/path-exists": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/path-key": { "version": "3.1.1", "dev": true, @@ -3980,16 +2778,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/pathe": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", @@ -4021,17 +2809,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pidtree": { - "version": "0.6.0", - "dev": true, - "license": "MIT", - "bin": { - "pidtree": "bin/pidtree.js" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/postcss": { "version": "8.4.39", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz", @@ -4060,37 +2837,6 @@ "node": "^10 || ^12 || >=14" } }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", - "dev": true, - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/queue-microtask": { "version": "1.2.3", "dev": true, @@ -4110,26 +2856,6 @@ ], "license": "MIT" }, - "node_modules/read-package-json-fast": { - "version": "3.0.2", - "dev": true, - "license": "ISC", - "dependencies": { - "json-parse-even-better-errors": "^3.0.0", - "npm-normalize-package-bin": "^3.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/read-package-json-fast/node_modules/json-parse-even-better-errors": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", @@ -4245,11 +2971,6 @@ "node": ">=8" } }, - "node_modules/shell-quote": { - "version": "1.7.3", - "dev": true, - "license": "MIT" - }, "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", @@ -4268,16 +2989,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/source-map-js": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", @@ -4401,17 +3112,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -4482,11 +3182,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/text-table": { - "version": "0.2.0", - "dev": true, - "license": "MIT" - }, "node_modules/tinybench": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", @@ -4541,28 +3236,6 @@ "node": ">=8.0" } }, - "node_modules/ts-api-utils": { - "version": "1.3.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=16" - }, - "peerDependencies": { - "typescript": ">=4.2.0" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/typescript": { "version": "5.5.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", @@ -4577,158 +3250,6 @@ "node": ">=14.17" } }, - "node_modules/typescript-eslint": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.0.1.tgz", - "integrity": "sha512-V3Y+MdfhawxEjE16dWpb7/IOgeXnLwAEEkS7v8oDqNcR1oYlqWhGH/iHqHdKVdpWme1VPZ0SoywXAkCqawj2eQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/eslint-plugin": "8.0.1", - "@typescript-eslint/parser": "8.0.1", - "@typescript-eslint/utils": "8.0.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/scope-manager": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.0.1.tgz", - "integrity": "sha512-NpixInP5dm7uukMiRyiHjRKkom5RIFA4dfiHvalanD2cF0CLUuQqxfg8PtEUo9yqJI2bBhF+pcSafqnG3UBnRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.0.1", - "@typescript-eslint/visitor-keys": "8.0.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/types": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.1.tgz", - "integrity": "sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.1.tgz", - "integrity": "sha512-8V9hriRvZQXPWU3bbiUV4Epo7EvgM6RTs+sUmxp5G//dBGy402S7Fx0W0QkB2fb4obCF8SInoUzvTYtc3bkb5w==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@typescript-eslint/types": "8.0.1", - "@typescript-eslint/visitor-keys": "8.0.1", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/utils": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.0.1.tgz", - "integrity": "sha512-CBFR0G0sCt0+fzfnKaciu9IBsKvEKYwN9UZ+eeogK1fYHg4Qxk1yf/wLQkLXlq8wbU2dFlgAesxt8Gi76E8RTA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.0.1", - "@typescript-eslint/types": "8.0.1", - "@typescript-eslint/typescript-estree": "8.0.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.0.1.tgz", - "integrity": "sha512-W5E+o0UfUcK5EgchLZsyVWqARmsM7v54/qEq6PY3YI5arkgmCzHiuk0zKSJJbm71V0xdRna4BGomkCTXz2/LkQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.0.1", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/typescript-eslint/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/typescript-eslint/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/undici-types": { "version": "5.26.5", "dev": true, @@ -4736,14 +3257,6 @@ "optional": true, "peer": true }, - "node_modules/uri-js": { - "version": "4.4.1", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "punycode": "^2.1.0" - } - }, "node_modules/vite": { "version": "5.3.5", "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.5.tgz", @@ -5052,17 +3565,6 @@ "engines": { "node": ">= 14" } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } } } } diff --git a/package.json b/package.json index 8c6f3aba..f38f1946 100644 --- a/package.json +++ b/package.json @@ -1,70 +1,54 @@ { - "name": "@progfay/scrapbox-parser", - "version": "9.0.0", - "type": "module", - "description": "parse Scrapbox notation to JavaScript Object", - "files": [ - "lib", - "esm", - "umd" - ], - "main": "./lib/index.js", - "module": "./esm/index.js", - "types": "./lib/index.d.ts", - "unpkg": "./umd/scrapbox-parser.umd.cjs", - "exports": { - "import": "./esm/index.js", - "require": "./lib/index.js", - "node": "./esm/index.js", - "default": "./lib/index.js" - }, - "scripts": { - "build": "run-p build:*", - "build:cjs": "tsc -p ./tsconfig.cjs.json", - "build:esm": "tsc -p ./tsconfig.esm.json", - "build:umd": "vite build", - "prepare": "npm run clean && npm run build", - "clean": "node -e '[`lib`, `esm`, `umd`, `.cjs.tsbuildinfo`, `.esm.tsbuildinfo`].forEach(path => { fs.rmSync(path, {recursive:true, force:true}) })'", - "test": "vitest run --coverage", - "test:update": "vitest run --updateSnapshot --no-cache", - "lint": "run-p lint:*", - "lint:prettier": "prettier --check .", - "lint:eslint": "eslint .", - "lint:cspell": "cspell --no-summary '**/*'", - "lint:typescript": "tsc -p ./tsconfig.eslint.json", - "format": "run-s format:prettier format:eslint", - "format:prettier": "prettier --write .", - "format:eslint": "eslint --fix ." - }, - "repository": { - "type": "git", - "url": "git+https://github.com/progfay/scrapbox-parser.git" - }, - "keywords": [ - "scrapbox", - "parser" - ], - "author": "progfay", - "license": "MIT", - "bugs": { - "url": "https://github.com/progfay/scrapbox-parser/issues" - }, - "homepage": "https://github.com/progfay/scrapbox-parser#readme", - "devDependencies": { - "@types/eslint": "9.6.0", - "@vitest/coverage-v8": "2.0.5", - "cspell": "8.13.1", - "eslint": "9.8.0", - "eslint-config-prettier": "9.1.0", - "eslint-plugin-vitest": "0.5.4", - "npm-run-all2": "6.2.2", - "prettier": "3.3.3", - "typescript": "5.5.4", - "typescript-eslint": "8.0.1", - "vite": "5.3.5", - "vitest": "2.0.5" - }, - "publishConfig": { - "access": "public" - } + "name": "@progfay/scrapbox-parser", + "version": "9.0.0", + "type": "module", + "description": "parse Scrapbox notation to JavaScript Object", + "files": ["lib", "esm", "umd"], + "main": "./lib/index.js", + "module": "./esm/index.js", + "types": "./lib/index.d.ts", + "unpkg": "./umd/scrapbox-parser.umd.cjs", + "exports": { + "import": "./esm/index.js", + "require": "./lib/index.js", + "node": "./esm/index.js", + "default": "./lib/index.js" + }, + "scripts": { + "build": "run-p build:*", + "build:cjs": "tsc -p ./tsconfig.cjs.json", + "build:esm": "tsc -p ./tsconfig.esm.json", + "build:umd": "vite build", + "prepare": "npm run clean && npm run build", + "clean": "node -e '[`lib`, `esm`, `umd`, `.cjs.tsbuildinfo`, `.esm.tsbuildinfo`].forEach(path => { fs.rmSync(path, {recursive:true, force:true}) })'", + "test": "vitest run --coverage", + "test:update": "vitest run --updateSnapshot --no-cache", + "lint": "npm run lint:biome && npm run lint:cspell && npm run lint:tsc", + "lint:biome": "biome lint .", + "lint:cspell": "cspell --no-summary '**/*'", + "lint:tsc": "tsc -p ./tsconfig.eslint.json", + "format": "biome format ." + }, + "repository": { + "type": "git", + "url": "git+https://github.com/progfay/scrapbox-parser.git" + }, + "keywords": ["scrapbox", "parser"], + "author": "progfay", + "license": "MIT", + "bugs": { + "url": "https://github.com/progfay/scrapbox-parser/issues" + }, + "homepage": "https://github.com/progfay/scrapbox-parser#readme", + "devDependencies": { + "@biomejs/biome": "1.8.3", + "@vitest/coverage-v8": "2.0.5", + "cspell": "8.13.1", + "typescript": "5.5.4", + "vite": "5.3.5", + "vitest": "2.0.5" + }, + "publishConfig": { + "access": "public" + } } diff --git a/renovate.json b/renovate.json index 4f39080e..989cc91e 100644 --- a/renovate.json +++ b/renovate.json @@ -1,3 +1,3 @@ { - "extends": ["config:base"] + "extends": ["config:base"] } diff --git a/src/block/CodeBlock.ts b/src/block/CodeBlock.ts index 6eb2f75f..b8f63646 100644 --- a/src/block/CodeBlock.ts +++ b/src/block/CodeBlock.ts @@ -1,33 +1,33 @@ import type { Row } from "./Row"; export interface CodeBlockPack { - type: "codeBlock"; - rows: Row[]; + type: "codeBlock"; + rows: Row[]; } /** * Scrapbox {@link https://scrapbox.io/help/Syntax#58348ae2651ee500008d67df | code block} type */ export interface CodeBlock { - indent: number; - type: "codeBlock"; - fileName: string; - content: string; + indent: number; + type: "codeBlock"; + fileName: string; + content: string; } export const convertToCodeBlock = (pack: CodeBlockPack): CodeBlock => { - const { - rows: [head, ...body], - } = pack; - const { indent = 0, text = "" } = head ?? {}; - const fileName: string = text.replace(/^\s*code:/, ""); + const { + rows: [head, ...body], + } = pack; + const { indent = 0, text = "" } = head ?? {}; + const fileName: string = text.replace(/^\s*code:/, ""); - return { - indent, - type: "codeBlock", - fileName, - content: body - .map((row: Row): string => row.text.substring(indent + 1)) - .join("\n"), - }; + return { + indent, + type: "codeBlock", + fileName, + content: body + .map((row: Row): string => row.text.substring(indent + 1)) + .join("\n"), + }; }; diff --git a/src/block/Line.ts b/src/block/Line.ts index f8819e46..3eadfbc5 100644 --- a/src/block/Line.ts +++ b/src/block/Line.ts @@ -4,28 +4,28 @@ import type { Row } from "./Row"; import type { Node } from "./node/type"; export interface LinePack { - type: "line"; - rows: [Row]; + type: "line"; + rows: [Row]; } /** * Scrapbox line type */ export interface Line { - indent: number; - type: "line"; - nodes: Node[]; + indent: number; + type: "line"; + nodes: Node[]; } export const convertToLine = (pack: LinePack): Line => { - const { indent, text } = pack.rows[0]; - return { - indent, - type: "line", - nodes: convertToNodes(text.substring(indent), { - nested: false, - quoted: false, - context: "line", - }), - }; + const { indent, text } = pack.rows[0]; + return { + indent, + type: "line", + nodes: convertToNodes(text.substring(indent), { + nested: false, + quoted: false, + context: "line", + }), + }; }; diff --git a/src/block/Pack.ts b/src/block/Pack.ts index bf0ad7bf..46ed3be0 100644 --- a/src/block/Pack.ts +++ b/src/block/Pack.ts @@ -8,40 +8,40 @@ import type { TitlePack } from "./Title"; export type Pack = TitlePack | CodeBlockPack | TablePack | LinePack; const isChildRowOfPack = (pack: Pack, row: Row): boolean => - (pack.type === "codeBlock" || pack.type === "table") && - row.indent > (pack.rows[0]?.indent ?? 0); + (pack.type === "codeBlock" || pack.type === "table") && + row.indent > (pack.rows[0]?.indent ?? 0); const packing = (packs: Pack[], row: Row): Pack[] => { - const lastPack = packs[packs.length - 1]; - if (lastPack !== undefined && isChildRowOfPack(lastPack, row)) { - lastPack.rows.push(row); - return packs; - } + const lastPack = packs[packs.length - 1]; + if (lastPack !== undefined && isChildRowOfPack(lastPack, row)) { + lastPack.rows.push(row); + return packs; + } - packs.push({ - type: /^\s*code:/.test(row.text) - ? "codeBlock" - : /^\s*table:/.test(row.text) - ? "table" - : "line", - rows: [row], - }); + packs.push({ + type: /^\s*code:/.test(row.text) + ? "codeBlock" + : /^\s*table:/.test(row.text) + ? "table" + : "line", + rows: [row], + }); - return packs; + return packs; }; export const packRows = (rows: Row[], opts: ParserOption): Pack[] => { - if (opts.hasTitle ?? true) { - const [title, ...body] = rows; - if (title === undefined) return []; - return [ - { - type: "title", - rows: [title], - }, - ...body.reduce(packing, []), - ]; - } + if (opts.hasTitle ?? true) { + const [title, ...body] = rows; + if (title === undefined) return []; + return [ + { + type: "title", + rows: [title], + }, + ...body.reduce(packing, []), + ]; + } - return rows.reduce(packing, []); + return rows.reduce(packing, []); }; diff --git a/src/block/Row.ts b/src/block/Row.ts index 77576428..2b501f89 100644 --- a/src/block/Row.ts +++ b/src/block/Row.ts @@ -1,10 +1,10 @@ export interface Row { - indent: number; - text: string; + indent: number; + text: string; } export const parseToRows = (input: string): Row[] => - input.split("\n").map((text) => ({ - indent: /^\s+/.exec(text)?.[0]?.length ?? 0, - text, - })); + input.split("\n").map((text) => ({ + indent: /^\s+/.exec(text)?.[0]?.length ?? 0, + text, + })); diff --git a/src/block/Table.ts b/src/block/Table.ts index 4204f14a..5ec9b308 100644 --- a/src/block/Table.ts +++ b/src/block/Table.ts @@ -4,41 +4,41 @@ import type { Row } from "./Row"; import type { Node } from "./node/type"; export interface TablePack { - type: "table"; - rows: Row[]; + type: "table"; + rows: Row[]; } /** * Scrapbox {@link https://scrapbox.io/help/Syntax#58795996651ee5000012d4c7 | table} type */ export interface Table { - indent: number; - type: "table"; - fileName: string; - cells: Node[][][]; + indent: number; + type: "table"; + fileName: string; + cells: Node[][][]; } export const convertToTable = (pack: TablePack): Table => { - const { - rows: [head, ...body], - } = pack; - const { indent = 0, text = "" } = head ?? {}; - const fileName = text.replace(/^\s*table:/, ""); + const { + rows: [head, ...body], + } = pack; + const { indent = 0, text = "" } = head ?? {}; + const fileName = text.replace(/^\s*table:/, ""); - return { - indent, - type: "table", - fileName, - cells: body - .map((row: Row): string => row.text.substring(indent + 1)) - .map((text: string): Node[][] => - text.split("\t").map((block: string): Node[] => - convertToNodes(block, { - nested: false, - quoted: false, - context: "table", - }), - ), - ), - }; + return { + indent, + type: "table", + fileName, + cells: body + .map((row: Row): string => row.text.substring(indent + 1)) + .map((text: string): Node[][] => + text.split("\t").map((block: string): Node[] => + convertToNodes(block, { + nested: false, + quoted: false, + context: "table", + }), + ), + ), + }; }; diff --git a/src/block/Title.ts b/src/block/Title.ts index 3a98fc4c..76c442ce 100644 --- a/src/block/Title.ts +++ b/src/block/Title.ts @@ -1,21 +1,21 @@ import type { Row } from "./Row"; export interface TitlePack { - type: "title"; - rows: [Row]; + type: "title"; + rows: [Row]; } /** * Scrapbox title type */ export interface Title { - type: "title"; - text: string; + type: "title"; + text: string; } export const convertToTitle = (pack: TitlePack): Title => { - return { - type: "title", - text: pack.rows[0].text, - }; + return { + type: "title", + text: pack.rows[0].text, + }; }; diff --git a/src/block/index.ts b/src/block/index.ts index 6dc61aac..c1dc6634 100644 --- a/src/block/index.ts +++ b/src/block/index.ts @@ -1,13 +1,13 @@ -import { convertToTitle } from "./Title"; import { convertToCodeBlock } from "./CodeBlock"; -import { convertToTable } from "./Table"; import { convertToLine } from "./Line"; +import { convertToTable } from "./Table"; +import { convertToTitle } from "./Title"; -import type { Pack } from "./Pack"; -import type { Title } from "./Title"; import type { CodeBlock } from "./CodeBlock"; -import type { Table } from "./Table"; import type { Line } from "./Line"; +import type { Pack } from "./Pack"; +import type { Table } from "./Table"; +import type { Title } from "./Title"; /** * Scrapbox block type @@ -15,17 +15,17 @@ import type { Line } from "./Line"; export type Block = Title | CodeBlock | Table | Line; export const convertToBlock = (pack: Pack): Block => { - switch (pack.type) { - case "title": - return convertToTitle(pack); + switch (pack.type) { + case "title": + return convertToTitle(pack); - case "codeBlock": - return convertToCodeBlock(pack); + case "codeBlock": + return convertToCodeBlock(pack); - case "table": - return convertToTable(pack); + case "table": + return convertToTable(pack); - case "line": - return convertToLine(pack); - } + case "line": + return convertToLine(pack); + } }; diff --git a/src/block/node/BlankNode.ts b/src/block/node/BlankNode.ts index 93b0d218..bc319e86 100644 --- a/src/block/node/BlankNode.ts +++ b/src/block/node/BlankNode.ts @@ -1,25 +1,25 @@ -import { createNodeParser } from "./creator"; import { createPlainNode } from "./PlainNode"; +import { createNodeParser } from "./creator"; +import type { NodeCreator } from "./creator"; import type { NodeParser } from "./index"; import type { BlankNode, PlainNode } from "./type"; -import type { NodeCreator } from "./creator"; const blankRegExp = /\[\s+\]/; const createBlankNode: NodeCreator = (raw, opts) => - opts.context === "table" - ? createPlainNode(raw, opts) - : [ - { - type: "blank", - raw, - text: raw.substring(1, raw.length - 1), - }, - ]; + opts.context === "table" + ? createPlainNode(raw, opts) + : [ + { + type: "blank", + raw, + text: raw.substring(1, raw.length - 1), + }, + ]; export const BlankNodeParser: NodeParser = createNodeParser(createBlankNode, { - parseOnNested: false, - parseOnQuoted: true, - patterns: [blankRegExp], + parseOnNested: false, + parseOnQuoted: true, + patterns: [blankRegExp], }); diff --git a/src/block/node/CodeNode.ts b/src/block/node/CodeNode.ts index 551a37b4..dc8a3a96 100644 --- a/src/block/node/CodeNode.ts +++ b/src/block/node/CodeNode.ts @@ -1,25 +1,25 @@ -import { createNodeParser } from "./creator"; import { createPlainNode } from "./PlainNode"; +import { createNodeParser } from "./creator"; +import type { NodeCreator } from "./creator"; import type { NodeParser } from "./index"; import type { CodeNode, PlainNode } from "./type"; -import type { NodeCreator } from "./creator"; const codeRegExp = /`.*?`/; const createCodeNode: NodeCreator = (raw, opts) => - opts.context === "table" - ? createPlainNode(raw, opts) - : [ - { - type: "code", - raw, - text: raw.substring(1, raw.length - 1), - }, - ]; + opts.context === "table" + ? createPlainNode(raw, opts) + : [ + { + type: "code", + raw, + text: raw.substring(1, raw.length - 1), + }, + ]; export const CodeNodeParser: NodeParser = createNodeParser(createCodeNode, { - parseOnNested: false, - parseOnQuoted: true, - patterns: [codeRegExp], + parseOnNested: false, + parseOnQuoted: true, + patterns: [codeRegExp], }); diff --git a/src/block/node/CommandLineNode.ts b/src/block/node/CommandLineNode.ts index 0969fbbe..fa760012 100644 --- a/src/block/node/CommandLineNode.ts +++ b/src/block/node/CommandLineNode.ts @@ -1,38 +1,38 @@ -import { createNodeParser } from "./creator"; import { createPlainNode } from "./PlainNode"; +import { createNodeParser } from "./creator"; +import type { NodeCreator } from "./creator"; import type { NodeParser } from "./index"; import type { CommandLineNode, PlainNode } from "./type"; -import type { NodeCreator } from "./creator"; const commandLineRegExp = /^[$%] .+$/; const createCommandLineNode: NodeCreator = ( - raw: string, - opts, + raw: string, + opts, ) => { - if (opts.context === "table") { - return createPlainNode(raw, opts); - } + if (opts.context === "table") { + return createPlainNode(raw, opts); + } - const symbol = raw[0] ?? ""; - const text = raw.substring(2); + const symbol = raw[0] ?? ""; + const text = raw.substring(2); - return [ - { - type: "commandLine", - raw, - symbol, - text, - }, - ]; + return [ + { + type: "commandLine", + raw, + symbol, + text, + }, + ]; }; export const CommandLineNodeParser: NodeParser = createNodeParser( - createCommandLineNode, - { - parseOnNested: false, - parseOnQuoted: false, - patterns: [commandLineRegExp], - }, + createCommandLineNode, + { + parseOnNested: false, + parseOnQuoted: false, + patterns: [commandLineRegExp], + }, ); diff --git a/src/block/node/DecorationNode.ts b/src/block/node/DecorationNode.ts index cc8334fe..9701294d 100644 --- a/src/block/node/DecorationNode.ts +++ b/src/block/node/DecorationNode.ts @@ -1,47 +1,47 @@ -import { convertToNodes } from "./index"; -import { createNodeParser } from "./creator"; import { createPlainNode } from "./PlainNode"; +import { createNodeParser } from "./creator"; +import { convertToNodes } from "./index"; +import type { NodeCreator } from "./creator"; import type { NodeParser } from "./index"; import type { DecorationNode, PlainNode } from "./type"; -import type { NodeCreator } from "./creator"; const decorationRegExp = /\[[!"#%&'()*+,\-./{|}<>_~]+ (?:\[[^[\]]+\]|[^\]])+\]/; type DecorationChar = - | "*" - | "!" - | '"' - | "#" - | "%" - | "&" - | "'" - | "(" - | ")" - | "+" - | "," - | "-" - | "." - | "/" - | "{" - | "|" - | "}" - | "<" - | ">" - | "_" - | "~"; + | "*" + | "!" + | '"' + | "#" + | "%" + | "&" + | "'" + | "(" + | ")" + | "+" + | "," + | "-" + | "." + | "/" + | "{" + | "|" + | "}" + | "<" + | ">" + | "_" + | "~"; type AsteriskDecorationChar = - | "*-1" - | "*-2" - | "*-3" - | "*-4" - | "*-5" - | "*-6" - | "*-7" - | "*-8" - | "*-9" - | "*-10"; + | "*-1" + | "*-2" + | "*-3" + | "*-4" + | "*-5" + | "*-6" + | "*-7" + | "*-8" + | "*-9" + | "*-10"; /** * character type of decoration @@ -49,40 +49,40 @@ type AsteriskDecorationChar = export type Decoration = Exclude | AsteriskDecorationChar; const createDecorationNode: NodeCreator = ( - raw, - opts, + raw, + opts, ) => { - if (opts.context === "table") { - return createPlainNode(raw, opts); - } + if (opts.context === "table") { + return createPlainNode(raw, opts); + } - const separatorIndex = raw.indexOf(" "); - const rawDecos = raw.substring(1, separatorIndex); - const text = raw.substring(separatorIndex + 1, raw.length - 1); + const separatorIndex = raw.indexOf(" "); + const rawDecos = raw.substring(1, separatorIndex); + const text = raw.substring(separatorIndex + 1, raw.length - 1); - const decoSet = new Set(rawDecos); - if (decoSet.has("*")) { - const asteriskCount = rawDecos.split("*").length - 1; - decoSet.delete("*"); - decoSet.add(`*-${Math.min(asteriskCount, 10)}` as AsteriskDecorationChar); - } + const decoSet = new Set(rawDecos); + if (decoSet.has("*")) { + const asteriskCount = rawDecos.split("*").length - 1; + decoSet.delete("*"); + decoSet.add(`*-${Math.min(asteriskCount, 10)}` as AsteriskDecorationChar); + } - return [ - { - type: "decoration", - raw, - rawDecos, - decos: Array.from(decoSet) as Decoration[], - nodes: convertToNodes(text, { ...opts, nested: true }), - }, - ]; + return [ + { + type: "decoration", + raw, + rawDecos, + decos: Array.from(decoSet) as Decoration[], + nodes: convertToNodes(text, { ...opts, nested: true }), + }, + ]; }; export const DecorationNodeParser: NodeParser = createNodeParser( - createDecorationNode, - { - parseOnNested: false, - parseOnQuoted: true, - patterns: [decorationRegExp], - }, + createDecorationNode, + { + parseOnNested: false, + parseOnQuoted: true, + patterns: [decorationRegExp], + }, ); diff --git a/src/block/node/ExternalLinkNode.ts b/src/block/node/ExternalLinkNode.ts index ef9d3ad1..fef2cff7 100644 --- a/src/block/node/ExternalLinkNode.ts +++ b/src/block/node/ExternalLinkNode.ts @@ -1,8 +1,8 @@ -import { createNodeParser } from "./creator"; import { createPlainNode } from "./PlainNode"; +import { createNodeParser } from "./creator"; -import type { NodeParser } from "./index"; import type { NodeCreator } from "./creator"; +import type { NodeParser } from "./index"; import type { LinkNode, PlainNode } from "./type"; const hrefFirstUrlRegExp = /\[https?:\/\/[^\s\]]+\s+[^\]]*[^\s]\]/; @@ -11,49 +11,49 @@ const bracketedUrlRegExp = /\[https?:\/\/[^\s\]]+\]/; const httpRegExp = /https?:\/\/[^\s]+/; const createExternalLinkNode: NodeCreator = ( - raw, - opts, + raw, + opts, ) => { - if (opts.context === "table") { - return createPlainNode(raw, opts); - } - - const inner = - raw.startsWith("[") && raw.endsWith("]") - ? raw.substring(1, raw.length - 1) - : raw; - - const isHrefFirst = /^https?:\/\/[^\s\]]/.test(inner); - const match = ( - isHrefFirst ? /^https?:\/\/[^\s\]]+/ : /https?:\/\/[^\s\]]+$/ - ).exec(inner); - if (match?.[0] === undefined) return []; - - const content = isHrefFirst - ? inner.substring(match[0].length) - : inner.substring(0, match.index - 1); - - return [ - { - type: "link", - raw, - pathType: "absolute", - href: match[0], - content: content.trim(), - }, - ]; + if (opts.context === "table") { + return createPlainNode(raw, opts); + } + + const inner = + raw.startsWith("[") && raw.endsWith("]") + ? raw.substring(1, raw.length - 1) + : raw; + + const isHrefFirst = /^https?:\/\/[^\s\]]/.test(inner); + const match = ( + isHrefFirst ? /^https?:\/\/[^\s\]]+/ : /https?:\/\/[^\s\]]+$/ + ).exec(inner); + if (match?.[0] === undefined) return []; + + const content = isHrefFirst + ? inner.substring(match[0].length) + : inner.substring(0, match.index - 1); + + return [ + { + type: "link", + raw, + pathType: "absolute", + href: match[0], + content: content.trim(), + }, + ]; }; export const ExternalLinkNodeParser: NodeParser = createNodeParser( - createExternalLinkNode, - { - parseOnNested: true, - parseOnQuoted: true, - patterns: [ - hrefFirstUrlRegExp, - contentFirstUrlRegExp, - bracketedUrlRegExp, - httpRegExp, - ], - }, + createExternalLinkNode, + { + parseOnNested: true, + parseOnQuoted: true, + patterns: [ + hrefFirstUrlRegExp, + contentFirstUrlRegExp, + bracketedUrlRegExp, + httpRegExp, + ], + }, ); diff --git a/src/block/node/FormulaNode.ts b/src/block/node/FormulaNode.ts index a056b5ff..32cc9080 100644 --- a/src/block/node/FormulaNode.ts +++ b/src/block/node/FormulaNode.ts @@ -1,25 +1,25 @@ -import { createNodeParser } from "./creator"; import { createPlainNode } from "./PlainNode"; +import { createNodeParser } from "./creator"; -import type { FormulaNode, PlainNode } from "./type"; import type { NodeCreator } from "./creator"; +import type { FormulaNode, PlainNode } from "./type"; const formulaWithTailHalfSpaceRegExp = /\[\$ .+? \]/; const formulaRegExp = /\[\$ [^\]]+\]/; const createFormulaNode: NodeCreator = (raw, opts) => - opts.context === "table" - ? createPlainNode(raw, opts) - : [ - { - type: "formula", - raw, - formula: raw.substring(3, raw.length - (raw.endsWith(" ]") ? 2 : 1)), - }, - ]; + opts.context === "table" + ? createPlainNode(raw, opts) + : [ + { + type: "formula", + raw, + formula: raw.substring(3, raw.length - (raw.endsWith(" ]") ? 2 : 1)), + }, + ]; export const FormulaNodeParser = createNodeParser(createFormulaNode, { - parseOnNested: false, - parseOnQuoted: true, - patterns: [formulaWithTailHalfSpaceRegExp, formulaRegExp], + parseOnNested: false, + parseOnQuoted: true, + patterns: [formulaWithTailHalfSpaceRegExp, formulaRegExp], }); diff --git a/src/block/node/GoogleMapNode.ts b/src/block/node/GoogleMapNode.ts index 404317d3..f5fb94e1 100644 --- a/src/block/node/GoogleMapNode.ts +++ b/src/block/node/GoogleMapNode.ts @@ -1,69 +1,69 @@ -import { createNodeParser } from "./creator"; import { createPlainNode } from "./PlainNode"; +import { createNodeParser } from "./creator"; -import type { GoogleMapNode, PlainNode } from "./type"; import type { NodeCreator } from "./creator"; +import type { GoogleMapNode, PlainNode } from "./type"; const placeFirstGoogleMapRegExp = - /\[([^\]]*[^\s])\s+([NS]\d+(?:\.\d+)?,[EW]\d+(?:\.\d+)?(?:,Z\d+)?)\]/; + /\[([^\]]*[^\s])\s+([NS]\d+(?:\.\d+)?,[EW]\d+(?:\.\d+)?(?:,Z\d+)?)\]/; const coordFirstGoogleMapRegExp = - /\[([NS]\d+(?:\.\d+)?,[EW]\d+(?:\.\d+)?(?:,Z\d+)?)(?:\s+([^\]]*[^\s]))?\]/; + /\[([NS]\d+(?:\.\d+)?,[EW]\d+(?:\.\d+)?(?:,Z\d+)?)(?:\s+([^\]]*[^\s]))?\]/; interface Coordinate { - latitude: number; - longitude: number; - zoom: number; + latitude: number; + longitude: number; + zoom: number; } const parseCoordinate: (format: string) => Coordinate = (format) => { - const [lat = "", lng = "", z = ""] = format.split(","); - const latitude = parseFloat(lat.replace(/^N/, "").replace(/^S/, "-")); - const longitude = parseFloat(lng.replace(/^E/, "").replace(/^W/, "-")); - const zoom = /^Z\d+$/.test(z) ? parseInt(z.replace(/^Z/, ""), 10) : 14; - return { latitude, longitude, zoom }; + const [lat = "", lng = "", z = ""] = format.split(","); + const latitude = Number.parseFloat(lat.replace(/^N/, "").replace(/^S/, "-")); + const longitude = Number.parseFloat(lng.replace(/^E/, "").replace(/^W/, "-")); + const zoom = /^Z\d+$/.test(z) ? Number.parseInt(z.replace(/^Z/, ""), 10) : 14; + return { latitude, longitude, zoom }; }; const createGoogleMapNode: NodeCreator = ( - raw, - opts, + raw, + opts, ) => { - if (opts.context === "table") { - return createPlainNode(raw, opts); - } + if (opts.context === "table") { + return createPlainNode(raw, opts); + } - const match = - raw.match(placeFirstGoogleMapRegExp) ?? - raw.match(coordFirstGoogleMapRegExp); - if (match === null) return []; + const match = + raw.match(placeFirstGoogleMapRegExp) ?? + raw.match(coordFirstGoogleMapRegExp); + if (match === null) return []; - const isCoordFirst = raw.startsWith("[N") || raw.startsWith("[S"); - const [, coord = "", place = ""] = isCoordFirst - ? match - : [match[0], match[2], match[1]]; - const { latitude, longitude, zoom } = parseCoordinate(coord); + const isCoordFirst = raw.startsWith("[N") || raw.startsWith("[S"); + const [, coord = "", place = ""] = isCoordFirst + ? match + : [match[0], match[2], match[1]]; + const { latitude, longitude, zoom } = parseCoordinate(coord); - const url = - place !== "" - ? `https://www.google.com/maps/place/${encodeURIComponent( - place, - )}/@${latitude},${longitude},${zoom}z` - : `https://www.google.com/maps/@${latitude},${longitude},${zoom}z`; + const url = + place !== "" + ? `https://www.google.com/maps/place/${encodeURIComponent( + place, + )}/@${latitude},${longitude},${zoom}z` + : `https://www.google.com/maps/@${latitude},${longitude},${zoom}z`; - return [ - { - type: "googleMap", - raw, - latitude, - longitude, - zoom, - place, - url, - }, - ]; + return [ + { + type: "googleMap", + raw, + latitude, + longitude, + zoom, + place, + url, + }, + ]; }; export const GoogleMapNodeParser = createNodeParser(createGoogleMapNode, { - parseOnNested: false, - parseOnQuoted: true, - patterns: [placeFirstGoogleMapRegExp, coordFirstGoogleMapRegExp], + parseOnNested: false, + parseOnQuoted: true, + patterns: [placeFirstGoogleMapRegExp, coordFirstGoogleMapRegExp], }); diff --git a/src/block/node/HashTagNode.ts b/src/block/node/HashTagNode.ts index 432701a4..6c9c1143 100644 --- a/src/block/node/HashTagNode.ts +++ b/src/block/node/HashTagNode.ts @@ -1,41 +1,41 @@ -import { createNodeParser } from "./creator"; import { createPlainNode } from "./PlainNode"; +import { createNodeParser } from "./creator"; -import type { HashTagNode, PlainNode } from "./type"; import type { NodeCreator } from "./creator"; +import type { HashTagNode, PlainNode } from "./type"; const hashTagRegExp = /(?:^|\s)#\S+/; const createHashTagNode: NodeCreator = (raw, opts) => { - if (opts.context === "table") { - return createPlainNode(raw, opts); - } + if (opts.context === "table") { + return createPlainNode(raw, opts); + } - if (raw.startsWith("#")) { - return [ - { - type: "hashTag", - raw, - href: raw.substring(1), - }, - ]; - } + if (raw.startsWith("#")) { + return [ + { + type: "hashTag", + raw, + href: raw.substring(1), + }, + ]; + } - const space = raw.substring(0, 1); - const tag = raw.substring(1); + const space = raw.substring(0, 1); + const tag = raw.substring(1); - return [ - ...createPlainNode(space, opts), - { - type: "hashTag", - raw: tag, - href: tag.substring(1), - }, - ]; + return [ + ...createPlainNode(space, opts), + { + type: "hashTag", + raw: tag, + href: tag.substring(1), + }, + ]; }; export const HashTagNodeParser = createNodeParser(createHashTagNode, { - parseOnNested: true, - parseOnQuoted: true, - patterns: [hashTagRegExp], + parseOnNested: true, + parseOnQuoted: true, + patterns: [hashTagRegExp], }); diff --git a/src/block/node/HelpfeelNode.ts b/src/block/node/HelpfeelNode.ts index e2d83fa1..b446c6f6 100644 --- a/src/block/node/HelpfeelNode.ts +++ b/src/block/node/HelpfeelNode.ts @@ -1,27 +1,27 @@ -import { createNodeParser } from "./creator"; import { createPlainNode } from "./PlainNode"; +import { createNodeParser } from "./creator"; -import type { HelpfeelNode, PlainNode } from "./type"; import type { NodeCreator } from "./creator"; +import type { HelpfeelNode, PlainNode } from "./type"; const helpfeelRegExp = /^\? .+$/; const createHelpfeelNode: NodeCreator = ( - raw, - opts, + raw, + opts, ) => - opts.context === "table" - ? createPlainNode(raw, opts) - : [ - { - type: "helpfeel", - raw, - text: raw.substring(2), - }, - ]; + opts.context === "table" + ? createPlainNode(raw, opts) + : [ + { + type: "helpfeel", + raw, + text: raw.substring(2), + }, + ]; export const HelpfeelNodeParser = createNodeParser(createHelpfeelNode, { - parseOnNested: false, - parseOnQuoted: false, - patterns: [helpfeelRegExp], + parseOnNested: false, + parseOnQuoted: false, + patterns: [helpfeelRegExp], }); diff --git a/src/block/node/IconNode.ts b/src/block/node/IconNode.ts index e2e608a9..e124e768 100644 --- a/src/block/node/IconNode.ts +++ b/src/block/node/IconNode.ts @@ -1,42 +1,44 @@ -import { createNodeParser } from "./creator"; import { createPlainNode } from "./PlainNode"; +import { createNodeParser } from "./creator"; -import type { IconNode, PlainNode, StrongIconNode } from "./type"; import type { NodeCreator } from "./creator"; +import type { IconNode, PlainNode, StrongIconNode } from "./type"; const iconRegExp = /\[[^[\]]*\.icon(?:\*[1-9]\d*)?\]/; export function generateIconNodeCreator( - type: IconNode["type"], + type: IconNode["type"], ): NodeCreator; export function generateIconNodeCreator( - type: StrongIconNode["type"], + type: StrongIconNode["type"], ): NodeCreator; export function generateIconNodeCreator( - type: (IconNode | StrongIconNode)["type"], + type: (IconNode | StrongIconNode)["type"], ): NodeCreator { - return (raw, opts) => { - if (type === "strongIcon" && opts.context === "table") { - return createPlainNode(raw, opts); - } + return (raw, opts) => { + if (type === "strongIcon" && opts.context === "table") { + return createPlainNode(raw, opts); + } - const target = - type === "icon" - ? raw.substring(1, raw.length - 1) - : raw.substring(2, raw.length - 2); - const index = target.lastIndexOf(".icon"); - const path = target.substring(0, index); - const pathType = path.startsWith("/") ? "root" : "relative"; - const numStr = target.substring(index + 5, target.length); - const num = numStr.startsWith("*") ? parseInt(numStr.substring(1), 10) : 1; - return new Array(num).fill({}).map(() => ({ path, pathType, type, raw })); - }; + const target = + type === "icon" + ? raw.substring(1, raw.length - 1) + : raw.substring(2, raw.length - 2); + const index = target.lastIndexOf(".icon"); + const path = target.substring(0, index); + const pathType = path.startsWith("/") ? "root" : "relative"; + const numStr = target.substring(index + 5, target.length); + const num = numStr.startsWith("*") + ? Number.parseInt(numStr.substring(1), 10) + : 1; + return new Array(num).fill({}).map(() => ({ path, pathType, type, raw })); + }; } const createIconNode = generateIconNodeCreator("icon"); export const IconNodeParser = createNodeParser(createIconNode, { - parseOnNested: true, - parseOnQuoted: true, - patterns: [iconRegExp], + parseOnNested: true, + parseOnQuoted: true, + patterns: [iconRegExp], }); diff --git a/src/block/node/ImageNode.ts b/src/block/node/ImageNode.ts index e8303715..f4211a13 100644 --- a/src/block/node/ImageNode.ts +++ b/src/block/node/ImageNode.ts @@ -1,56 +1,56 @@ -import { createNodeParser } from "./creator"; import { createPlainNode } from "./PlainNode"; +import { createNodeParser } from "./creator"; -import type { ImageNode, PlainNode } from "./type"; import type { NodeCreator } from "./creator"; +import type { ImageNode, PlainNode } from "./type"; const srcFirstStrongImageRegExp = - /\[https?:\/\/[^\s\]]+\.(?:png|jpe?g|gif|svg)(?:\?[^\]\s]+)?(?:\s+https?:\/\/[^\s\]]+)?\]/i; + /\[https?:\/\/[^\s\]]+\.(?:png|jpe?g|gif|svg)(?:\?[^\]\s]+)?(?:\s+https?:\/\/[^\s\]]+)?\]/i; const linkFirstStrongImageRegExp = - /\[https?:\/\/[^\s\]]+\s+https?:\/\/[^\s\]]+\.(?:png|jpe?g|gif|svg)(?:\?[^\]\s]+)?\]/i; + /\[https?:\/\/[^\s\]]+\s+https?:\/\/[^\s\]]+\.(?:png|jpe?g|gif|svg)(?:\?[^\]\s]+)?\]/i; const srcFirstStrongGyazoImageRegExp = - /\[https?:\/\/(?:[0-9a-z-]+\.)?gyazo\.com\/[0-9a-f]{32}(?:\/raw)?(?:\s+https?:\/\/[^\s\]]+)?\]/; + /\[https?:\/\/(?:[0-9a-z-]+\.)?gyazo\.com\/[0-9a-f]{32}(?:\/raw)?(?:\s+https?:\/\/[^\s\]]+)?\]/; const linkFirstStrongGyazoImageRegExp = - /\[https?:\/\/[^\s\]]+\s+https?:\/\/(?:[0-9a-z-]+\.)?gyazo\.com\/[0-9a-f]{32}(?:\/raw)?\]/; + /\[https?:\/\/[^\s\]]+\s+https?:\/\/(?:[0-9a-z-]+\.)?gyazo\.com\/[0-9a-f]{32}(?:\/raw)?\]/; const isImageUrl = (text: string): boolean => - /^https?:\/\/[^\s\]]+\.(png|jpe?g|gif|svg)(\?[^\]\s]+)?$/i.test(text) || - isGyazoImageUrl(text); + /^https?:\/\/[^\s\]]+\.(png|jpe?g|gif|svg)(\?[^\]\s]+)?$/i.test(text) || + isGyazoImageUrl(text); const isGyazoImageUrl = (text: string): boolean => - /^https?:\/\/([0-9a-z-]\.)?gyazo\.com\/[0-9a-f]{32}(\/raw)?$/.test(text); + /^https?:\/\/([0-9a-z-]\.)?gyazo\.com\/[0-9a-f]{32}(\/raw)?$/.test(text); const createImageNode: NodeCreator = (raw, opts) => { - if (opts.context === "table") { - return createPlainNode(raw, opts); - } - - const index = raw.search(/\s/); - const first = - index !== -1 ? raw.substring(1, index) : raw.substring(1, raw.length - 1); - const second = - index !== -1 ? raw.substring(index, raw.length - 1).trimLeft() : ""; - const [src, link] = isImageUrl(second) ? [second, first] : [first, second]; - - return [ - { - type: "image", - raw, - src: /^https?:\/\/([0-9a-z-]\.)?gyazo\.com\/[0-9a-f]{32}$/.test(src) - ? `${src}/thumb/1000` - : src, - link, - }, - ]; + if (opts.context === "table") { + return createPlainNode(raw, opts); + } + + const index = raw.search(/\s/); + const first = + index !== -1 ? raw.substring(1, index) : raw.substring(1, raw.length - 1); + const second = + index !== -1 ? raw.substring(index, raw.length - 1).trimLeft() : ""; + const [src, link] = isImageUrl(second) ? [second, first] : [first, second]; + + return [ + { + type: "image", + raw, + src: /^https?:\/\/([0-9a-z-]\.)?gyazo\.com\/[0-9a-f]{32}$/.test(src) + ? `${src}/thumb/1000` + : src, + link, + }, + ]; }; export const ImageNodeParser = createNodeParser(createImageNode, { - parseOnNested: true, - parseOnQuoted: true, - patterns: [ - srcFirstStrongImageRegExp, - linkFirstStrongImageRegExp, - srcFirstStrongGyazoImageRegExp, - linkFirstStrongGyazoImageRegExp, - ], + parseOnNested: true, + parseOnQuoted: true, + patterns: [ + srcFirstStrongImageRegExp, + linkFirstStrongImageRegExp, + srcFirstStrongGyazoImageRegExp, + linkFirstStrongGyazoImageRegExp, + ], }); diff --git a/src/block/node/InternalLinkNode.ts b/src/block/node/InternalLinkNode.ts index 71f81122..9fc47b3b 100644 --- a/src/block/node/InternalLinkNode.ts +++ b/src/block/node/InternalLinkNode.ts @@ -1,25 +1,25 @@ import { createNodeParser } from "./creator"; -import type { LinkNode } from "./type"; import type { NodeCreator } from "./creator"; +import type { LinkNode } from "./type"; const internalLinkRegExp = /\[\/?[^[\]]+\]/; const createInternalLinkNode: NodeCreator = (raw) => { - const href = raw.substring(1, raw.length - 1); - return [ - { - type: "link", - raw, - pathType: href.startsWith("/") ? "root" : "relative", - href, - content: "", - }, - ]; + const href = raw.substring(1, raw.length - 1); + return [ + { + type: "link", + raw, + pathType: href.startsWith("/") ? "root" : "relative", + href, + content: "", + }, + ]; }; export const InternalLinkNodeParser = createNodeParser(createInternalLinkNode, { - parseOnNested: true, - parseOnQuoted: true, - patterns: [internalLinkRegExp], + parseOnNested: true, + parseOnQuoted: true, + patterns: [internalLinkRegExp], }); diff --git a/src/block/node/NumberListNode.ts b/src/block/node/NumberListNode.ts index 80d72b66..f00704ea 100644 --- a/src/block/node/NumberListNode.ts +++ b/src/block/node/NumberListNode.ts @@ -1,37 +1,37 @@ -import { convertToNodes } from "./index"; -import { createNodeParser } from "./creator"; import { createPlainNode } from "./PlainNode"; +import { createNodeParser } from "./creator"; +import { convertToNodes } from "./index"; -import type { NumberListNode, PlainNode } from "./type"; import type { NodeCreator } from "./creator"; +import type { NumberListNode, PlainNode } from "./type"; const numberListRegExp = /^[0-9]+\. .*$/; const createNumberListNode: NodeCreator = ( - raw, - opts, + raw, + opts, ) => { - if (opts.context === "table") { - return createPlainNode(raw, opts); - } + if (opts.context === "table") { + return createPlainNode(raw, opts); + } - const separatorIndex = raw.indexOf(" "); - const rawNumber = raw.substring(0, separatorIndex - 1); - const number = parseInt(rawNumber, 10); - const text = raw.substring(separatorIndex + 1, raw.length); - return [ - { - type: "numberList", - raw, - rawNumber, - number, - nodes: convertToNodes(text, { ...opts, nested: true }), - }, - ]; + const separatorIndex = raw.indexOf(" "); + const rawNumber = raw.substring(0, separatorIndex - 1); + const number = Number.parseInt(rawNumber, 10); + const text = raw.substring(separatorIndex + 1, raw.length); + return [ + { + type: "numberList", + raw, + rawNumber, + number, + nodes: convertToNodes(text, { ...opts, nested: true }), + }, + ]; }; export const NumberListNodeParser = createNodeParser(createNumberListNode, { - parseOnNested: false, - parseOnQuoted: false, - patterns: [numberListRegExp], + parseOnNested: false, + parseOnQuoted: false, + patterns: [numberListRegExp], }); diff --git a/src/block/node/PlainNode.ts b/src/block/node/PlainNode.ts index 88c1819d..7ca9088f 100644 --- a/src/block/node/PlainNode.ts +++ b/src/block/node/PlainNode.ts @@ -1,19 +1,19 @@ import { createNodeParser } from "./creator"; +import type { NodeCreator } from "./creator"; import type { NodeParser } from "./index"; import type { PlainNode } from "./type"; -import type { NodeCreator } from "./creator"; export const createPlainNode: NodeCreator = (raw) => [ - { - type: "plain", - raw, - text: raw, - }, + { + type: "plain", + raw, + text: raw, + }, ]; export const PlainNodeParser: NodeParser = createNodeParser(createPlainNode, { - parseOnNested: true, - parseOnQuoted: true, - patterns: [/^()(.*)()$/], + parseOnNested: true, + parseOnQuoted: true, + patterns: [/^()(.*)()$/], }); diff --git a/src/block/node/QuoteNode.ts b/src/block/node/QuoteNode.ts index 108b06a3..bb07e0c3 100644 --- a/src/block/node/QuoteNode.ts +++ b/src/block/node/QuoteNode.ts @@ -1,25 +1,25 @@ -import { convertToNodes } from "./index"; -import { createNodeParser } from "./creator"; import { createPlainNode } from "./PlainNode"; +import { createNodeParser } from "./creator"; +import { convertToNodes } from "./index"; -import type { PlainNode, QuoteNode } from "./type"; import type { NodeCreator } from "./creator"; +import type { PlainNode, QuoteNode } from "./type"; const quoteRegExp = /^>.*$/; const createQuoteNode: NodeCreator = (raw, opts) => - opts.context === "table" - ? createPlainNode(raw, opts) - : [ - { - type: "quote", - raw, - nodes: convertToNodes(raw.substring(1), { ...opts, quoted: true }), - }, - ]; + opts.context === "table" + ? createPlainNode(raw, opts) + : [ + { + type: "quote", + raw, + nodes: convertToNodes(raw.substring(1), { ...opts, quoted: true }), + }, + ]; export const QuoteNodeParser = createNodeParser(createQuoteNode, { - parseOnNested: false, - parseOnQuoted: false, - patterns: [quoteRegExp], + parseOnNested: false, + parseOnQuoted: false, + patterns: [quoteRegExp], }); diff --git a/src/block/node/StrongIconNode.ts b/src/block/node/StrongIconNode.ts index 58c8b302..6fda1489 100644 --- a/src/block/node/StrongIconNode.ts +++ b/src/block/node/StrongIconNode.ts @@ -1,12 +1,12 @@ -import { createNodeParser } from "./creator"; import { generateIconNodeCreator } from "./IconNode"; +import { createNodeParser } from "./creator"; const strongIconRegExp = /\[\[[^[\]]*\.icon(?:\*\d+)?\]\]/; const createStrongIconNode = generateIconNodeCreator("strongIcon"); export const StrongIconNodeParser = createNodeParser(createStrongIconNode, { - parseOnNested: false, - parseOnQuoted: true, - patterns: [strongIconRegExp], + parseOnNested: false, + parseOnQuoted: true, + patterns: [strongIconRegExp], }); diff --git a/src/block/node/StrongImageNode.ts b/src/block/node/StrongImageNode.ts index b4fbc12a..f3ddea30 100644 --- a/src/block/node/StrongImageNode.ts +++ b/src/block/node/StrongImageNode.ts @@ -1,35 +1,35 @@ -import { createNodeParser } from "./creator"; import { createPlainNode } from "./PlainNode"; +import { createNodeParser } from "./creator"; -import type { PlainNode, StrongImageNode } from "./type"; import type { NodeCreator } from "./creator"; +import type { PlainNode, StrongImageNode } from "./type"; const strongImageRegExp = /\[\[https?:\/\/[^\s\]]+\.(?:png|jpe?g|gif|svg)\]\]/i; const strongGyazoImageRegExp = - /\[\[https?:\/\/(?:[0-9a-z-]+\.)?gyazo\.com\/[0-9a-f]{32}\]\]/; + /\[\[https?:\/\/(?:[0-9a-z-]+\.)?gyazo\.com\/[0-9a-f]{32}\]\]/; const createStrongImageNode: NodeCreator = ( - raw, - opts, + raw, + opts, ) => { - if (opts.context === "table") { - return createPlainNode(raw, opts); - } + if (opts.context === "table") { + return createPlainNode(raw, opts); + } - const src = raw.substring(2, raw.length - 2); - const isGyazoImage = - /^https?:\/\/([0-9a-z-]\.)?gyazo\.com\/[0-9a-f]{32}$/.test(src); - return [ - { - type: "strongImage", - raw, - src: isGyazoImage ? `${src}/thumb/1000` : src, - }, - ]; + const src = raw.substring(2, raw.length - 2); + const isGyazoImage = + /^https?:\/\/([0-9a-z-]\.)?gyazo\.com\/[0-9a-f]{32}$/.test(src); + return [ + { + type: "strongImage", + raw, + src: isGyazoImage ? `${src}/thumb/1000` : src, + }, + ]; }; export const StrongImageNodeParser = createNodeParser(createStrongImageNode, { - parseOnNested: false, - parseOnQuoted: true, - patterns: [strongImageRegExp, strongGyazoImageRegExp], + parseOnNested: false, + parseOnQuoted: true, + patterns: [strongImageRegExp, strongGyazoImageRegExp], }); diff --git a/src/block/node/StrongNode.ts b/src/block/node/StrongNode.ts index 559e0a8f..b52eb4a4 100644 --- a/src/block/node/StrongNode.ts +++ b/src/block/node/StrongNode.ts @@ -1,29 +1,29 @@ -import { convertToNodes } from "./index"; -import { createNodeParser } from "./creator"; import { createPlainNode } from "./PlainNode"; +import { createNodeParser } from "./creator"; +import { convertToNodes } from "./index"; +import type { NodeCreator } from "./creator"; import type { NodeParser } from "./index"; import type { PlainNode, StrongNode } from "./type"; -import type { NodeCreator } from "./creator"; const strongRegExp = /\[\[(?:[^[]|\[[^[]).*?\]*\]\]/; const createStrongNode: NodeCreator = (raw, opts) => - opts.context === "table" - ? createPlainNode(raw, opts) - : [ - { - type: "strong", - raw, - nodes: convertToNodes(raw.substring(2, raw.length - 2), { - ...opts, - nested: true, - }), - }, - ]; + opts.context === "table" + ? createPlainNode(raw, opts) + : [ + { + type: "strong", + raw, + nodes: convertToNodes(raw.substring(2, raw.length - 2), { + ...opts, + nested: true, + }), + }, + ]; export const StrongNodeParser: NodeParser = createNodeParser(createStrongNode, { - parseOnNested: false, - parseOnQuoted: true, - patterns: [strongRegExp], + parseOnNested: false, + parseOnQuoted: true, + patterns: [strongRegExp], }); diff --git a/src/block/node/creator.ts b/src/block/node/creator.ts index 76a5c891..2274b2b8 100644 --- a/src/block/node/creator.ts +++ b/src/block/node/creator.ts @@ -4,38 +4,38 @@ import type { NodeParser, NodeParserOption } from "./index"; import type { Node } from "./type"; export type NodeCreator = ( - target: string, - opts: NodeParserOption, + target: string, + opts: NodeParserOption, ) => T[]; type NodeParserCreator = ( - nodeCreator: NodeCreator, - opts: { parseOnNested: boolean; parseOnQuoted: boolean; patterns: RegExp[] }, + nodeCreator: NodeCreator, + opts: { parseOnNested: boolean; parseOnQuoted: boolean; patterns: RegExp[] }, ) => NodeParser; export const createNodeParser: NodeParserCreator = ( - nodeCreator, - { parseOnNested, parseOnQuoted, patterns }, + nodeCreator, + { parseOnNested, parseOnQuoted, patterns }, ) => { - return (text, opts, next) => { - if (!parseOnNested && opts.nested) return next?.() ?? []; - if (!parseOnQuoted && opts.quoted) return next?.() ?? []; - - for (const pattern of patterns) { - const match = pattern.exec(text); - if (match === null) continue; - - const left = text.substring(0, match.index); - const right = text.substring(match.index + (match[0]?.length ?? 0)); - - const node = nodeCreator(match[0] ?? "", opts); - return [ - ...convertToNodes(left, opts), - ...node, - ...convertToNodes(right, opts), - ]; - } - - return next?.() ?? []; - }; + return (text, opts, next) => { + if (!parseOnNested && opts.nested) return next?.() ?? []; + if (!parseOnQuoted && opts.quoted) return next?.() ?? []; + + for (const pattern of patterns) { + const match = pattern.exec(text); + if (match === null) continue; + + const left = text.substring(0, match.index); + const right = text.substring(match.index + (match[0]?.length ?? 0)); + + const node = nodeCreator(match[0] ?? "", opts); + return [ + ...convertToNodes(left, opts), + ...node, + ...convertToNodes(right, opts), + ]; + } + + return next?.() ?? []; + }; }; diff --git a/src/block/node/index.ts b/src/block/node/index.ts index adfa53a0..87a2b509 100644 --- a/src/block/node/index.ts +++ b/src/block/node/index.ts @@ -1,69 +1,69 @@ -import { QuoteNodeParser } from "./QuoteNode"; -import { HelpfeelNodeParser } from "./HelpfeelNode"; -import { StrongImageNodeParser } from "./StrongImageNode"; -import { StrongIconNodeParser } from "./StrongIconNode"; -import { StrongNodeParser } from "./StrongNode"; -import { FormulaNodeParser } from "./FormulaNode"; -import { DecorationNodeParser } from "./DecorationNode"; +import { BlankNodeParser } from "./BlankNode"; import { CodeNodeParser } from "./CodeNode"; import { CommandLineNodeParser } from "./CommandLineNode"; -import { BlankNodeParser } from "./BlankNode"; -import { ImageNodeParser } from "./ImageNode"; +import { DecorationNodeParser } from "./DecorationNode"; import { ExternalLinkNodeParser } from "./ExternalLinkNode"; +import { FormulaNodeParser } from "./FormulaNode"; import { GoogleMapNodeParser } from "./GoogleMapNode"; -import { InternalLinkNodeParser } from "./InternalLinkNode"; -import { IconNodeParser } from "./IconNode"; import { HashTagNodeParser } from "./HashTagNode"; +import { HelpfeelNodeParser } from "./HelpfeelNode"; +import { IconNodeParser } from "./IconNode"; +import { ImageNodeParser } from "./ImageNode"; +import { InternalLinkNodeParser } from "./InternalLinkNode"; import { NumberListNodeParser } from "./NumberListNode"; import { PlainNodeParser } from "./PlainNode"; +import { QuoteNodeParser } from "./QuoteNode"; +import { StrongIconNodeParser } from "./StrongIconNode"; +import { StrongImageNodeParser } from "./StrongImageNode"; +import { StrongNodeParser } from "./StrongNode"; import type { Node } from "./type"; export interface NodeParserOption { - nested: boolean; - quoted: boolean; - context: "line" | "table"; + nested: boolean; + quoted: boolean; + context: "line" | "table"; } export type NextNodeParser = () => Node[]; export type NodeParser = ( - text: string, - opts: NodeParserOption, - next?: NextNodeParser, + text: string, + opts: NodeParserOption, + next?: NextNodeParser, ) => Node[]; const FalsyEliminator: NodeParser = (text, _, next) => { - if (text === "") return []; - return next?.() ?? []; + if (text === "") return []; + return next?.() ?? []; }; const combineNodeParsers = - (...parsers: NodeParser[]) => - (text: string, opts: NodeParserOption): Node[] => - parsers.reduceRight( - (acc: NextNodeParser, parser: NodeParser): NextNodeParser => - () => - parser(text, opts, acc), - () => PlainNodeParser(text, opts), - )(); + (...parsers: NodeParser[]) => + (text: string, opts: NodeParserOption): Node[] => + parsers.reduceRight( + (acc: NextNodeParser, parser: NodeParser): NextNodeParser => + () => + parser(text, opts, acc), + () => PlainNodeParser(text, opts), + )(); export const convertToNodes: ReturnType = - combineNodeParsers( - FalsyEliminator, - QuoteNodeParser, - HelpfeelNodeParser, - CodeNodeParser, - CommandLineNodeParser, - FormulaNodeParser, - BlankNodeParser, - DecorationNodeParser, - StrongImageNodeParser, - StrongIconNodeParser, - StrongNodeParser, - ImageNodeParser, - ExternalLinkNodeParser, - IconNodeParser, - GoogleMapNodeParser, - InternalLinkNodeParser, - HashTagNodeParser, - NumberListNodeParser, - ); + combineNodeParsers( + FalsyEliminator, + QuoteNodeParser, + HelpfeelNodeParser, + CodeNodeParser, + CommandLineNodeParser, + FormulaNodeParser, + BlankNodeParser, + DecorationNodeParser, + StrongImageNodeParser, + StrongIconNodeParser, + StrongNodeParser, + ImageNodeParser, + ExternalLinkNodeParser, + IconNodeParser, + GoogleMapNodeParser, + InternalLinkNodeParser, + HashTagNodeParser, + NumberListNodeParser, + ); diff --git a/src/block/node/type.ts b/src/block/node/type.ts index fcd5d850..8244f43d 100644 --- a/src/block/node/type.ts +++ b/src/block/node/type.ts @@ -1,177 +1,177 @@ import type { Decoration } from "./DecorationNode"; interface BaseNode { - raw: string; + raw: string; } /** * Scrapbox {@link https://scrapbox.io/help/Syntax#58348ae2651ee500008d67d8 | quote node} type */ export interface QuoteNode extends BaseNode { - type: "quote"; - nodes: Node[]; + type: "quote"; + nodes: Node[]; } /** * Scrapbox {@link https://scrapbox.io/help-jp/Helpfeel%E8%A8%98%E6%B3%95 | Helpfeel node} type */ export interface HelpfeelNode extends BaseNode { - type: "helpfeel"; - text: string; + type: "helpfeel"; + text: string; } /** * Scrapbox {@link https://scrapbox.io/help-jp/%E3%81%9D%E3%81%AE%E4%BB%96%E3%81%AE%E6%9B%B8%E3%81%8D%E6%96%B9#5cfa1ea397c291000095c81e | strong image node} type */ export interface StrongImageNode extends BaseNode { - type: "strongImage"; - src: string; + type: "strongImage"; + src: string; } /** * Scrapbox {@link https://scrapbox.io/help/Icon#5ec273358ee92a000078cafe | strong icon node} type */ export interface StrongIconNode extends BaseNode { - type: "strongIcon"; - pathType: "root" | "relative"; - path: string; + type: "strongIcon"; + pathType: "root" | "relative"; + path: string; } /** * Scrapbox {@link https://scrapbox.io/help/Syntax#58348ae2651ee500008d67cb | strong node} type */ export interface StrongNode extends BaseNode { - type: "strong"; - nodes: Node[]; + type: "strong"; + nodes: Node[]; } /** * Scrapbox {@link https://scrapbox.io/help/Syntax#5e7c7a17651ee50000d77b2e | formula node} type */ export interface FormulaNode extends BaseNode { - type: "formula"; - formula: string; + type: "formula"; + formula: string; } /** * Scrapbox {@link https://scrapbox.io/help/Syntax#58348ae2651ee500008d67cc | decoration node} type */ export interface DecorationNode extends BaseNode { - type: "decoration"; - rawDecos: string; - decos: Decoration[]; - nodes: Node[]; + type: "decoration"; + rawDecos: string; + decos: Decoration[]; + nodes: Node[]; } /** * Scrapbox {@link https://scrapbox.io/help/Syntax#58348ae2651ee500008d67db | code node} type */ export interface CodeNode extends BaseNode { - type: "code"; - text: string; + type: "code"; + text: string; } /** * Scrapbox {@link https://scrapbox.io/help/Code_notation#587d557d651ee50000dc693d | command line node} type */ export interface CommandLineNode extends BaseNode { - type: "commandLine"; - symbol: string; - text: string; + type: "commandLine"; + symbol: string; + text: string; } /** * Scrapbox blank node type */ export interface BlankNode extends BaseNode { - type: "blank"; - text: string; + type: "blank"; + text: string; } /** * Scrapbox {@link https://scrapbox.io/help/Syntax#58348ae2651ee500008d67b8 | image node} type */ export interface ImageNode extends BaseNode { - type: "image"; - src: string; - link: string; + type: "image"; + src: string; + link: string; } /** * Scrapbox {@link https://scrapbox.io/help/Link | link node} type */ export interface LinkNode extends BaseNode { - type: "link"; - pathType: "absolute" | "root" | "relative"; - href: string; - content: string; + type: "link"; + pathType: "absolute" | "root" | "relative"; + href: string; + content: string; } /** * Scrapbox {@link https://scrapbox.io/help-jp/Location%E8%A8%98%E6%B3%95 | Google Map node} type */ export interface GoogleMapNode extends BaseNode { - type: "googleMap"; - latitude: number; - longitude: number; - zoom: number; - place: string; - url: string; + type: "googleMap"; + latitude: number; + longitude: number; + zoom: number; + place: string; + url: string; } /** * Scrapbox {@link https://scrapbox.io/help/Syntax#58348ae2651ee500008d67c7 | icon node} type */ export interface IconNode extends BaseNode { - type: "icon"; - pathType: "root" | "relative"; - path: string; + type: "icon"; + pathType: "root" | "relative"; + path: string; } /** * Scrapbox {@link https://scrapbox.io/help/Syntax#58348ae2651ee500008d67d5 | hash tag node} type */ export interface HashTagNode extends BaseNode { - type: "hashTag"; - href: string; + type: "hashTag"; + href: string; } /** * Scrapbox number list node type */ export interface NumberListNode extends BaseNode { - type: "numberList"; - rawNumber: string; - number: number; - nodes: Node[]; + type: "numberList"; + rawNumber: string; + number: number; + nodes: Node[]; } /** * Scrapbox plain node type */ export interface PlainNode extends BaseNode { - type: "plain"; - text: string; + type: "plain"; + text: string; } /** * Scrapbox node type */ export type Node = - | QuoteNode - | HelpfeelNode - | StrongImageNode - | StrongIconNode - | StrongNode - | FormulaNode - | DecorationNode - | CodeNode - | CommandLineNode - | BlankNode - | ImageNode - | LinkNode - | GoogleMapNode - | IconNode - | HashTagNode - | NumberListNode - | PlainNode; + | QuoteNode + | HelpfeelNode + | StrongImageNode + | StrongIconNode + | StrongNode + | FormulaNode + | DecorationNode + | CodeNode + | CommandLineNode + | BlankNode + | ImageNode + | LinkNode + | GoogleMapNode + | IconNode + | HashTagNode + | NumberListNode + | PlainNode; diff --git a/src/index.ts b/src/index.ts index aca6c78d..264e4bb1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,22 +6,22 @@ export type { CodeBlock } from "./block/CodeBlock"; export type { Table } from "./block/Table"; export type { Line } from "./block/Line"; export type { - Node, - QuoteNode, - HelpfeelNode, - StrongImageNode, - StrongIconNode, - StrongNode, - FormulaNode, - DecorationNode, - CodeNode, - CommandLineNode, - BlankNode, - ImageNode, - LinkNode, - GoogleMapNode, - IconNode, - HashTagNode, - PlainNode, + Node, + QuoteNode, + HelpfeelNode, + StrongImageNode, + StrongIconNode, + StrongNode, + FormulaNode, + DecorationNode, + CodeNode, + CommandLineNode, + BlankNode, + ImageNode, + LinkNode, + GoogleMapNode, + IconNode, + HashTagNode, + PlainNode, } from "./block/node/type"; export type { Decoration } from "./block/node/DecorationNode"; diff --git a/src/parse.ts b/src/parse.ts index 11d36e9b..6196b154 100644 --- a/src/parse.ts +++ b/src/parse.ts @@ -1,6 +1,6 @@ import { convertToBlock } from "./block"; -import { parseToRows } from "./block/Row"; import { packRows } from "./block/Pack"; +import { parseToRows } from "./block/Row"; import type { Block } from "./block"; @@ -8,10 +8,10 @@ import type { Block } from "./block"; * parser option type */ export interface ParserOption { - /** - * is Scrapbox notation text including title - */ - hasTitle?: boolean; + /** + * is Scrapbox notation text including title + */ + hasTitle?: boolean; } /** @@ -26,9 +26,9 @@ export type Page = Block[]; * @returns syntax tree of parsed input */ export const parse = (input: string, opts?: ParserOption): Page => { - const rows = parseToRows(input); - const packs = packRows(rows, { hasTitle: opts?.hasTitle ?? true }); - return packs.map(convertToBlock); + const rows = parseToRows(input); + const packs = packRows(rows, { hasTitle: opts?.hasTitle ?? true }); + return packs.map(convertToBlock); }; /** @@ -37,6 +37,6 @@ export const parse = (input: string, opts?: ParserOption): Page => { * @returns title of input Scrapbox page */ export const getTitle = (input: string): string => { - const match = /^\s*\S.*$/m.exec(input); - return match?.[0]?.trim() ?? "Untitled"; + const match = /^\s*\S.*$/m.exec(input); + return match?.[0]?.trim() ?? "Untitled"; }; diff --git a/tests/codeBlock/index.test.ts b/tests/codeBlock/index.test.ts index 9efb6fad..6d7058f5 100644 --- a/tests/codeBlock/index.test.ts +++ b/tests/codeBlock/index.test.ts @@ -1,11 +1,11 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("Code Block", () => { - it("Simple code block", () => { - expect( - parse( - ` + it("Simple code block", () => { + expect( + parse( + ` code:hello.js function () { alert(document.location.href) @@ -13,29 +13,29 @@ code:hello.js // You can also write comments! } `.trim(), - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); - it("Bulleted code block", () => { - expect( - parse( - ` code:hello.js + it("Bulleted code block", () => { + expect( + parse( + ` code:hello.js function () { alert(document.location.href) console.log("hello") // You can also write comments! }`, - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); - it("Code block with bullet", () => { - expect( - parse( - ` Bullet + it("Code block with bullet", () => { + expect( + parse( + ` Bullet code:hello.js function () { alert(document.location.href) @@ -43,15 +43,15 @@ code:hello.js // You can also write comments! } Bullet`, - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); - it("Consecutive code blocks", () => { - expect( - parse( - ` + it("Consecutive code blocks", () => { + expect( + parse( + ` code:hello.js function () { alert(document.location.href) @@ -65,8 +65,8 @@ code:hello.js // You can also write comments! } `.trim(), - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); }); diff --git a/tests/line/blank.test.ts b/tests/line/blank.test.ts index 7a7a0365..87469ee9 100644 --- a/tests/line/blank.test.ts +++ b/tests/line/blank.test.ts @@ -1,37 +1,37 @@ /* eslint-disable no-irregular-whitespace */ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("blank", () => { - it("Simple half-space blank", () => { - expect(parse("[ ]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple half-space blank", () => { + expect(parse("[ ]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Simple double-byte space blank", () => { - expect(parse("[ ]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple double-byte space blank", () => { + expect(parse("[ ]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Simple tab blank", () => { - expect(parse("[\t]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple tab blank", () => { + expect(parse("[\t]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Multi char blank", () => { - expect(parse("[   \t \t ]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Multi char blank", () => { + expect(parse("[   \t \t ]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Blank in the sentence", () => { - expect( - parse("sentence[ ]sentence", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Blank in the sentence", () => { + expect( + parse("sentence[ ]sentence", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("[] is not blank", () => { - expect(parse("[]", { hasTitle: false })).toMatchSnapshot(); - }); + it("[] is not blank", () => { + expect(parse("[]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Blank in the [*** ]", () => { - expect(parse("[*** [ ]]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Blank in the [*** ]", () => { + expect(parse("[*** [ ]]", { hasTitle: false })).toMatchSnapshot(); + }); }); diff --git a/tests/line/bullet.test.ts b/tests/line/bullet.test.ts index 3a0ab683..d40e0293 100644 --- a/tests/line/bullet.test.ts +++ b/tests/line/bullet.test.ts @@ -1,39 +1,39 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("bullet", () => { - it("Single-byte space indent", () => { - expect( - parse(" Single-byte space", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Single-byte space indent", () => { + expect( + parse(" Single-byte space", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Double-byte space indent", () => { - expect( - parse(" Double-byte space", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Double-byte space indent", () => { + expect( + parse(" Double-byte space", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Tab indent", () => { - // eslint-disable-next-line no-tabs - expect(parse(" Tab", { hasTitle: false })).toMatchSnapshot(); - }); + it("Tab indent", () => { + // eslint-disable-next-line no-tabs + expect(parse(" Tab", { hasTitle: false })).toMatchSnapshot(); + }); - it("Multi lines bullet", () => { - expect( - parse( - ` + it("Multi lines bullet", () => { + expect( + parse( + ` no bullet (indent: 0) first bullet (indent: 1) second bullet (indent: 2) third bullet (indent: 3) `.trim(), - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); }); diff --git a/tests/line/code.test.ts b/tests/line/code.test.ts index d32500af..15e34043 100644 --- a/tests/line/code.test.ts +++ b/tests/line/code.test.ts @@ -1,12 +1,12 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("code", () => { - it("Simple code with backquote", () => { - expect(parse("`Simple code`", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple code with backquote", () => { + expect(parse("`Simple code`", { hasTitle: false })).toMatchSnapshot(); + }); - it("Empty code with backquote", () => { - expect(parse("``", { hasTitle: false })).toMatchSnapshot(); - }); + it("Empty code with backquote", () => { + expect(parse("``", { hasTitle: false })).toMatchSnapshot(); + }); }); diff --git a/tests/line/commandLine.test.ts b/tests/line/commandLine.test.ts index bf08f0ee..06e0ba50 100644 --- a/tests/line/commandLine.test.ts +++ b/tests/line/commandLine.test.ts @@ -1,24 +1,24 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("commandLine", () => { - it("Simple command with $", () => { - expect(parse("$ command", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple command with $", () => { + expect(parse("$ command", { hasTitle: false })).toMatchSnapshot(); + }); - it("Simple command with %", () => { - expect(parse("% command", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple command with %", () => { + expect(parse("% command", { hasTitle: false })).toMatchSnapshot(); + }); - it("`$` is not command", () => { - expect(parse("$", { hasTitle: false })).toMatchSnapshot(); - }); + it("`$` is not command", () => { + expect(parse("$", { hasTitle: false })).toMatchSnapshot(); + }); - it("`$ ` is not command", () => { - expect(parse("$ ", { hasTitle: false })).toMatchSnapshot(); - }); + it("`$ ` is not command", () => { + expect(parse("$ ", { hasTitle: false })).toMatchSnapshot(); + }); - it("`$s` is not command", () => { - expect(parse("$not command", { hasTitle: false })).toMatchSnapshot(); - }); + it("`$s` is not command", () => { + expect(parse("$not command", { hasTitle: false })).toMatchSnapshot(); + }); }); diff --git a/tests/line/decoration.test.ts b/tests/line/decoration.test.ts index 334abc06..3f0cab5a 100644 --- a/tests/line/decoration.test.ts +++ b/tests/line/decoration.test.ts @@ -1,11 +1,16 @@ -import { describe, it, expect } from "vitest"; -import { parse, Line, Decoration, DecorationNode } from "../../src"; +import { describe, expect, it } from "vitest"; +import { + type Decoration, + type DecorationNode, + type Line, + parse, +} from "../../src"; describe("decoration", () => { - it("Simple decoration", () => { - expect( - parse( - ` + it("Simple decoration", () => { + expect( + parse( + ` [* deco] [** deco] [*** deco] @@ -37,92 +42,92 @@ describe("decoration", () => { [_ deco] [~ deco] `.trim(), - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); - it("All decoration", () => { - const input = "[**********!\"#%&'()*+,-./{|}<>_~ decos]"; - const blocks = parse(input, { hasTitle: false }); - const received = ((blocks[0] as Line).nodes[0] as DecorationNode).decos; - const decos: Decoration[] = [ - "*-10", - "!", - '"', - "#", - "%", - "&", - "'", - "(", - ")", - "+", - ",", - "-", - ".", - "/", - "{", - "|", - "}", - "<", - ">", - "_", - "~", - ]; - expect(new Set(received)).toEqual(new Set(decos)); - }); + it("All decoration", () => { + const input = "[**********!\"#%&'()*+,-./{|}<>_~ decos]"; + const blocks = parse(input, { hasTitle: false }); + const received = ((blocks[0] as Line).nodes[0] as DecorationNode).decos; + const decos: Decoration[] = [ + "*-10", + "!", + '"', + "#", + "%", + "&", + "'", + "(", + ")", + "+", + ",", + "-", + ".", + "/", + "{", + "|", + "}", + "<", + ">", + "_", + "~", + ]; + expect(new Set(received)).toEqual(new Set(decos)); + }); - it("Decoration * overflow", () => { - expect(parse("[*********** 11*]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Decoration * overflow", () => { + expect(parse("[*********** 11*]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Decoration similar with externalLink", () => { - expect( - parse("[* hoge https://example.com]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Decoration similar with externalLink", () => { + expect( + parse("[* hoge https://example.com]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Decoration with hashTag", () => { - expect( - parse("[* #tag]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Decoration with hashTag", () => { + expect( + parse("[* #tag]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Decoration with many [", () => { - expect(parse("[! [[[[[[a]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Decoration with many [", () => { + expect(parse("[! [[[[[[a]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Decoration with many [ and link", () => { - expect(parse("[! [[[[[[a]]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Decoration with many [ and link", () => { + expect(parse("[! [[[[[[a]]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Decoration with strong notation (it's just link)", () => { - expect(parse("[* [[link]]]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Decoration with strong notation (it's just link)", () => { + expect(parse("[* [[link]]]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Decoration with icon notation", () => { - expect( - parse("[* [progfay.icon]]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Decoration with icon notation", () => { + expect( + parse("[* [progfay.icon]]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Decoration with strong icon notation (it's just icon, not strong)", () => { - expect( - parse("[* [[progfay.icon]]]", { hasTitle: false }), - ).toMatchSnapshot(); - }); + it("Decoration with strong icon notation (it's just icon, not strong)", () => { + expect( + parse("[* [[progfay.icon]]]", { hasTitle: false }), + ).toMatchSnapshot(); + }); - it("Decoration with strong image notation (it's just image, not strong)", () => { - expect( - parse("[* [[https://example.com/image.png]]]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Decoration with strong image notation (it's just image, not strong)", () => { + expect( + parse("[* [[https://example.com/image.png]]]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); }); diff --git a/tests/line/formula.test.ts b/tests/line/formula.test.ts index ea0ce25e..c17bb971 100644 --- a/tests/line/formula.test.ts +++ b/tests/line/formula.test.ts @@ -1,20 +1,20 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("formula", () => { - it("Simple formula", () => { - expect( - parse("[$ \\frac{3}{2}^N]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Simple formula", () => { + expect( + parse("[$ \\frac{3}{2}^N]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Formula includes [] with tail half-space", () => { - expect(parse("[$ [x] ]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Formula includes [] with tail half-space", () => { + expect(parse("[$ [x] ]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Formula includes [] without tail half-space", () => { - expect(parse("[$ [x]]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Formula includes [] without tail half-space", () => { + expect(parse("[$ [x]]", { hasTitle: false })).toMatchSnapshot(); + }); }); diff --git a/tests/line/googleMap.test.ts b/tests/line/googleMap.test.ts index d32687ce..1256df9e 100644 --- a/tests/line/googleMap.test.ts +++ b/tests/line/googleMap.test.ts @@ -1,44 +1,44 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("googleMap", () => { - it("Simple google map with NE", () => { - expect( - parse("[N35.6812362,E139.7649361]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Simple google map with NE", () => { + expect( + parse("[N35.6812362,E139.7649361]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Simple google map with SW", () => { - expect( - parse("[S13.70533,W69.6533372]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Simple google map with SW", () => { + expect( + parse("[S13.70533,W69.6533372]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Simple google map with zoom", () => { - expect( - parse("[N35.6812362,E139.7649361,Z14]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Simple google map with zoom", () => { + expect( + parse("[N35.6812362,E139.7649361,Z14]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Simple google map with place on left", () => { - expect( - parse("[東京駅 N35.6812362,E139.7649361,Z14]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Simple google map with place on left", () => { + expect( + parse("[東京駅 N35.6812362,E139.7649361,Z14]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Simple google map with place on right", () => { - expect( - parse("[N35.6812362,E139.7649361,Z14 東京駅]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Simple google map with place on right", () => { + expect( + parse("[N35.6812362,E139.7649361,Z14 東京駅]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); }); diff --git a/tests/line/hashTag.test.ts b/tests/line/hashTag.test.ts index a2ecdfb8..e900556a 100644 --- a/tests/line/hashTag.test.ts +++ b/tests/line/hashTag.test.ts @@ -1,28 +1,28 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("hashTag", () => { - it("Simple hashTag", () => { - expect(parse("#tag", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple hashTag", () => { + expect(parse("#tag", { hasTitle: false })).toMatchSnapshot(); + }); - it("Only `#` is not hashTag", () => { - expect(parse("#", { hasTitle: false })).toMatchSnapshot(); - }); + it("Only `#` is not hashTag", () => { + expect(parse("#", { hasTitle: false })).toMatchSnapshot(); + }); - it("HashTag includes `#`", () => { - expect(parse("#hash#Tag", { hasTitle: false })).toMatchSnapshot(); - }); + it("HashTag includes `#`", () => { + expect(parse("#hash#Tag", { hasTitle: false })).toMatchSnapshot(); + }); - it("HashTag in sentence with spaces", () => { - expect(parse("This is a #tag .", { hasTitle: false })).toMatchSnapshot(); - }); + it("HashTag in sentence with spaces", () => { + expect(parse("This is a #tag .", { hasTitle: false })).toMatchSnapshot(); + }); - it("HashTag in sentence without spaces is not hashTag", () => { - expect(parse("→#notTag←", { hasTitle: false })).toMatchSnapshot(); - }); + it("HashTag in sentence without spaces is not hashTag", () => { + expect(parse("→#notTag←", { hasTitle: false })).toMatchSnapshot(); + }); - it("Multiple hashTag", () => { - expect(parse("#hoge #fuga #piyo", { hasTitle: false })).toMatchSnapshot(); - }); + it("Multiple hashTag", () => { + expect(parse("#hoge #fuga #piyo", { hasTitle: false })).toMatchSnapshot(); + }); }); diff --git a/tests/line/helpfeel.test.ts b/tests/line/helpfeel.test.ts index 63f6d19a..5ca29e2b 100644 --- a/tests/line/helpfeel.test.ts +++ b/tests/line/helpfeel.test.ts @@ -1,16 +1,16 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("helpfeel", () => { - it("Simple helpfeel", () => { - expect(parse("? Simple helpfeel", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple helpfeel", () => { + expect(parse("? Simple helpfeel", { hasTitle: false })).toMatchSnapshot(); + }); - it("No head `?` is not helpfeel", () => { - expect(parse("a ? not helpfeel", { hasTitle: false })).toMatchSnapshot(); - }); + it("No head `?` is not helpfeel", () => { + expect(parse("a ? not helpfeel", { hasTitle: false })).toMatchSnapshot(); + }); - it("Quoted ? is not helpfeel", () => { - expect(parse("> ? Quoted", { hasTitle: false })).toMatchSnapshot(); - }); + it("Quoted ? is not helpfeel", () => { + expect(parse("> ? Quoted", { hasTitle: false })).toMatchSnapshot(); + }); }); diff --git a/tests/line/icon.test.ts b/tests/line/icon.test.ts index 435f7c8a..fa56b3d5 100644 --- a/tests/line/icon.test.ts +++ b/tests/line/icon.test.ts @@ -1,35 +1,35 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("icon", () => { - it("Simple root icon", () => { - expect(parse("[/icons/+1.icon]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple root icon", () => { + expect(parse("[/icons/+1.icon]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Simple relative icon", () => { - expect(parse("[me.icon]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple relative icon", () => { + expect(parse("[me.icon]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Multiple icons", () => { - expect(parse("[me.icon*3]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Multiple icons", () => { + expect(parse("[me.icon*3]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Icon and internal link on same line", () => { - expect( - parse("[Internal link][me.icon]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Icon and internal link on same line", () => { + expect( + parse("[Internal link][me.icon]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Each multiple icon must be different Object", () => { - const [block] = parse("[me.icon*2]", { hasTitle: false }); + it("Each multiple icon must be different Object", () => { + const [block] = parse("[me.icon*2]", { hasTitle: false }); - if (block === undefined || block.type !== "line") { - throw new Error("fail"); - } + if (block === undefined || block.type !== "line") { + throw new Error("fail"); + } - expect(block.nodes.length).toBe(2); - expect(block.nodes[0]).not.toBe(block.nodes[1]); - }); + expect(block.nodes.length).toBe(2); + expect(block.nodes[0]).not.toBe(block.nodes[1]); + }); }); diff --git a/tests/line/image.test.ts b/tests/line/image.test.ts index 5dcc2194..3e2b8f8a 100644 --- a/tests/line/image.test.ts +++ b/tests/line/image.test.ts @@ -1,91 +1,91 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("image", () => { - it("Simple image", () => { - expect( - parse( - ` + it("Simple image", () => { + expect( + parse( + ` [http://example.com/image.png] [https://example.com/image.JPG] `.trim(), - { - hasTitle: false, - }, - ), - ).toMatchSnapshot(); - }); + { + hasTitle: false, + }, + ), + ).toMatchSnapshot(); + }); - it("HTTP jpeg image with special and japanese chars", () => { - expect( - parse("[http://example.com/~!@#$%^&*()_+`-={}\\'\"?,.<>|/画像.jpeg]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("HTTP jpeg image with special and japanese chars", () => { + expect( + parse("[http://example.com/~!@#$%^&*()_+`-={}\\'\"?,.<>|/画像.jpeg]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("HTTPS svg and GIF image with link", () => { - expect( - parse( - ` + it("HTTPS svg and GIF image with link", () => { + expect( + parse( + ` [https://example.com/image.svg https://example.com/] [https://example.com/ https://example.com/image.GIF] `.trim(), - { - hasTitle: false, - }, - ), - ).toMatchSnapshot(); - }); + { + hasTitle: false, + }, + ), + ).toMatchSnapshot(); + }); - it("Image with double image link", () => { - expect( - parse( - "[https://example.com/forward.png https://example.com/backward.png]", - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + it("Image with double image link", () => { + expect( + parse( + "[https://example.com/forward.png https://example.com/backward.png]", + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); - it("Gyazo image", () => { - expect( - parse( - ` + it("Gyazo image", () => { + expect( + parse( + ` [https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815] [https://i.gyazo.com/0f82099330f378fe4917a1b4a5fe8815] [https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815/raw] `.trim(), - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); - it("Gyazo image with link", () => { - expect( - parse( - ` + it("Gyazo image with link", () => { + expect( + parse( + ` [https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815 https://example.com] [https://example.com https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815] [https://gyazo.com/7057219f5b20ca8afd122945b72453d3 https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815] `.trim(), - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); - it("Image with GET parameters", () => { - expect( - parse("[http://example.com/image.png?key1=value1&key2=value2]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Image with GET parameters", () => { + expect( + parse("[http://example.com/image.png?key1=value1&key2=value2]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Direct Gyazo image", () => { - expect( - parse("[https://i.gyazo.com/0f82099330f378fe4917a1b4a5fe8815.png]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Direct Gyazo image", () => { + expect( + parse("[https://i.gyazo.com/0f82099330f378fe4917a1b4a5fe8815.png]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); }); diff --git a/tests/line/index.test.ts b/tests/line/index.test.ts index ccb5eec6..d92ce5dc 100644 --- a/tests/line/index.test.ts +++ b/tests/line/index.test.ts @@ -1,28 +1,28 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("line", () => { - it("Line that have multi node", () => { - expect(parse("[Link][Link]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Line that have multi node", () => { + expect(parse("[Link][Link]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Decoration line includes internal link", () => { - expect(parse("[* [Link]]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Decoration line includes internal link", () => { + expect(parse("[* [Link]]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Decoration line includes external link", () => { - expect( - parse("[* [https://example.com example]]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Decoration line includes external link", () => { + expect( + parse("[* [https://example.com example]]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Multi `]`", () => { - expect( - parse("[* [Link]`code`[Link]]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Multi `]`", () => { + expect( + parse("[* [Link]`code`[Link]]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); }); diff --git a/tests/line/link.test.ts b/tests/line/link.test.ts index f0b7af2d..23067dad 100644 --- a/tests/line/link.test.ts +++ b/tests/line/link.test.ts @@ -1,77 +1,77 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("link", () => { - it("Simple absolute link", () => { - expect( - parse("https://example.com/", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Simple absolute link", () => { + expect( + parse("https://example.com/", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Simple absolute link with ahead non-space character", () => { - expect( - parse("ahttps://example.com/", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Simple absolute link with ahead non-space character", () => { + expect( + parse("ahttps://example.com/", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Simple absolute link with bracket", () => { - expect( - parse("[https://example.com/]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Simple absolute link with bracket", () => { + expect( + parse("[https://example.com/]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Simple root link", () => { - expect(parse("[/project/page]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple root link", () => { + expect(parse("[/project/page]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Simple relative link", () => { - expect(parse("[page]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple relative link", () => { + expect(parse("[page]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Link with content", () => { - expect( - parse( - ` + it("Link with content", () => { + expect( + parse( + ` [https://example.com/ Example] [Example https://example.com/] [https://left.com/ center https://right.com/] `.trim(), - { - hasTitle: false, - }, - ), - ).toMatchSnapshot(); - }); + { + hasTitle: false, + }, + ), + ).toMatchSnapshot(); + }); - it("Root and relative link path can include space", () => { - expect( - parse( - ` + it("Root and relative link path can include space", () => { + expect( + parse( + ` [page name] [/project/page name] `.trim(), - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); - it("Link with link", () => { - expect( - parse("[https://example.com https://example.com]", { hasTitle: false }), - ).toMatchSnapshot(); - }); + it("Link with link", () => { + expect( + parse("[https://example.com https://example.com]", { hasTitle: false }), + ).toMatchSnapshot(); + }); - it("Link with GET parameters", () => { - expect( - parse("[http://example.com?key1=value1&key2=value2]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Link with GET parameters", () => { + expect( + parse("[http://example.com?key1=value1&key2=value2]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); }); diff --git a/tests/line/numberList.test.ts b/tests/line/numberList.test.ts index d196e0f2..713d7e18 100644 --- a/tests/line/numberList.test.ts +++ b/tests/line/numberList.test.ts @@ -1,40 +1,40 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("numberList", () => { - it("Minimum numberList", () => { - expect( - parse("1. ", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Minimum numberList", () => { + expect( + parse("1. ", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Simple numberList", () => { - expect( - parse("1. Simple numberList", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Simple numberList", () => { + expect( + parse("1. Simple numberList", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("1. with no space is not numberList", () => { - expect( - parse("1.not numberList", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("1. with no space is not numberList", () => { + expect( + parse("1.not numberList", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("No head 1. is not numberList", () => { - expect( - parse("a 1. not numberList", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("No head 1. is not numberList", () => { + expect( + parse("a 1. not numberList", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Quoted 1. is not numberList", () => { - expect(parse("> 1. Quoted", { hasTitle: false })).toMatchSnapshot(); - }); + it("Quoted 1. is not numberList", () => { + expect(parse("> 1. Quoted", { hasTitle: false })).toMatchSnapshot(); + }); }); diff --git a/tests/line/plain.test.ts b/tests/line/plain.test.ts index c18923f8..a3c1d60c 100644 --- a/tests/line/plain.test.ts +++ b/tests/line/plain.test.ts @@ -1,16 +1,16 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("plain", () => { - it("Simple plain text", () => { - expect(parse("Plain text", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple plain text", () => { + expect(parse("Plain text", { hasTitle: false })).toMatchSnapshot(); + }); - it("Blank line", () => { - expect(parse("", { hasTitle: false })).toMatchSnapshot(); - }); + it("Blank line", () => { + expect(parse("", { hasTitle: false })).toMatchSnapshot(); + }); - it("Keep tail space", () => { - expect(parse("Tail space -> ", { hasTitle: false })).toMatchSnapshot(); - }); + it("Keep tail space", () => { + expect(parse("Tail space -> ", { hasTitle: false })).toMatchSnapshot(); + }); }); diff --git a/tests/line/quote.test.ts b/tests/line/quote.test.ts index 72c865b2..b6483bbd 100644 --- a/tests/line/quote.test.ts +++ b/tests/line/quote.test.ts @@ -1,12 +1,12 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("quote", () => { - it("Simple quote", () => { - expect(parse("> Simple quote", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple quote", () => { + expect(parse("> Simple quote", { hasTitle: false })).toMatchSnapshot(); + }); - it("Empty quote", () => { - expect(parse(">", { hasTitle: false })).toMatchSnapshot(); - }); + it("Empty quote", () => { + expect(parse(">", { hasTitle: false })).toMatchSnapshot(); + }); }); diff --git a/tests/line/strong.test.ts b/tests/line/strong.test.ts index d9af0f30..35ffd7a5 100644 --- a/tests/line/strong.test.ts +++ b/tests/line/strong.test.ts @@ -1,16 +1,16 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("strong", () => { - it("Simple strong", () => { - expect(parse("[[Simple strong]]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple strong", () => { + expect(parse("[[Simple strong]]", { hasTitle: false })).toMatchSnapshot(); + }); - it("[[]] is not strong", () => { - expect(parse("[[]]", { hasTitle: false })).toMatchSnapshot(); - }); + it("[[]] is not strong", () => { + expect(parse("[[]]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Decoration in Strong notation", () => { - expect(parse("[[[! deco]]]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Decoration in Strong notation", () => { + expect(parse("[[[! deco]]]", { hasTitle: false })).toMatchSnapshot(); + }); }); diff --git a/tests/line/strongIcon.test.ts b/tests/line/strongIcon.test.ts index 1601df06..8e6d702b 100644 --- a/tests/line/strongIcon.test.ts +++ b/tests/line/strongIcon.test.ts @@ -1,38 +1,38 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("strongIcon", () => { - it("Simple root strong icon", () => { - expect( - parse("[[/icons/+1.icon]]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Simple root strong icon", () => { + expect( + parse("[[/icons/+1.icon]]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Simple relative strong icon", () => { - expect(parse("[[me.icon]]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Simple relative strong icon", () => { + expect(parse("[[me.icon]]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Multiple icons", () => { - expect(parse("[[me.icon*3]]", { hasTitle: false })).toMatchSnapshot(); - }); + it("Multiple icons", () => { + expect(parse("[[me.icon*3]]", { hasTitle: false })).toMatchSnapshot(); + }); - it("Strong icon and internal link on same line", () => { - expect( - parse("[Internal link][[me.icon]]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Strong icon and internal link on same line", () => { + expect( + parse("[Internal link][[me.icon]]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Each multiple strong icon must be different Object", () => { - const [block] = parse("[[me.icon*2]]", { hasTitle: false }); - if (block === undefined || block.type !== "line") { - throw new Error("fail"); - } + it("Each multiple strong icon must be different Object", () => { + const [block] = parse("[[me.icon*2]]", { hasTitle: false }); + if (block === undefined || block.type !== "line") { + throw new Error("fail"); + } - expect(block.nodes.length).toBe(2); - expect(block.nodes[0]).not.toBe(block.nodes[1]); - }); + expect(block.nodes.length).toBe(2); + expect(block.nodes[0]).not.toBe(block.nodes[1]); + }); }); diff --git a/tests/line/strongImage.test.ts b/tests/line/strongImage.test.ts index bb324cb1..21ba7a89 100644 --- a/tests/line/strongImage.test.ts +++ b/tests/line/strongImage.test.ts @@ -1,44 +1,44 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("strongImage", () => { - it("Simple strong image", () => { - expect( - parse( - ` + it("Simple strong image", () => { + expect( + parse( + ` [[http://example.com/image.png]] [[https://example.com/image.JPG]] [[https://example.com/image.svg]] [[https://example.com/image.GIF]] `.trim(), - { - hasTitle: false, - }, - ), - ).toMatchSnapshot(); - }); + { + hasTitle: false, + }, + ), + ).toMatchSnapshot(); + }); - it("HTTP jpeg strong image with special and japanese chars", () => { - expect( - parse("[[http://example.com/~!@#$%^&*()_+`-={}\\'\"?,.<>|/画像.jpeg]]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("HTTP jpeg strong image with special and japanese chars", () => { + expect( + parse("[[http://example.com/~!@#$%^&*()_+`-={}\\'\"?,.<>|/画像.jpeg]]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Gyazo image", () => { - expect( - parse("[[https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815]]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Gyazo image", () => { + expect( + parse("[[https://gyazo.com/0f82099330f378fe4917a1b4a5fe8815]]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); - it("Direct Gyazo image", () => { - expect( - parse("[[https://i.gyazo.com/0f82099330f378fe4917a1b4a5fe8815.png]]", { - hasTitle: false, - }), - ).toMatchSnapshot(); - }); + it("Direct Gyazo image", () => { + expect( + parse("[[https://i.gyazo.com/0f82099330f378fe4917a1b4a5fe8815.png]]", { + hasTitle: false, + }), + ).toMatchSnapshot(); + }); }); diff --git a/tests/page/index.test.ts b/tests/page/index.test.ts index c9a3b026..6e1de26d 100644 --- a/tests/page/index.test.ts +++ b/tests/page/index.test.ts @@ -1,20 +1,20 @@ import * as fs from "node:fs"; -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("page", () => { - it("Empty page", () => { - const input = ""; - expect(parse(input, { hasTitle: true })).toMatchSnapshot(); - }); + it("Empty page", () => { + const input = ""; + expect(parse(input, { hasTitle: true })).toMatchSnapshot(); + }); - it("Title Block without `hasTitle` option", () => { - const input = "Title"; - expect(parse(input)).toMatchSnapshot(); - }); + it("Title Block without `hasTitle` option", () => { + const input = "Title"; + expect(parse(input)).toMatchSnapshot(); + }); - it("https://scrapbox.io/help/Syntax", () => { - const input = fs.readFileSync("./tests/page/input.txt").toString(); - expect(parse(input, { hasTitle: true })).toMatchSnapshot(); - }); + it("https://scrapbox.io/help/Syntax", () => { + const input = fs.readFileSync("./tests/page/input.txt").toString(); + expect(parse(input, { hasTitle: true })).toMatchSnapshot(); + }); }); diff --git a/tests/table/index.test.ts b/tests/table/index.test.ts index dc40dd04..d487e09c 100644 --- a/tests/table/index.test.ts +++ b/tests/table/index.test.ts @@ -1,65 +1,65 @@ /* eslint-disable no-tabs, no-irregular-whitespace */ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { parse } from "../../src"; describe("Table", () => { - it("Simple table", () => { - expect( - parse( - ` + it("Simple table", () => { + expect( + parse( + ` table:hello ${"\t"}1${"\t"}2${"\t"}3 ${"\t"}1 ${"\t"}2 ${"\t"}3 ${"\t"}------${"\t"}------${"\t"}------ ${"\t"}a${"\t"}b${"\t"}c `.trim(), - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); - it("Bulleted table", () => { - expect( - parse( - ` table:bulleted + it("Bulleted table", () => { + expect( + parse( + ` table:bulleted ${"\t"}1${"\t"}2${"\t"}3 ${"\t"}1 ${"\t"}2 ${"\t"}3 ${"\t"}------${"\t"}------${"\t"}------ ${"\t"}a${"\t"}b${"\t"}c`, - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); - it("Table with empty cells", () => { - expect( - parse( - `table:${" "} + it("Table with empty cells", () => { + expect( + parse( + `table:${" "} ${"\t"} ${"\t"} ${"\t"}${" "} ${"\t"}${"\t"}${"\t"}`, - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); - it("Staggered table", () => { - expect( - parse( - `table:Staggered + it("Staggered table", () => { + expect( + parse( + `table:Staggered ${"\t"}1${"\t"}2${"\t"}3${"\t"}4 ${"\t"}1${"\t"}2${"\t"}3 ${"\t"}1 ${"\t"}1${"\t"}2 ${"\t"}`, - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); - it("Consecutive table", () => { - expect( - parse( - ` + it("Consecutive table", () => { + expect( + parse( + ` table:hello ${"\t"}1${"\t"}2${"\t"}3 ${"\t"}1 ${"\t"}2 ${"\t"}3 @@ -71,15 +71,15 @@ ${"\t"}1 ${"\t"}2 ${"\t"}3 ${"\t"}------${"\t"}------${"\t"}------ ${"\t"}a${"\t"}b${"\t"}c `.trim(), - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); - it("Node in table cells", () => { - expect( - parse( - ` + it("Node in table cells", () => { + expect( + parse( + ` table:node in table cells ${"\t"}#hashtag ${"\t"}[* deco] @@ -103,8 +103,8 @@ ${"\t"}[[progfay.icon]] ${"\t"}[[https://image.com/image.png]] ${"\t"}[[strong]] `.trim(), - { hasTitle: false }, - ), - ).toMatchSnapshot(); - }); + { hasTitle: false }, + ), + ).toMatchSnapshot(); + }); }); diff --git a/tests/title/index.test.ts b/tests/title/index.test.ts index 77115440..bc1c9dcf 100644 --- a/tests/title/index.test.ts +++ b/tests/title/index.test.ts @@ -1,26 +1,26 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { getTitle } from "../../src"; describe("title", () => { - it("Get title from simple page", () => { - const title = getTitle("title\nline\nline\n"); - expect(title).toEqual("title"); - }); + it("Get title from simple page", () => { + const title = getTitle("title\nline\nline\n"); + expect(title).toEqual("title"); + }); - it("Get title from empty page", () => { - expect(getTitle("")).toEqual("Untitled"); - expect(getTitle("  \t")).toEqual("Untitled"); - expect(getTitle("\n")).toEqual("Untitled"); - expect(getTitle("\n  \t")).toEqual("Untitled"); - }); + it("Get title from empty page", () => { + expect(getTitle("")).toEqual("Untitled"); + expect(getTitle("  \t")).toEqual("Untitled"); + expect(getTitle("\n")).toEqual("Untitled"); + expect(getTitle("\n  \t")).toEqual("Untitled"); + }); - it("Get title from title only page", () => { - const title = getTitle("title"); - expect(title).toEqual("title"); - }); + it("Get title from title only page", () => { + const title = getTitle("title"); + expect(title).toEqual("title"); + }); - it("Get title from huge page", () => { - const title = getTitle(" \n".repeat(10 ** 8) + "title"); - expect(title).toEqual("title"); - }); + it("Get title from huge page", () => { + const title = getTitle(`${" \n".repeat(10 ** 8)}title`); + expect(title).toEqual("title"); + }); }); diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json index 8fc6a475..dea287ec 100644 --- a/tsconfig.cjs.json +++ b/tsconfig.cjs.json @@ -1,9 +1,9 @@ { - "extends": "./tsconfig", - "compilerOptions": { - "module": "commonjs", - "rootDir": "./src", - "outDir": "./lib", - "tsBuildInfoFile": "./.cjs.tsbuildinfo" - } + "extends": "./tsconfig", + "compilerOptions": { + "module": "commonjs", + "rootDir": "./src", + "outDir": "./lib", + "tsBuildInfoFile": "./.cjs.tsbuildinfo" + } } diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index f6931856..03b37193 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -1,7 +1,7 @@ { - "extends": "./tsconfig", - "compilerOptions": { - "noEmit": true - }, - "include": ["**/*"] + "extends": "./tsconfig", + "compilerOptions": { + "noEmit": true + }, + "include": ["**/*"] } diff --git a/tsconfig.esm.json b/tsconfig.esm.json index c8ec979d..3948e474 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -1,9 +1,9 @@ { - "extends": "./tsconfig", - "compilerOptions": { - "module": "es2015", - "rootDir": "./src", - "outDir": "./esm", - "tsBuildInfoFile": "./.esm.tsbuildinfo" - } + "extends": "./tsconfig", + "compilerOptions": { + "module": "es2015", + "rootDir": "./src", + "outDir": "./esm", + "tsBuildInfoFile": "./.esm.tsbuildinfo" + } } diff --git a/tsconfig.json b/tsconfig.json index 9fd2ae49..2818cdf4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,71 +1,73 @@ { - "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ - /* Basic Options */ - "incremental": true, /* Enable incremental compilation */ - "target": "ES2018", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ - "lib": ["ES2017"], /* Specify library files to be included in the compilation. */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true, /* Generates corresponding '.d.ts' file. */ - "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - "composite": true, /* Enable project compilation */ - // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + /* Basic Options */ + "incremental": true /* Enable incremental compilation */, + "target": "ES2018" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, + "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, + "lib": [ + "ES2017" + ] /* Specify library files to be included in the compilation. */, + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + "declaration": true /* Generates corresponding '.d.ts' file. */, + "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, + "sourceMap": true /* Generates corresponding '.map' file. */, + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + "composite": true /* Enable project compilation */, + // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ + "removeComments": true /* Do not emit comments to output. */, + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type-Checking Options */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + /* Strict Type-Checking Options */ + "strict": true /* Enable all strict type-checking options. */, + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - /* Additional Checks */ - "noUnusedLocals": true, /* Report errors on unused locals. */ - "noUnusedParameters": true, /* Report errors on unused parameters. */ - "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ + /* Additional Checks */ + "noUnusedLocals": true /* Report errors on unused locals. */, + "noUnusedParameters": true /* Report errors on unused parameters. */, + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + "noUncheckedIndexedAccess": true /* Include 'undefined' in index signature results */, - /* Module Resolution Options */ - "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + /* Module Resolution Options */ + "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - /* Advanced Options */ - "skipLibCheck": true, /* Skip type checking of declaration files. */ - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ - }, - "include": ["src/**/*"] + /* Advanced Options */ + "skipLibCheck": true /* Skip type checking of declaration files. */, + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ + }, + "include": ["src/**/*"] } diff --git a/vite.config.ts b/vite.config.ts index 507c4e8d..c5b2a576 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,22 +1,22 @@ /// -import { resolve } from "path"; +import { resolve } from "node:path"; import { defineConfig } from "vite"; export default defineConfig({ - build: { - emptyOutDir: false, - outDir: "umd", - lib: { - formats: ["umd"], - entry: resolve(__dirname, "src/index.ts"), - name: "ScrapboxParser", - fileName: "scrapbox-parser", - }, - }, - test: { - include: ["**/tests/**/*.test.ts"], - coverage: { - include: ["src/**/*.ts"], - }, - }, + build: { + emptyOutDir: false, + outDir: "umd", + lib: { + formats: ["umd"], + entry: resolve(__dirname, "src/index.ts"), + name: "ScrapboxParser", + fileName: "scrapbox-parser", + }, + }, + test: { + include: ["**/tests/**/*.test.ts"], + coverage: { + include: ["src/**/*.ts"], + }, + }, });