From ab254741df2855f7f22d30cfc85b639675d3ac27 Mon Sep 17 00:00:00 2001 From: kakakaya Date: Sun, 17 Mar 2024 20:18:23 +0900 Subject: [PATCH 1/5] Add vitest and its config --- frontend/package-lock.json | 688 ++++++++++++++++++++++++++++++++++++- frontend/package.json | 8 +- frontend/package.json.md5 | 2 +- 3 files changed, 693 insertions(+), 5 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 5cef6c9..ce39835 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -15,7 +15,8 @@ "svelte-preprocess": "^5.1.3", "tslib": "^2.6.2", "typescript": "^5.4.2", - "vite": "^5.1.6" + "vite": "^5.1.6", + "vitest": "^1.4.0" } }, "node_modules/@ampproject/remapping": { @@ -399,6 +400,18 @@ "node": ">=12" } }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", @@ -651,6 +664,12 @@ "win32" ] }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, "node_modules/@sveltejs/vite-plugin-svelte": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-3.0.2.tgz", @@ -708,6 +727,75 @@ "integrity": "sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==", "dev": true }, + "node_modules/@vitest/expect": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.4.0.tgz", + "integrity": "sha512-Jths0sWCJZ8BxjKe+p+eKsoqev1/T8lYcrjavEaz8auEJ4jAVY0GwW3JKmdVU4mmNPLPHixh4GNXP7GFtAiDHA==", + "dev": true, + "dependencies": { + "@vitest/spy": "1.4.0", + "@vitest/utils": "1.4.0", + "chai": "^4.3.10" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.4.0.tgz", + "integrity": "sha512-EDYVSmesqlQ4RD2VvWo3hQgTJ7ZrFQ2VSJdfiJiArkCerDAGeyF1i6dHkmySqk573jLp6d/cfqCN+7wUB5tLgg==", + "dev": true, + "dependencies": { + "@vitest/utils": "1.4.0", + "p-limit": "^5.0.0", + "pathe": "^1.1.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.4.0.tgz", + "integrity": "sha512-saAFnt5pPIA5qDGxOHxJ/XxhMFKkUSBJmVt5VgDsAqPTX6JP326r5C/c9UuCMPoXNzuudTPsYDZCoJ5ilpqG2A==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.4.0.tgz", + "integrity": "sha512-Ywau/Qs1DzM/8Uc+yA77CwSegizMlcgTJuYGAi0jujOteJOUf1ujunHThYo243KG9nAyWT3L9ifPYZ5+As/+6Q==", + "dev": true, + "dependencies": { + "tinyspy": "^2.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.4.0.tgz", + "integrity": "sha512-mx3Yd1/6e2Vt/PUC98DcqTirtfxUyAZ32uK82r8rZzbtBeBo+nqgnjx/LvqQdWsrvNtm14VmurNgcf4nqY5gJg==", + "dev": true, + "dependencies": { + "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/acorn": { "version": "8.11.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", @@ -720,6 +808,27 @@ "node": ">=0.4.0" } }, + "node_modules/acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -742,6 +851,15 @@ "dequal": "^2.0.3" } }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/axobject-query": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz", @@ -800,6 +918,15 @@ "node": "*" } }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -809,6 +936,36 @@ "node": ">=6" } }, + "node_modules/chai": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "dev": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, "node_modules/chokidar": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", @@ -852,6 +1009,20 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/css-tree": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", @@ -882,6 +1053,18 @@ } } }, + "node_modules/deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dev": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", @@ -909,6 +1092,15 @@ "node": ">=8" } }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/es6-promise": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", @@ -962,6 +1154,29 @@ "@types/estree": "^1.0.0" } }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -1019,6 +1234,27 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -1057,6 +1293,15 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -1140,6 +1385,36 @@ "@types/estree": "*" } }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz", + "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==", + "dev": true + }, + "node_modules/jsonc-parser": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true + }, "node_modules/kleur": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", @@ -1149,12 +1424,37 @@ "node": ">=6" } }, + "node_modules/local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "dependencies": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/locate-character": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", "dev": true }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.1" + } + }, "node_modules/magic-string": { "version": "0.30.8", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", @@ -1173,6 +1473,12 @@ "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", "dev": true }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -1195,6 +1501,18 @@ "node": ">=8.6" } }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -1237,6 +1555,18 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/mlly": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz", + "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==", + "dev": true, + "dependencies": { + "acorn": "^8.11.3", + "pathe": "^1.1.2", + "pkg-types": "^1.0.3", + "ufo": "^1.3.2" + } + }, "node_modules/mri": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", @@ -1279,6 +1609,33 @@ "node": ">=0.10.0" } }, + "node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1288,6 +1645,36 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-limit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -1309,6 +1696,30 @@ "node": ">=0.10.0" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/periscopic": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz", @@ -1338,6 +1749,17 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pkg-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "dev": true, + "dependencies": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.2.0", + "pathe": "^1.1.0" + } + }, "node_modules/postcss": { "version": "8.4.35", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", @@ -1366,6 +1788,20 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -1386,6 +1822,12 @@ } ] }, + "node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -1508,6 +1950,45 @@ "rimraf": "^2.5.2" } }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/sorcery": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/sorcery/-/sorcery-0.11.0.tgz", @@ -1532,6 +2013,30 @@ "node": ">=0.10.0" } }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true + }, + "node_modules/std-env": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "dev": true + }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-indent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", @@ -1544,6 +2049,18 @@ "node": ">=8" } }, + "node_modules/strip-literal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.0.0.tgz", + "integrity": "sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==", + "dev": true, + "dependencies": { + "js-tokens": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/svelte": { "version": "4.2.12", "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.12.tgz", @@ -1666,6 +2183,30 @@ } } }, + "node_modules/tinybench": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", + "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", + "dev": true + }, + "node_modules/tinypool": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", + "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -1684,6 +2225,15 @@ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "dev": true }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/typescript": { "version": "5.4.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", @@ -1697,6 +2247,12 @@ "node": ">=14.17" } }, + "node_modules/ufo": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.1.tgz", + "integrity": "sha512-HGyF79+/qZ4soRvM+nHERR2pJ3VXDZ/8sL1uLahdgEDf580NkgiWOxLk33FetExqOWp352JZRsgXbG/4MaGOSg==", + "dev": true + }, "node_modules/vite": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.6.tgz", @@ -1752,6 +2308,28 @@ } } }, + "node_modules/vite-node": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.4.0.tgz", + "integrity": "sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==", + "dev": true, + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/vitefu": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", @@ -1766,11 +2344,119 @@ } } }, + "node_modules/vitest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.4.0.tgz", + "integrity": "sha512-gujzn0g7fmwf83/WzrDTnncZt2UiXP41mHuFYFrdwaLRVQ6JYQEiME2IfEjU3vcFL3VKa75XhI3lFgn+hfVsQw==", + "dev": true, + "dependencies": { + "@vitest/expect": "1.4.0", + "@vitest/runner": "1.4.0", + "@vitest/snapshot": "1.4.0", + "@vitest/spy": "1.4.0", + "@vitest/utils": "1.4.0", + "acorn-walk": "^8.3.2", + "chai": "^4.3.10", + "debug": "^4.3.4", + "execa": "^8.0.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "tinybench": "^2.5.1", + "tinypool": "^0.8.2", + "vite": "^5.0.0", + "vite-node": "1.4.0", + "why-is-node-running": "^2.2.2" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "1.4.0", + "@vitest/ui": "1.4.0", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dev": true, + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true + }, + "node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/frontend/package.json b/frontend/package.json index ca81e7c..b4dd68d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -7,7 +7,8 @@ "dev": "vite", "build": "vite build", "preview": "vite preview", - "check": "svelte-check --tsconfig ./tsconfig.json" + "check": "svelte-check --tsconfig ./tsconfig.json", + "test": "vitest" }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^3.0.2", @@ -17,6 +18,7 @@ "svelte-preprocess": "^5.1.3", "tslib": "^2.6.2", "typescript": "^5.4.2", - "vite": "^5.1.6" + "vite": "^5.1.6", + "vitest": "^1.4.0" } -} \ No newline at end of file +} diff --git a/frontend/package.json.md5 b/frontend/package.json.md5 index b8b16f5..bdc90fd 100755 --- a/frontend/package.json.md5 +++ b/frontend/package.json.md5 @@ -1 +1 @@ -c0c51ea1a293d170d81720cc682c4147 \ No newline at end of file +c56b78c8474ce6e268f104285fa6c5ea \ No newline at end of file From 382216c3e0e531194f12185b4554843c560cdc50 Mon Sep 17 00:00:00 2001 From: kakakaya Date: Sun, 17 Mar 2024 20:19:44 +0900 Subject: [PATCH 2/5] Move unicode.js to ts and add some test --- frontend/src/App.svelte | 2 +- frontend/src/topping/unicode.js | 998 ------------------------- frontend/src/topping/unicode.test.ts | 26 + frontend/src/topping/unicode.ts | 1000 ++++++++++++++++++++++++++ 4 files changed, 1027 insertions(+), 999 deletions(-) delete mode 100644 frontend/src/topping/unicode.js create mode 100644 frontend/src/topping/unicode.test.ts create mode 100644 frontend/src/topping/unicode.ts diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index e1a6776..3b977b1 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -14,7 +14,7 @@ import { ConvertRichUnicode - } from './topping/unicode.js' + } from './topping/unicode.ts' let text let charCounter = 0 diff --git a/frontend/src/topping/unicode.js b/frontend/src/topping/unicode.js deleted file mode 100644 index eaadfe3..0000000 --- a/frontend/src/topping/unicode.js +++ /dev/null @@ -1,998 +0,0 @@ -const convertMap = { - frakturDict: { - A: "๐”„", - B: "๐”…", - C: "โ„ญ", - D: "๐”‡", - E: "๐”ˆ", - F: "๐”‰", - G: "๐”Š", - H: "โ„Œ", - I: "โ„‘", - J: "๐”", - K: "๐”Ž", - L: "๐”", - M: "๐”", - N: "๐”‘", - O: "๐”’", - P: "๐”“", - Q: "๐””", - R: "โ„œ", - S: "๐”–", - T: "๐”—", - U: "๐”˜", - V: "๐”™", - W: "๐”š", - X: "๐”›", - Y: "๐”œ", - Z: "โ„จ", - a: "๐”ž", - b: "๐”Ÿ", - c: "๐” ", - d: "๐”ก", - e: "๐”ข", - f: "๐”ฃ", - g: "๐”ค", - h: "๐”ฅ", - i: "๐”ฆ", - j: "๐”ง", - k: "๐”จ", - l: "๐”ฉ", - m: "๐”ช", - n: "๐”ซ", - o: "๐”ฌ", - p: "๐”ญ", - q: "๐”ฎ", - r: "๐”ฏ", - s: "๐”ฐ", - t: "๐”ฑ", - u: "๐”ฒ", - v: "๐”ณ", - w: "๐”ด", - x: "๐”ต", - y: "๐”ถ", - z: "๐”ท" - }, - frakturBoldDict: { - A: "๐•ฌ", - B: "๐•ญ", - C: "๐•ฎ", - D: "๐•ฏ", - E: "๐•ฐ", - F: "๐•ฑ", - G: "๐•ฒ", - H: "๐•ณ", - I: "๐•ด", - J: "๐•ต", - K: "๐•ถ", - L: "๐•ท", - M: "๐•ธ", - N: "๐•น", - O: "๐•บ", - P: "๐•ป", - Q: "๐•ผ", - R: "๐•ฝ", - S: "๐•พ", - T: "๐•ฟ", - U: "๐–€", - V: "๐–", - W: "๐–‚", - X: "๐–ƒ", - Y: "๐–„", - Z: "๐–…", - a: "๐–†", - b: "๐–‡", - c: "๐–ˆ", - d: "๐–‰", - e: "๐–Š", - f: "๐–‹", - g: "๐–Œ", - h: "๐–", - i: "๐–Ž", - j: "๐–", - k: "๐–", - l: "๐–‘", - m: "๐–’", - n: "๐–“", - o: "๐–”", - p: "๐–•", - q: "๐––", - r: "๐–—", - s: "๐–˜", - t: "๐–™", - u: "๐–š", - v: "๐–›", - w: "๐–œ", - x: "๐–", - y: "๐–ž", - z: "๐–Ÿ" - }, - monospaceDict: { - 0: "๐Ÿถ", - 1: "๐Ÿท", - 2: "๐Ÿธ", - 3: "๐Ÿน", - 4: "๐Ÿบ", - 5: "๐Ÿป", - 6: "๐Ÿผ", - 7: "๐Ÿฝ", - 8: "๐Ÿพ", - 9: "๐Ÿฟ", - A: "๐™ฐ", - B: "๐™ฑ", - C: "๐™ฒ", - D: "๐™ณ", - E: "๐™ด", - F: "๐™ต", - G: "๐™ถ", - H: "๐™ท", - I: "๐™ธ", - J: "๐™น", - K: "๐™บ", - L: "๐™ป", - M: "๐™ผ", - N: "๐™ฝ", - O: "๐™พ", - P: "๐™ฟ", - Q: "๐š€", - R: "๐š", - S: "๐š‚", - T: "๐šƒ", - U: "๐š„", - V: "๐š…", - W: "๐š†", - X: "๐š‡", - Y: "๐šˆ", - Z: "๐š‰", - a: "๐šŠ", - b: "๐š‹", - c: "๐šŒ", - d: "๐š", - e: "๐šŽ", - f: "๐š", - g: "๐š", - h: "๐š‘", - i: "๐š’", - j: "๐š“", - k: "๐š”", - l: "๐š•", - m: "๐š–", - n: "๐š—", - o: "๐š˜", - p: "๐š™", - q: "๐šš", - r: "๐š›", - s: "๐šœ", - t: "๐š", - u: "๐šž", - v: "๐šŸ", - w: "๐š ", - x: "๐šก", - y: "๐šข", - z: "๐šฃ" - }, - doublestruckDict: { - 0: "๐Ÿ˜", - 1: "๐Ÿ™", - 2: "๐Ÿš", - 3: "๐Ÿ›", - 4: "๐Ÿœ", - 5: "๐Ÿ", - 6: "๐Ÿž", - 7: "๐ŸŸ", - 8: "๐Ÿ ", - 9: "๐Ÿก", - A: "๐”ธ", - B: "๐”น", - C: "โ„‚", - D: "๐”ป", - E: "๐”ผ", - F: "๐”ฝ", - G: "๐”พ", - H: "โ„", - I: "๐•€", - J: "๐•", - K: "๐•‚", - L: "๐•ƒ", - M: "๐•„", - N: "โ„•", - O: "๐•†", - P: "โ„™", - Q: "โ„š", - R: "โ„", - S: "๐•Š", - T: "๐•‹", - U: "๐•Œ", - V: "๐•", - W: "๐•Ž", - X: "๐•", - Y: "๐•", - Z: "โ„ค", - a: "๐•’", - b: "๐•“", - c: "๐•”", - d: "๐••", - e: "๐•–", - f: "๐•—", - g: "๐•˜", - h: "๐•™", - i: "๐•š", - j: "๐•›", - k: "๐•œ", - l: "๐•", - m: "๐•ž", - n: "๐•Ÿ", - o: "๐• ", - p: "๐•ก", - q: "๐•ข", - r: "๐•ฃ", - s: "๐•ค", - t: "๐•ฅ", - u: "๐•ฆ", - v: "๐•ง", - w: "๐•จ", - x: "๐•ฉ", - y: "๐•ช", - z: "๐•ซ" - }, - scriptDict: { - A: "๐’œ", - B: "โ„ฌ", - C: "๐’ž", - D: "๐’Ÿ", - E: "โ„ฐ", - F: "โ„ฑ", - G: "๐’ข", - H: "โ„‹", - I: "โ„", - J: "๐’ฅ", - K: "๐’ฆ", - L: "โ„’", - M: "โ„ณ", - N: "๐’ฉ", - O: "๐’ช", - P: "๐’ซ", - Q: "๐’ฌ", - R: "โ„›", - S: "๐’ฎ", - T: "๐’ฏ", - U: "๐’ฐ", - V: "๐’ฑ", - W: "๐’ฒ", - X: "๐’ณ", - Y: "๐’ด", - Z: "๐’ต", - a: "๐’ถ", - b: "๐’ท", - c: "๐’ธ", - d: "๐’น", - e: "โ„ฏ", - f: "๐’ป", - g: "โ„Š", - h: "๐’ฝ", - i: "๐’พ", - j: "๐’ฟ", - k: "๐“€", - l: "๐“", - m: "๐“‚", - n: "๐“ƒ", - o: "โ„ด", - p: "๐“…", - q: "๐“†", - r: "๐“‡", - s: "๐“ˆ", - t: "๐“‰", - u: "๐“Š", - v: "๐“‹", - w: "๐“Œ", - x: "๐“", - y: "๐“Ž", - z: "๐“" - }, - scriptBoldDict: { - A: "๐“", - B: "๐“‘", - C: "๐“’", - D: "๐““", - E: "๐“”", - F: "๐“•", - G: "๐“–", - H: "๐“—", - I: "๐“˜", - J: "๐“™", - K: "๐“š", - L: "๐“›", - M: "๐“œ", - N: "๐“", - O: "๐“ž", - P: "๐“Ÿ", - Q: "๐“ ", - R: "๐“ก", - S: "๐“ข", - T: "๐“ฃ", - U: "๐“ค", - V: "๐“ฅ", - W: "๐“ฆ", - X: "๐“ง", - Y: "๐“จ", - Z: "๐“ฉ", - a: "๐“ช", - b: "๐“ซ", - c: "๐“ฌ", - d: "๐“ญ", - e: "๐“ฎ", - f: "๐“ฏ", - g: "๐“ฐ", - h: "๐“ฑ", - i: "๐“ฒ", - j: "๐“ณ", - k: "๐“ด", - l: "๐“ต", - m: "๐“ถ", - n: "๐“ท", - o: "๐“ธ", - p: "๐“น", - q: "๐“บ", - r: "๐“ป", - s: "๐“ผ", - t: "๐“ฝ", - u: "๐“พ", - v: "๐“ฟ", - w: "๐”€", - x: "๐”", - y: "๐”‚", - z: "๐”ƒ" - }, - circledDict: { - 0: "โ“ช", - 1: "โ‘ ", - 2: "โ‘ก", - 3: "โ‘ข", - 4: "โ‘ฃ", - 5: "โ‘ค", - 6: "โ‘ฅ", - 7: "โ‘ฆ", - 8: "โ‘ง", - 9: "โ‘จ", - A: "โ’ถ", - B: "โ’ท", - C: "โ’ธ", - D: "โ’น", - E: "โ’บ", - F: "โ’ป", - G: "โ’ผ", - H: "โ’ฝ", - I: "โ’พ", - J: "โ’ฟ", - K: "โ“€", - L: "โ“", - M: "โ“‚", - N: "โ“ƒ", - O: "โ“„", - P: "โ“…", - Q: "โ“†", - R: "โ“‡", - S: "โ“ˆ", - T: "โ“‰", - U: "โ“Š", - V: "โ“‹", - W: "โ“Œ", - X: "โ“", - Y: "โ“Ž", - Z: "โ“", - a: "โ“", - b: "โ“‘", - c: "โ“’", - d: "โ““", - e: "โ“”", - f: "โ“•", - g: "โ“–", - h: "โ“—", - i: "โ“˜", - j: "โ“™", - k: "โ“š", - l: "โ“›", - m: "โ“œ", - n: "โ“", - o: "โ“ž", - p: "โ“Ÿ", - q: "โ“ ", - r: "โ“ก", - s: "โ“ข", - t: "โ“ฃ", - u: "โ“ค", - v: "โ“ฅ", - w: "โ“ฆ", - x: "โ“ง", - y: "โ“จ", - z: "โ“ฉ" - }, - cicledBlackDict: { - 0: "โ“ฟ", - 1: "โถ", - 2: "โท", - 3: "โธ", - 4: "โน", - 5: "โบ", - 6: "โป", - 7: "โผ", - 8: "โฝ", - 9: "โพ", - A: "๐Ÿ…", - B: "๐Ÿ…‘", - C: "๐Ÿ…’", - D: "๐Ÿ…“", - E: "๐Ÿ…”", - F: "๐Ÿ…•", - G: "๐Ÿ…–", - H: "๐Ÿ…—", - I: "๐Ÿ…˜", - J: "๐Ÿ…™", - K: "๐Ÿ…š", - L: "๐Ÿ…›", - M: "๐Ÿ…œ", - N: "๐Ÿ…", - O: "๐Ÿ…ž", - P: "๐Ÿ…Ÿ", - Q: "๐Ÿ… ", - R: "๐Ÿ…ก", - S: "๐Ÿ…ข", - T: "๐Ÿ…ฃ", - U: "๐Ÿ…ค", - V: "๐Ÿ…ฅ", - W: "๐Ÿ…ฆ", - X: "๐Ÿ…ง", - Y: "๐Ÿ…จ", - Z: "๐Ÿ…ฉ", - a: "๐Ÿ…", - b: "๐Ÿ…‘", - c: "๐Ÿ…’", - d: "๐Ÿ…“", - e: "๐Ÿ…”", - f: "๐Ÿ…•", - g: "๐Ÿ…–", - h: "๐Ÿ…—", - i: "๐Ÿ…˜", - j: "๐Ÿ…™", - k: "๐Ÿ…š", - l: "๐Ÿ…›", - m: "๐Ÿ…œ", - n: "๐Ÿ…", - o: "๐Ÿ…ž", - p: "๐Ÿ…Ÿ", - q: "๐Ÿ… ", - r: "๐Ÿ…ก", - s: "๐Ÿ…ข", - t: "๐Ÿ…ฃ", - u: "๐Ÿ…ค", - v: "๐Ÿ…ฅ", - w: "๐Ÿ…ฆ", - x: "๐Ÿ…ง", - y: "๐Ÿ…จ", - z: "๐Ÿ…ฉ" - }, - squaredDict: { - A: "๐Ÿ„ฐ", - B: "๐Ÿ„ฑ", - C: "๐Ÿ„ฒ", - D: "๐Ÿ„ณ", - E: "๐Ÿ„ด", - F: "๐Ÿ„ต", - G: "๐Ÿ„ถ", - H: "๐Ÿ„ท", - I: "๐Ÿ„ธ", - J: "๐Ÿ„น", - K: "๐Ÿ„บ", - L: "๐Ÿ„ป", - M: "๐Ÿ„ผ", - N: "๐Ÿ„ฝ", - O: "๐Ÿ„พ", - P: "๐Ÿ„ฟ", - Q: "๐Ÿ…€", - R: "๐Ÿ…", - S: "๐Ÿ…‚", - T: "๐Ÿ…ƒ", - U: "๐Ÿ…„", - V: "๐Ÿ……", - W: "๐Ÿ…†", - X: "๐Ÿ…‡", - Y: "๐Ÿ…ˆ", - Z: "๐Ÿ…‰", - a: "๐Ÿ„ฐ", - b: "๐Ÿ„ฑ", - c: "๐Ÿ„ฒ", - d: "๐Ÿ„ณ", - e: "๐Ÿ„ด", - f: "๐Ÿ„ต", - g: "๐Ÿ„ถ", - h: "๐Ÿ„ท", - i: "๐Ÿ„ธ", - j: "๐Ÿ„น", - k: "๐Ÿ„บ", - l: "๐Ÿ„ป", - m: "๐Ÿ„ผ", - n: "๐Ÿ„ฝ", - o: "๐Ÿ„พ", - p: "๐Ÿ„ฟ", - q: "๐Ÿ…€", - r: "๐Ÿ…", - s: "๐Ÿ…‚", - t: "๐Ÿ…ƒ", - u: "๐Ÿ…„", - v: "๐Ÿ……", - w: "๐Ÿ…†", - x: "๐Ÿ…‡", - y: "๐Ÿ…ˆ", - z: "๐Ÿ…‰" - }, - squaredBlackDict: { - A: "๐Ÿ…ฐ", - B: "๐Ÿ…ฑ", - C: "๐Ÿ…ฒ", - D: "๐Ÿ…ณ", - E: "๐Ÿ…ด", - F: "๐Ÿ…ต", - G: "๐Ÿ…ถ", - H: "๐Ÿ…ท", - I: "๐Ÿ…ธ", - J: "๐Ÿ…น", - K: "๐Ÿ…บ", - L: "๐Ÿ…ป", - M: "๐Ÿ…ผ", - N: "๐Ÿ…ฝ", - O: "๐Ÿ…พ", - P: "๐Ÿ…ฟ", - Q: "๐Ÿ†€", - R: "๐Ÿ†", - S: "๐Ÿ†‚", - T: "๐Ÿ†ƒ", - U: "๐Ÿ†„", - V: "๐Ÿ†…", - W: "๐Ÿ††", - X: "๐Ÿ†‡", - Y: "๐Ÿ†ˆ", - Z: "๐Ÿ†‰", - a: "๐Ÿ…ฐ", - b: "๐Ÿ…ฑ", - c: "๐Ÿ…ฒ", - d: "๐Ÿ…ณ", - e: "๐Ÿ…ด", - f: "๐Ÿ…ต", - g: "๐Ÿ…ถ", - h: "๐Ÿ…ท", - i: "๐Ÿ…ธ", - j: "๐Ÿ…น", - k: "๐Ÿ…บ", - l: "๐Ÿ…ป", - m: "๐Ÿ…ผ", - n: "๐Ÿ…ฝ", - o: "๐Ÿ…พ", - p: "๐Ÿ…ฟ", - q: "๐Ÿ†€", - r: "๐Ÿ†", - s: "๐Ÿ†‚", - t: "๐Ÿ†ƒ", - u: "๐Ÿ†„", - v: "๐Ÿ†…", - w: "๐Ÿ††", - x: "๐Ÿ†‡", - y: "๐Ÿ†ˆ", - z: "๐Ÿ†‰" - }, - serifBoldDict: { - 0: "๐ŸŽ", - 1: "๐Ÿ", - 2: "๐Ÿ", - 3: "๐Ÿ‘", - 4: "๐Ÿ’", - 5: "๐Ÿ“", - 6: "๐Ÿ”", - 7: "๐Ÿ•", - 8: "๐Ÿ–", - 9: "๐Ÿ—", - A: "๐€", - B: "๐", - C: "๐‚", - D: "๐ƒ", - E: "๐„", - F: "๐…", - G: "๐†", - H: "๐‡", - I: "๐ˆ", - J: "๐‰", - K: "๐Š", - L: "๐‹", - M: "๐Œ", - N: "๐", - O: "๐Ž", - P: "๐", - Q: "๐", - R: "๐‘", - S: "๐’", - T: "๐“", - U: "๐”", - V: "๐•", - W: "๐–", - X: "๐—", - Y: "๐˜", - Z: "๐™", - a: "๐š", - b: "๐›", - c: "๐œ", - d: "๐", - e: "๐ž", - f: "๐Ÿ", - g: "๐ ", - h: "๐ก", - i: "๐ข", - j: "๐ฃ", - k: "๐ค", - l: "๐ฅ", - m: "๐ฆ", - n: "๐ง", - o: "๐จ", - p: "๐ฉ", - q: "๐ช", - r: "๐ซ", - s: "๐ฌ", - t: "๐ญ", - u: "๐ฎ", - v: "๐ฏ", - w: "๐ฐ", - x: "๐ฑ", - y: "๐ฒ", - z: "๐ณ" - }, - serifBoldItalicDict: { - A: "๐‘จ", - B: "๐‘ฉ", - C: "๐‘ช", - D: "๐‘ซ", - E: "๐‘ฌ", - F: "๐‘ญ", - G: "๐‘ฎ", - H: "๐‘ฏ", - I: "๐‘ฐ", - J: "๐‘ฑ", - K: "๐‘ฒ", - L: "๐‘ณ", - M: "๐‘ด", - N: "๐‘ต", - O: "๐‘ถ", - P: "๐‘ท", - Q: "๐‘ธ", - R: "๐‘น", - S: "๐‘บ", - T: "๐‘ป", - U: "๐‘ผ", - V: "๐‘ฝ", - W: "๐‘พ", - X: "๐‘ฟ", - Y: "๐’€", - Z: "๐’", - a: "๐’‚", - b: "๐’ƒ", - c: "๐’„", - d: "๐’…", - e: "๐’†", - f: "๐’‡", - g: "๐’ˆ", - h: "๐’‰", - i: "๐’Š", - j: "๐’‹", - k: "๐’Œ", - l: "๐’", - m: "๐’Ž", - n: "๐’", - o: "๐’", - p: "๐’‘", - q: "๐’’", - r: "๐’“", - s: "๐’”", - t: "๐’•", - u: "๐’–", - v: "๐’—", - w: "๐’˜", - x: "๐’™", - y: "๐’š", - z: "๐’›" - }, - sansDict: { - 0: "๐Ÿข", - 1: "๐Ÿฃ", - 2: "๐Ÿค", - 3: "๐Ÿฅ", - 4: "๐Ÿฆ", - 5: "๐Ÿง", - 6: "๐Ÿจ", - 7: "๐Ÿฉ", - 8: "๐Ÿช", - 9: "๐Ÿซ", - A: "๐– ", - B: "๐–ก", - C: "๐–ข", - D: "๐–ฃ", - E: "๐–ค", - F: "๐–ฅ", - G: "๐–ฆ", - H: "๐–ง", - I: "๐–จ", - J: "๐–ฉ", - K: "๐–ช", - L: "๐–ซ", - M: "๐–ฌ", - N: "๐–ญ", - O: "๐–ฎ", - P: "๐–ฏ", - Q: "๐–ฐ", - R: "๐–ฑ", - S: "๐–ฒ", - T: "๐–ณ", - U: "๐–ด", - V: "๐–ต", - W: "๐–ถ", - X: "๐–ท", - Y: "๐–ธ", - Z: "๐–น", - a: "๐–บ", - b: "๐–ป", - c: "๐–ผ", - d: "๐–ฝ", - e: "๐–พ", - f: "๐–ฟ", - g: "๐—€", - h: "๐—", - i: "๐—‚", - j: "๐—ƒ", - k: "๐—„", - l: "๐—…", - m: "๐—†", - n: "๐—‡", - o: "๐—ˆ", - p: "๐—‰", - q: "๐—Š", - r: "๐—‹", - s: "๐—Œ", - t: "๐—", - u: "๐—Ž", - v: "๐—", - w: "๐—", - x: "๐—‘", - y: "๐—’", - z: "๐—“" - }, - sansBoldDict: { - 0: "๐Ÿฌ", - 1: "๐Ÿญ", - 2: "๐Ÿฎ", - 3: "๐Ÿฏ", - 4: "๐Ÿฐ", - 5: "๐Ÿฑ", - 6: "๐Ÿฒ", - 7: "๐Ÿณ", - 8: "๐Ÿด", - 9: "๐Ÿต", - A: "๐—”", - B: "๐—•", - C: "๐—–", - D: "๐——", - E: "๐—˜", - F: "๐—™", - G: "๐—š", - H: "๐—›", - I: "๐—œ", - J: "๐—", - K: "๐—ž", - L: "๐—Ÿ", - M: "๐— ", - N: "๐—ก", - O: "๐—ข", - P: "๐—ฃ", - Q: "๐—ค", - R: "๐—ฅ", - S: "๐—ฆ", - T: "๐—ง", - U: "๐—จ", - V: "๐—ฉ", - W: "๐—ช", - X: "๐—ซ", - Y: "๐—ฌ", - Z: "๐—ญ", - a: "๐—ฎ", - b: "๐—ฏ", - c: "๐—ฐ", - d: "๐—ฑ", - e: "๐—ฒ", - f: "๐—ณ", - g: "๐—ด", - h: "๐—ต", - i: "๐—ถ", - j: "๐—ท", - k: "๐—ธ", - l: "๐—น", - m: "๐—บ", - n: "๐—ป", - o: "๐—ผ", - p: "๐—ฝ", - q: "๐—พ", - r: "๐—ฟ", - s: "๐˜€", - t: "๐˜", - u: "๐˜‚", - v: "๐˜ƒ", - w: "๐˜„", - x: "๐˜…", - y: "๐˜†", - z: "๐˜‡" - }, - sansItalicDict: { - A: "๐˜ˆ", - B: "๐˜‰", - C: "๐˜Š", - D: "๐˜‹", - E: "๐˜Œ", - F: "๐˜", - G: "๐˜Ž", - H: "๐˜", - I: "๐˜", - J: "๐˜‘", - K: "๐˜’", - L: "๐˜“", - M: "๐˜”", - N: "๐˜•", - O: "๐˜–", - P: "๐˜—", - Q: "๐˜˜", - R: "๐˜™", - S: "๐˜š", - T: "๐˜›", - U: "๐˜œ", - V: "๐˜", - W: "๐˜ž", - X: "๐˜Ÿ", - Y: "๐˜ ", - Z: "๐˜ก", - a: "๐˜ข", - b: "๐˜ฃ", - c: "๐˜ค", - d: "๐˜ฅ", - e: "๐˜ฆ", - f: "๐˜ง", - g: "๐˜จ", - h: "๐˜ฉ", - i: "๐˜ช", - j: "๐˜ซ", - k: "๐˜ฌ", - l: "๐˜ญ", - m: "๐˜ฎ", - n: "๐˜ฏ", - o: "๐˜ฐ", - p: "๐˜ฑ", - q: "๐˜ฒ", - r: "๐˜ณ", - s: "๐˜ด", - t: "๐˜ต", - u: "๐˜ถ", - v: "๐˜ท", - w: "๐˜ธ", - x: "๐˜น", - y: "๐˜บ", - z: "๐˜ป" - }, - sansBoldItalicDict: { - A: "๐˜ผ", - B: "๐˜ฝ", - C: "๐˜พ", - D: "๐˜ฟ", - E: "๐™€", - F: "๐™", - G: "๐™‚", - H: "๐™ƒ", - I: "๐™„", - J: "๐™…", - K: "๐™†", - L: "๐™‡", - M: "๐™ˆ", - N: "๐™‰", - O: "๐™Š", - P: "๐™‹", - Q: "๐™Œ", - R: "๐™", - S: "๐™Ž", - T: "๐™", - U: "๐™", - V: "๐™‘", - W: "๐™’", - X: "๐™“", - Y: "๐™”", - Z: "๐™•", - a: "๐™–", - b: "๐™—", - c: "๐™˜", - d: "๐™™", - e: "๐™š", - f: "๐™›", - g: "๐™œ", - h: "๐™", - i: "๐™ž", - j: "๐™Ÿ", - k: "๐™ ", - l: "๐™ก", - m: "๐™ข", - n: "๐™ฃ", - o: "๐™ค", - p: "๐™ฅ", - q: "๐™ฆ", - r: "๐™ง", - s: "๐™จ", - t: "๐™ฉ", - u: "๐™ช", - v: "๐™ซ", - w: "๐™ฌ", - x: "๐™ญ", - y: "๐™ฎ", - z: "๐™ฏ" - } -} - -export function ConvertRichUnicode (text, mode) { - let dict; - switch (mode) { - case 'circledBlack': - dict = convertMap.cicledBlackDict; - break; - case 'circled': - dict = convertMap.circledDict; - break; - case 'doublestruck': - dict = convertMap.doublestruckDict; - break; - case 'frakturBold': - dict = convertMap.frakturBoldDict; - break; - case 'fraktur': - dict = convertMap.frakturDict; - break; - case 'monospace': - dict = convertMap.monospaceDict; - break; - case 'sansBold': - dict = convertMap.sansBoldDict; - break; - case 'sansBoldItalic': - dict = convertMap.sansBoldItalicDict; - break; - case 'sans': - dict = convertMap.sansDict; - break; - case 'sansItalic': - dict = convertMap.sansItalicDict; - break; - case 'scriptBold': - dict = convertMap.scriptBoldDict; - break; - case 'script': - dict = convertMap.scriptDict; - break; - case 'serifBold': - dict = convertMap.serifBoldDict; - break; - case 'serifBoldItalic': - dict = convertMap.serifBoldItalicDict; - break; - case 'squaredBlack': - dict = convertMap.squaredBlackDict; - break; - case 'squared': - dict = convertMap.squaredDict; - break; - default: - return text; - } - let newText = ''; - for (let i = 0; i < text.length; i++) { - const char = text.charAt(i); - newText += dict[char] || char; - } - return newText; -} diff --git a/frontend/src/topping/unicode.test.ts b/frontend/src/topping/unicode.test.ts new file mode 100644 index 0000000..3779369 --- /dev/null +++ b/frontend/src/topping/unicode.test.ts @@ -0,0 +1,26 @@ +import { expect, test, describe } from 'vitest' +import { ConvertRichUnicode } from "./unicode"; + +describe.each([ + { mode: 'circled', expected: 'โ’ฝโ“”โ“›โ“›โ“ž โ“Œโ“žโ“กโ“›โ““!' }, + { mode: 'doublestruck', expected: 'โ„๐•–๐•๐•๐•  ๐•Ž๐• ๐•ฃ๐•๐••!' }, + { mode: 'frakturBold', expected: '๐•ณ๐–Š๐–‘๐–‘๐–” ๐–‚๐–”๐–—๐–‘๐–‰!' }, + { mode: 'fraktur', expected: 'โ„Œ๐”ข๐”ฉ๐”ฉ๐”ฌ ๐”š๐”ฌ๐”ฏ๐”ฉ๐”ก!' }, + { mode: 'monospace', expected: '๐™ท๐šŽ๐š•๐š•๐š˜ ๐š†๐š˜๐š›๐š•๐š!' }, + { mode: 'sansBold', expected: '๐—›๐—ฒ๐—น๐—น๐—ผ ๐—ช๐—ผ๐—ฟ๐—น๐—ฑ!' }, + { mode: 'sansBoldItalic', expected: '๐™ƒ๐™š๐™ก๐™ก๐™ค ๐™’๐™ค๐™ง๐™ก๐™™!' }, + { mode: 'sans', expected: '๐–ง๐–พ๐—…๐—…๐—ˆ ๐–ถ๐—ˆ๐—‹๐—…๐–ฝ!' }, + { mode: 'sansItalic', expected: '๐˜๐˜ฆ๐˜ญ๐˜ญ๐˜ฐ ๐˜ž๐˜ฐ๐˜ณ๐˜ญ๐˜ฅ!' }, + { mode: 'scriptBold', expected: '๐“—๐“ฎ๐“ต๐“ต๐“ธ ๐“ฆ๐“ธ๐“ป๐“ต๐“ญ!' }, + { mode: 'script', expected: 'โ„‹โ„ฏ๐“๐“โ„ด ๐’ฒโ„ด๐“‡๐“๐’น!' }, + { mode: 'serifBold', expected: '๐‡๐ž๐ฅ๐ฅ๐จ ๐–๐จ๐ซ๐ฅ๐!' }, + { mode: 'serifBoldItalic', expected: '๐‘ฏ๐’†๐’๐’๐’ ๐‘พ๐’๐’“๐’๐’…!' }, + { mode: 'squaredBlack', expected: '๐Ÿ…ท๐Ÿ…ด๐Ÿ…ป๐Ÿ…ป๐Ÿ…พ ๐Ÿ††๐Ÿ…พ๐Ÿ†๐Ÿ…ป๐Ÿ…ณ!' }, + { mode: 'squared', expected: '๐Ÿ„ท๐Ÿ„ด๐Ÿ„ป๐Ÿ„ป๐Ÿ„พ ๐Ÿ…†๐Ÿ„พ๐Ÿ…๐Ÿ„ป๐Ÿ„ณ!' }, +])('ConvertRichUnicode("Hello World!", $mode) returns $expected', ({ mode, expected }) => { + const base = 'Hello World!' + test(`returns ${expected}`, () => { + expect(ConvertRichUnicode(base, mode)).toBe(expected) + + }) +}) diff --git a/frontend/src/topping/unicode.ts b/frontend/src/topping/unicode.ts new file mode 100644 index 0000000..2c0957b --- /dev/null +++ b/frontend/src/topping/unicode.ts @@ -0,0 +1,1000 @@ +const convertMap = { + frakturDict: new Map([ + ["A", "๐”„"], + ["B", "๐”…"], + ["C", "โ„ญ"], + ["D", "๐”‡"], + ["E", "๐”ˆ"], + ["F", "๐”‰"], + ["G", "๐”Š"], + ["H", "โ„Œ"], + ["I", "โ„‘"], + ["J", "๐”"], + ["K", "๐”Ž"], + ["L", "๐”"], + ["M", "๐”"], + ["N", "๐”‘"], + ["O", "๐”’"], + ["P", "๐”“"], + ["Q", "๐””"], + ["R", "โ„œ"], + ["S", "๐”–"], + ["T", "๐”—"], + ["U", "๐”˜"], + ["V", "๐”™"], + ["W", "๐”š"], + ["X", "๐”›"], + ["Y", "๐”œ"], + ["Z", "โ„จ"], + ["a", "๐”ž"], + ["b", "๐”Ÿ"], + ["c", "๐” "], + ["d", "๐”ก"], + ["e", "๐”ข"], + ["f", "๐”ฃ"], + ["g", "๐”ค"], + ["h", "๐”ฅ"], + ["i", "๐”ฆ"], + ["j", "๐”ง"], + ["k", "๐”จ"], + ["l", "๐”ฉ"], + ["m", "๐”ช"], + ["n", "๐”ซ"], + ["o", "๐”ฌ"], + ["p", "๐”ญ"], + ["q", "๐”ฎ"], + ["r", "๐”ฏ"], + ["s", "๐”ฐ"], + ["t", "๐”ฑ"], + ["u", "๐”ฒ"], + ["v", "๐”ณ"], + ["w", "๐”ด"], + ["x", "๐”ต"], + ["y", "๐”ถ"], + ["z", "๐”ท"] + ]), + frakturBoldDict: new Map([ + ["A", "๐•ฌ"], + ["B", "๐•ญ"], + ["C", "๐•ฎ"], + ["D", "๐•ฏ"], + ["E", "๐•ฐ"], + ["F", "๐•ฑ"], + ["G", "๐•ฒ"], + ["H", "๐•ณ"], + ["I", "๐•ด"], + ["J", "๐•ต"], + ["K", "๐•ถ"], + ["L", "๐•ท"], + ["M", "๐•ธ"], + ["N", "๐•น"], + ["O", "๐•บ"], + ["P", "๐•ป"], + ["Q", "๐•ผ"], + ["R", "๐•ฝ"], + ["S", "๐•พ"], + ["T", "๐•ฟ"], + ["U", "๐–€"], + ["V", "๐–"], + ["W", "๐–‚"], + ["X", "๐–ƒ"], + ["Y", "๐–„"], + ["Z", "๐–…"], + ["a", "๐–†"], + ["b", "๐–‡"], + ["c", "๐–ˆ"], + ["d", "๐–‰"], + ["e", "๐–Š"], + ["f", "๐–‹"], + ["g", "๐–Œ"], + ["h", "๐–"], + ["i", "๐–Ž"], + ["j", "๐–"], + ["k", "๐–"], + ["l", "๐–‘"], + ["m", "๐–’"], + ["n", "๐–“"], + ["o", "๐–”"], + ["p", "๐–•"], + ["q", "๐––"], + ["r", "๐–—"], + ["s", "๐–˜"], + ["t", "๐–™"], + ["u", "๐–š"], + ["v", "๐–›"], + ["w", "๐–œ"], + ["x", "๐–"], + ["y", "๐–ž"], + ["z", "๐–Ÿ"] + ]), + monospaceDict: new Map([ + ["0", "๐Ÿถ"], + ["1", "๐Ÿท"], + ["2", "๐Ÿธ"], + ["3", "๐Ÿน"], + ["4", "๐Ÿบ"], + ["5", "๐Ÿป"], + ["6", "๐Ÿผ"], + ["7", "๐Ÿฝ"], + ["8", "๐Ÿพ"], + ["9", "๐Ÿฟ"], + ["A", "๐™ฐ"], + ["B", "๐™ฑ"], + ["C", "๐™ฒ"], + ["D", "๐™ณ"], + ["E", "๐™ด"], + ["F", "๐™ต"], + ["G", "๐™ถ"], + ["H", "๐™ท"], + ["I", "๐™ธ"], + ["J", "๐™น"], + ["K", "๐™บ"], + ["L", "๐™ป"], + ["M", "๐™ผ"], + ["N", "๐™ฝ"], + ["O", "๐™พ"], + ["P", "๐™ฟ"], + ["Q", "๐š€"], + ["R", "๐š"], + ["S", "๐š‚"], + ["T", "๐šƒ"], + ["U", "๐š„"], + ["V", "๐š…"], + ["W", "๐š†"], + ["X", "๐š‡"], + ["Y", "๐šˆ"], + ["Z", "๐š‰"], + ["a", "๐šŠ"], + ["b", "๐š‹"], + ["c", "๐šŒ"], + ["d", "๐š"], + ["e", "๐šŽ"], + ["f", "๐š"], + ["g", "๐š"], + ["h", "๐š‘"], + ["i", "๐š’"], + ["j", "๐š“"], + ["k", "๐š”"], + ["l", "๐š•"], + ["m", "๐š–"], + ["n", "๐š—"], + ["o", "๐š˜"], + ["p", "๐š™"], + ["q", "๐šš"], + ["r", "๐š›"], + ["s", "๐šœ"], + ["t", "๐š"], + ["u", "๐šž"], + ["v", "๐šŸ"], + ["w", "๐š "], + ["x", "๐šก"], + ["y", "๐šข"], + ["z", "๐šฃ"] + ]), + doublestruckDict: new Map([ + ["0", "๐Ÿ˜"], + ["1", "๐Ÿ™"], + ["2", "๐Ÿš"], + ["3", "๐Ÿ›"], + ["4", "๐Ÿœ"], + ["5", "๐Ÿ"], + ["6", "๐Ÿž"], + ["7", "๐ŸŸ"], + ["8", "๐Ÿ "], + ["9", "๐Ÿก"], + ["A", "๐”ธ"], + ["B", "๐”น"], + ["C", "โ„‚"], + ["D", "๐”ป"], + ["E", "๐”ผ"], + ["F", "๐”ฝ"], + ["G", "๐”พ"], + ["H", "โ„"], + ["I", "๐•€"], + ["J", "๐•"], + ["K", "๐•‚"], + ["L", "๐•ƒ"], + ["M", "๐•„"], + ["N", "โ„•"], + ["O", "๐•†"], + ["P", "โ„™"], + ["Q", "โ„š"], + ["R", "โ„"], + ["S", "๐•Š"], + ["T", "๐•‹"], + ["U", "๐•Œ"], + ["V", "๐•"], + ["W", "๐•Ž"], + ["X", "๐•"], + ["Y", "๐•"], + ["Z", "โ„ค"], + ["a", "๐•’"], + ["b", "๐•“"], + ["c", "๐•”"], + ["d", "๐••"], + ["e", "๐•–"], + ["f", "๐•—"], + ["g", "๐•˜"], + ["h", "๐•™"], + ["i", "๐•š"], + ["j", "๐•›"], + ["k", "๐•œ"], + ["l", "๐•"], + ["m", "๐•ž"], + ["n", "๐•Ÿ"], + ["o", "๐• "], + ["p", "๐•ก"], + ["q", "๐•ข"], + ["r", "๐•ฃ"], + ["s", "๐•ค"], + ["t", "๐•ฅ"], + ["u", "๐•ฆ"], + ["v", "๐•ง"], + ["w", "๐•จ"], + ["x", "๐•ฉ"], + ["y", "๐•ช"], + ["z", "๐•ซ"] + ]), + scriptDict: new Map([ + ["A", "๐’œ"], + ["B", "โ„ฌ"], + ["C", "๐’ž"], + ["D", "๐’Ÿ"], + ["E", "โ„ฐ"], + ["F", "โ„ฑ"], + ["G", "๐’ข"], + ["H", "โ„‹"], + ["I", "โ„"], + ["J", "๐’ฅ"], + ["K", "๐’ฆ"], + ["L", "โ„’"], + ["M", "โ„ณ"], + ["N", "๐’ฉ"], + ["O", "๐’ช"], + ["P", "๐’ซ"], + ["Q", "๐’ฌ"], + ["R", "โ„›"], + ["S", "๐’ฎ"], + ["T", "๐’ฏ"], + ["U", "๐’ฐ"], + ["V", "๐’ฑ"], + ["W", "๐’ฒ"], + ["X", "๐’ณ"], + ["Y", "๐’ด"], + ["Z", "๐’ต"], + ["a", "๐’ถ"], + ["b", "๐’ท"], + ["c", "๐’ธ"], + ["d", "๐’น"], + ["e", "โ„ฏ"], + ["f", "๐’ป"], + ["g", "โ„Š"], + ["h", "๐’ฝ"], + ["i", "๐’พ"], + ["j", "๐’ฟ"], + ["k", "๐“€"], + ["l", "๐“"], + ["m", "๐“‚"], + ["n", "๐“ƒ"], + ["o", "โ„ด"], + ["p", "๐“…"], + ["q", "๐“†"], + ["r", "๐“‡"], + ["s", "๐“ˆ"], + ["t", "๐“‰"], + ["u", "๐“Š"], + ["v", "๐“‹"], + ["w", "๐“Œ"], + ["x", "๐“"], + ["y", "๐“Ž"], + ["z", "๐“"] + ]), + scriptBoldDict: new Map([ + ["A", "๐“"], + ["B", "๐“‘"], + ["C", "๐“’"], + ["D", "๐““"], + ["E", "๐“”"], + ["F", "๐“•"], + ["G", "๐“–"], + ["H", "๐“—"], + ["I", "๐“˜"], + ["J", "๐“™"], + ["K", "๐“š"], + ["L", "๐“›"], + ["M", "๐“œ"], + ["N", "๐“"], + ["O", "๐“ž"], + ["P", "๐“Ÿ"], + ["Q", "๐“ "], + ["R", "๐“ก"], + ["S", "๐“ข"], + ["T", "๐“ฃ"], + ["U", "๐“ค"], + ["V", "๐“ฅ"], + ["W", "๐“ฆ"], + ["X", "๐“ง"], + ["Y", "๐“จ"], + ["Z", "๐“ฉ"], + ["a", "๐“ช"], + ["b", "๐“ซ"], + ["c", "๐“ฌ"], + ["d", "๐“ญ"], + ["e", "๐“ฎ"], + ["f", "๐“ฏ"], + ["g", "๐“ฐ"], + ["h", "๐“ฑ"], + ["i", "๐“ฒ"], + ["j", "๐“ณ"], + ["k", "๐“ด"], + ["l", "๐“ต"], + ["m", "๐“ถ"], + ["n", "๐“ท"], + ["o", "๐“ธ"], + ["p", "๐“น"], + ["q", "๐“บ"], + ["r", "๐“ป"], + ["s", "๐“ผ"], + ["t", "๐“ฝ"], + ["u", "๐“พ"], + ["v", "๐“ฟ"], + ["w", "๐”€"], + ["x", "๐”"], + ["y", "๐”‚"], + ["z", "๐”ƒ"] + ]), + circledDict: new Map([ + ["0", "โ“ช"], + ["1", "โ‘ "], + ["2", "โ‘ก"], + ["3", "โ‘ข"], + ["4", "โ‘ฃ"], + ["5", "โ‘ค"], + ["6", "โ‘ฅ"], + ["7", "โ‘ฆ"], + ["8", "โ‘ง"], + ["9", "โ‘จ"], + ["A", "โ’ถ"], + ["B", "โ’ท"], + ["C", "โ’ธ"], + ["D", "โ’น"], + ["E", "โ’บ"], + ["F", "โ’ป"], + ["G", "โ’ผ"], + ["H", "โ’ฝ"], + ["I", "โ’พ"], + ["J", "โ’ฟ"], + ["K", "โ“€"], + ["L", "โ“"], + ["M", "โ“‚"], + ["N", "โ“ƒ"], + ["O", "โ“„"], + ["P", "โ“…"], + ["Q", "โ“†"], + ["R", "โ“‡"], + ["S", "โ“ˆ"], + ["T", "โ“‰"], + ["U", "โ“Š"], + ["V", "โ“‹"], + ["W", "โ“Œ"], + ["X", "โ“"], + ["Y", "โ“Ž"], + ["Z", "โ“"], + ["a", "โ“"], + ["b", "โ“‘"], + ["c", "โ“’"], + ["d", "โ““"], + ["e", "โ“”"], + ["f", "โ“•"], + ["g", "โ“–"], + ["h", "โ“—"], + ["i", "โ“˜"], + ["j", "โ“™"], + ["k", "โ“š"], + ["l", "โ“›"], + ["m", "โ“œ"], + ["n", "โ“"], + ["o", "โ“ž"], + ["p", "โ“Ÿ"], + ["q", "โ“ "], + ["r", "โ“ก"], + ["s", "โ“ข"], + ["t", "โ“ฃ"], + ["u", "โ“ค"], + ["v", "โ“ฅ"], + ["w", "โ“ฆ"], + ["x", "โ“ง"], + ["y", "โ“จ"], + ["z", "โ“ฉ"] + ]), + cicledBlackDict: new Map([ + ["0", "โ“ฟ"], + ["1", "โถ"], + ["2", "โท"], + ["3", "โธ"], + ["4", "โน"], + ["5", "โบ"], + ["6", "โป"], + ["7", "โผ"], + ["8", "โฝ"], + ["9", "โพ"], + ["A", "๐Ÿ…"], + ["B", "๐Ÿ…‘"], + ["C", "๐Ÿ…’"], + ["D", "๐Ÿ…“"], + ["E", "๐Ÿ…”"], + ["F", "๐Ÿ…•"], + ["G", "๐Ÿ…–"], + ["H", "๐Ÿ…—"], + ["I", "๐Ÿ…˜"], + ["J", "๐Ÿ…™"], + ["K", "๐Ÿ…š"], + ["L", "๐Ÿ…›"], + ["M", "๐Ÿ…œ"], + ["N", "๐Ÿ…"], + ["O", "๐Ÿ…ž"], + ["P", "๐Ÿ…Ÿ"], + ["Q", "๐Ÿ… "], + ["R", "๐Ÿ…ก"], + ["S", "๐Ÿ…ข"], + ["T", "๐Ÿ…ฃ"], + ["U", "๐Ÿ…ค"], + ["V", "๐Ÿ…ฅ"], + ["W", "๐Ÿ…ฆ"], + ["X", "๐Ÿ…ง"], + ["Y", "๐Ÿ…จ"], + ["Z", "๐Ÿ…ฉ"], + ["a", "๐Ÿ…"], + ["b", "๐Ÿ…‘"], + ["c", "๐Ÿ…’"], + ["d", "๐Ÿ…“"], + ["e", "๐Ÿ…”"], + ["f", "๐Ÿ…•"], + ["g", "๐Ÿ…–"], + ["h", "๐Ÿ…—"], + ["i", "๐Ÿ…˜"], + ["j", "๐Ÿ…™"], + ["k", "๐Ÿ…š"], + ["l", "๐Ÿ…›"], + ["m", "๐Ÿ…œ"], + ["n", "๐Ÿ…"], + ["o", "๐Ÿ…ž"], + ["p", "๐Ÿ…Ÿ"], + ["q", "๐Ÿ… "], + ["r", "๐Ÿ…ก"], + ["s", "๐Ÿ…ข"], + ["t", "๐Ÿ…ฃ"], + ["u", "๐Ÿ…ค"], + ["v", "๐Ÿ…ฅ"], + ["w", "๐Ÿ…ฆ"], + ["x", "๐Ÿ…ง"], + ["y", "๐Ÿ…จ"], + ["z", "๐Ÿ…ฉ"] + ]), + squaredDict: new Map([ + ["A", "๐Ÿ„ฐ"], + ["B", "๐Ÿ„ฑ"], + ["C", "๐Ÿ„ฒ"], + ["D", "๐Ÿ„ณ"], + ["E", "๐Ÿ„ด"], + ["F", "๐Ÿ„ต"], + ["G", "๐Ÿ„ถ"], + ["H", "๐Ÿ„ท"], + ["I", "๐Ÿ„ธ"], + ["J", "๐Ÿ„น"], + ["K", "๐Ÿ„บ"], + ["L", "๐Ÿ„ป"], + ["M", "๐Ÿ„ผ"], + ["N", "๐Ÿ„ฝ"], + ["O", "๐Ÿ„พ"], + ["P", "๐Ÿ„ฟ"], + ["Q", "๐Ÿ…€"], + ["R", "๐Ÿ…"], + ["S", "๐Ÿ…‚"], + ["T", "๐Ÿ…ƒ"], + ["U", "๐Ÿ…„"], + ["V", "๐Ÿ……"], + ["W", "๐Ÿ…†"], + ["X", "๐Ÿ…‡"], + ["Y", "๐Ÿ…ˆ"], + ["Z", "๐Ÿ…‰"], + ["a", "๐Ÿ„ฐ"], + ["b", "๐Ÿ„ฑ"], + ["c", "๐Ÿ„ฒ"], + ["d", "๐Ÿ„ณ"], + ["e", "๐Ÿ„ด"], + ["f", "๐Ÿ„ต"], + ["g", "๐Ÿ„ถ"], + ["h", "๐Ÿ„ท"], + ["i", "๐Ÿ„ธ"], + ["j", "๐Ÿ„น"], + ["k", "๐Ÿ„บ"], + ["l", "๐Ÿ„ป"], + ["m", "๐Ÿ„ผ"], + ["n", "๐Ÿ„ฝ"], + ["o", "๐Ÿ„พ"], + ["p", "๐Ÿ„ฟ"], + ["q", "๐Ÿ…€"], + ["r", "๐Ÿ…"], + ["s", "๐Ÿ…‚"], + ["t", "๐Ÿ…ƒ"], + ["u", "๐Ÿ…„"], + ["v", "๐Ÿ……"], + ["w", "๐Ÿ…†"], + ["x", "๐Ÿ…‡"], + ["y", "๐Ÿ…ˆ"], + ["z", "๐Ÿ…‰"] + ]), + squaredBlackDict: new Map([ + ["A", "๐Ÿ…ฐ"], + ["B", "๐Ÿ…ฑ"], + ["C", "๐Ÿ…ฒ"], + ["D", "๐Ÿ…ณ"], + ["E", "๐Ÿ…ด"], + ["F", "๐Ÿ…ต"], + ["G", "๐Ÿ…ถ"], + ["H", "๐Ÿ…ท"], + ["I", "๐Ÿ…ธ"], + ["J", "๐Ÿ…น"], + ["K", "๐Ÿ…บ"], + ["L", "๐Ÿ…ป"], + ["M", "๐Ÿ…ผ"], + ["N", "๐Ÿ…ฝ"], + ["O", "๐Ÿ…พ"], + ["P", "๐Ÿ…ฟ"], + ["Q", "๐Ÿ†€"], + ["R", "๐Ÿ†"], + ["S", "๐Ÿ†‚"], + ["T", "๐Ÿ†ƒ"], + ["U", "๐Ÿ†„"], + ["V", "๐Ÿ†…"], + ["W", "๐Ÿ††"], + ["X", "๐Ÿ†‡"], + ["Y", "๐Ÿ†ˆ"], + ["Z", "๐Ÿ†‰"], + ["a", "๐Ÿ…ฐ"], + ["b", "๐Ÿ…ฑ"], + ["c", "๐Ÿ…ฒ"], + ["d", "๐Ÿ…ณ"], + ["e", "๐Ÿ…ด"], + ["f", "๐Ÿ…ต"], + ["g", "๐Ÿ…ถ"], + ["h", "๐Ÿ…ท"], + ["i", "๐Ÿ…ธ"], + ["j", "๐Ÿ…น"], + ["k", "๐Ÿ…บ"], + ["l", "๐Ÿ…ป"], + ["m", "๐Ÿ…ผ"], + ["n", "๐Ÿ…ฝ"], + ["o", "๐Ÿ…พ"], + ["p", "๐Ÿ…ฟ"], + ["q", "๐Ÿ†€"], + ["r", "๐Ÿ†"], + ["s", "๐Ÿ†‚"], + ["t", "๐Ÿ†ƒ"], + ["u", "๐Ÿ†„"], + ["v", "๐Ÿ†…"], + ["w", "๐Ÿ††"], + ["x", "๐Ÿ†‡"], + ["y", "๐Ÿ†ˆ"], + ["z", "๐Ÿ†‰"] + ]), + serifBoldDict: new Map([ + ["0", "๐ŸŽ"], + ["1", "๐Ÿ"], + ["2", "๐Ÿ"], + ["3", "๐Ÿ‘"], + ["4", "๐Ÿ’"], + ["5", "๐Ÿ“"], + ["6", "๐Ÿ”"], + ["7", "๐Ÿ•"], + ["8", "๐Ÿ–"], + ["9", "๐Ÿ—"], + ["A", "๐€"], + ["B", "๐"], + ["C", "๐‚"], + ["D", "๐ƒ"], + ["E", "๐„"], + ["F", "๐…"], + ["G", "๐†"], + ["H", "๐‡"], + ["I", "๐ˆ"], + ["J", "๐‰"], + ["K", "๐Š"], + ["L", "๐‹"], + ["M", "๐Œ"], + ["N", "๐"], + ["O", "๐Ž"], + ["P", "๐"], + ["Q", "๐"], + ["R", "๐‘"], + ["S", "๐’"], + ["T", "๐“"], + ["U", "๐”"], + ["V", "๐•"], + ["W", "๐–"], + ["X", "๐—"], + ["Y", "๐˜"], + ["Z", "๐™"], + ["a", "๐š"], + ["b", "๐›"], + ["c", "๐œ"], + ["d", "๐"], + ["e", "๐ž"], + ["f", "๐Ÿ"], + ["g", "๐ "], + ["h", "๐ก"], + ["i", "๐ข"], + ["j", "๐ฃ"], + ["k", "๐ค"], + ["l", "๐ฅ"], + ["m", "๐ฆ"], + ["n", "๐ง"], + ["o", "๐จ"], + ["p", "๐ฉ"], + ["q", "๐ช"], + ["r", "๐ซ"], + ["s", "๐ฌ"], + ["t", "๐ญ"], + ["u", "๐ฎ"], + ["v", "๐ฏ"], + ["w", "๐ฐ"], + ["x", "๐ฑ"], + ["y", "๐ฒ"], + ["z", "๐ณ"] + ]), + serifBoldItalicDict: new Map([ + ["A", "๐‘จ"], + ["B", "๐‘ฉ"], + ["C", "๐‘ช"], + ["D", "๐‘ซ"], + ["E", "๐‘ฌ"], + ["F", "๐‘ญ"], + ["G", "๐‘ฎ"], + ["H", "๐‘ฏ"], + ["I", "๐‘ฐ"], + ["J", "๐‘ฑ"], + ["K", "๐‘ฒ"], + ["L", "๐‘ณ"], + ["M", "๐‘ด"], + ["N", "๐‘ต"], + ["O", "๐‘ถ"], + ["P", "๐‘ท"], + ["Q", "๐‘ธ"], + ["R", "๐‘น"], + ["S", "๐‘บ"], + ["T", "๐‘ป"], + ["U", "๐‘ผ"], + ["V", "๐‘ฝ"], + ["W", "๐‘พ"], + ["X", "๐‘ฟ"], + ["Y", "๐’€"], + ["Z", "๐’"], + ["a", "๐’‚"], + ["b", "๐’ƒ"], + ["c", "๐’„"], + ["d", "๐’…"], + ["e", "๐’†"], + ["f", "๐’‡"], + ["g", "๐’ˆ"], + ["h", "๐’‰"], + ["i", "๐’Š"], + ["j", "๐’‹"], + ["k", "๐’Œ"], + ["l", "๐’"], + ["m", "๐’Ž"], + ["n", "๐’"], + ["o", "๐’"], + ["p", "๐’‘"], + ["q", "๐’’"], + ["r", "๐’“"], + ["s", "๐’”"], + ["t", "๐’•"], + ["u", "๐’–"], + ["v", "๐’—"], + ["w", "๐’˜"], + ["x", "๐’™"], + ["y", "๐’š"], + ["z", "๐’›"] + ]), + sansDict: new Map([ + ["0", "๐Ÿข"], + ["1", "๐Ÿฃ"], + ["2", "๐Ÿค"], + ["3", "๐Ÿฅ"], + ["4", "๐Ÿฆ"], + ["5", "๐Ÿง"], + ["6", "๐Ÿจ"], + ["7", "๐Ÿฉ"], + ["8", "๐Ÿช"], + ["9", "๐Ÿซ"], + ["A", "๐– "], + ["B", "๐–ก"], + ["C", "๐–ข"], + ["D", "๐–ฃ"], + ["E", "๐–ค"], + ["F", "๐–ฅ"], + ["G", "๐–ฆ"], + ["H", "๐–ง"], + ["I", "๐–จ"], + ["J", "๐–ฉ"], + ["K", "๐–ช"], + ["L", "๐–ซ"], + ["M", "๐–ฌ"], + ["N", "๐–ญ"], + ["O", "๐–ฎ"], + ["P", "๐–ฏ"], + ["Q", "๐–ฐ"], + ["R", "๐–ฑ"], + ["S", "๐–ฒ"], + ["T", "๐–ณ"], + ["U", "๐–ด"], + ["V", "๐–ต"], + ["W", "๐–ถ"], + ["X", "๐–ท"], + ["Y", "๐–ธ"], + ["Z", "๐–น"], + ["a", "๐–บ"], + ["b", "๐–ป"], + ["c", "๐–ผ"], + ["d", "๐–ฝ"], + ["e", "๐–พ"], + ["f", "๐–ฟ"], + ["g", "๐—€"], + ["h", "๐—"], + ["i", "๐—‚"], + ["j", "๐—ƒ"], + ["k", "๐—„"], + ["l", "๐—…"], + ["m", "๐—†"], + ["n", "๐—‡"], + ["o", "๐—ˆ"], + ["p", "๐—‰"], + ["q", "๐—Š"], + ["r", "๐—‹"], + ["s", "๐—Œ"], + ["t", "๐—"], + ["u", "๐—Ž"], + ["v", "๐—"], + ["w", "๐—"], + ["x", "๐—‘"], + ["y", "๐—’"], + ["z", "๐—“"] + ]), + sansBoldDict: new Map([ + ["0", "๐Ÿฌ"], + ["1", "๐Ÿญ"], + ["2", "๐Ÿฎ"], + ["3", "๐Ÿฏ"], + ["4", "๐Ÿฐ"], + ["5", "๐Ÿฑ"], + ["6", "๐Ÿฒ"], + ["7", "๐Ÿณ"], + ["8", "๐Ÿด"], + ["9", "๐Ÿต"], + ["A", "๐—”"], + ["B", "๐—•"], + ["C", "๐—–"], + ["D", "๐——"], + ["E", "๐—˜"], + ["F", "๐—™"], + ["G", "๐—š"], + ["H", "๐—›"], + ["I", "๐—œ"], + ["J", "๐—"], + ["K", "๐—ž"], + ["L", "๐—Ÿ"], + ["M", "๐— "], + ["N", "๐—ก"], + ["O", "๐—ข"], + ["P", "๐—ฃ"], + ["Q", "๐—ค"], + ["R", "๐—ฅ"], + ["S", "๐—ฆ"], + ["T", "๐—ง"], + ["U", "๐—จ"], + ["V", "๐—ฉ"], + ["W", "๐—ช"], + ["X", "๐—ซ"], + ["Y", "๐—ฌ"], + ["Z", "๐—ญ"], + ["a", "๐—ฎ"], + ["b", "๐—ฏ"], + ["c", "๐—ฐ"], + ["d", "๐—ฑ"], + ["e", "๐—ฒ"], + ["f", "๐—ณ"], + ["g", "๐—ด"], + ["h", "๐—ต"], + ["i", "๐—ถ"], + ["j", "๐—ท"], + ["k", "๐—ธ"], + ["l", "๐—น"], + ["m", "๐—บ"], + ["n", "๐—ป"], + ["o", "๐—ผ"], + ["p", "๐—ฝ"], + ["q", "๐—พ"], + ["r", "๐—ฟ"], + ["s", "๐˜€"], + ["t", "๐˜"], + ["u", "๐˜‚"], + ["v", "๐˜ƒ"], + ["w", "๐˜„"], + ["x", "๐˜…"], + ["y", "๐˜†"], + ["z", "๐˜‡"] + ]), + sansItalicDict: new Map([ + ["A", "๐˜ˆ"], + ["B", "๐˜‰"], + ["C", "๐˜Š"], + ["D", "๐˜‹"], + ["E", "๐˜Œ"], + ["F", "๐˜"], + ["G", "๐˜Ž"], + ["H", "๐˜"], + ["I", "๐˜"], + ["J", "๐˜‘"], + ["K", "๐˜’"], + ["L", "๐˜“"], + ["M", "๐˜”"], + ["N", "๐˜•"], + ["O", "๐˜–"], + ["P", "๐˜—"], + ["Q", "๐˜˜"], + ["R", "๐˜™"], + ["S", "๐˜š"], + ["T", "๐˜›"], + ["U", "๐˜œ"], + ["V", "๐˜"], + ["W", "๐˜ž"], + ["X", "๐˜Ÿ"], + ["Y", "๐˜ "], + ["Z", "๐˜ก"], + ["a", "๐˜ข"], + ["b", "๐˜ฃ"], + ["c", "๐˜ค"], + ["d", "๐˜ฅ"], + ["e", "๐˜ฆ"], + ["f", "๐˜ง"], + ["g", "๐˜จ"], + ["h", "๐˜ฉ"], + ["i", "๐˜ช"], + ["j", "๐˜ซ"], + ["k", "๐˜ฌ"], + ["l", "๐˜ญ"], + ["m", "๐˜ฎ"], + ["n", "๐˜ฏ"], + ["o", "๐˜ฐ"], + ["p", "๐˜ฑ"], + ["q", "๐˜ฒ"], + ["r", "๐˜ณ"], + ["s", "๐˜ด"], + ["t", "๐˜ต"], + ["u", "๐˜ถ"], + ["v", "๐˜ท"], + ["w", "๐˜ธ"], + ["x", "๐˜น"], + ["y", "๐˜บ"], + ["z", "๐˜ป"] + ]), + sansBoldItalicDict: new Map([ + ["A", "๐˜ผ"], + ["B", "๐˜ฝ"], + ["C", "๐˜พ"], + ["D", "๐˜ฟ"], + ["E", "๐™€"], + ["F", "๐™"], + ["G", "๐™‚"], + ["H", "๐™ƒ"], + ["I", "๐™„"], + ["J", "๐™…"], + ["K", "๐™†"], + ["L", "๐™‡"], + ["M", "๐™ˆ"], + ["N", "๐™‰"], + ["O", "๐™Š"], + ["P", "๐™‹"], + ["Q", "๐™Œ"], + ["R", "๐™"], + ["S", "๐™Ž"], + ["T", "๐™"], + ["U", "๐™"], + ["V", "๐™‘"], + ["W", "๐™’"], + ["X", "๐™“"], + ["Y", "๐™”"], + ["Z", "๐™•"], + ["a", "๐™–"], + ["b", "๐™—"], + ["c", "๐™˜"], + ["d", "๐™™"], + ["e", "๐™š"], + ["f", "๐™›"], + ["g", "๐™œ"], + ["h", "๐™"], + ["i", "๐™ž"], + ["j", "๐™Ÿ"], + ["k", "๐™ "], + ["l", "๐™ก"], + ["m", "๐™ข"], + ["n", "๐™ฃ"], + ["o", "๐™ค"], + ["p", "๐™ฅ"], + ["q", "๐™ฆ"], + ["r", "๐™ง"], + ["s", "๐™จ"], + ["t", "๐™ฉ"], + ["u", "๐™ช"], + ["v", "๐™ซ"], + ["w", "๐™ฌ"], + ["x", "๐™ญ"], + ["y", "๐™ฎ"], + ["z", "๐™ฏ"] + ]) +} + +type ConvertMode = 'circledBlack' | 'circled' | 'doublestruck' | 'frakturBold' | 'fraktur' | 'monospace' | 'sansBold' | 'sansBoldItalic' | 'sans' | 'sansItalic' | 'scriptBold' | 'script' | 'serifBold' | 'serifBoldItalic' | 'squaredBlack' | 'squared' + +export function ConvertRichUnicode(text: string, mode: ConvertMode) { + let dict: Map; + switch (mode) { + case 'circledBlack': + dict = convertMap.cicledBlackDict; + break; + case 'circled': + dict = convertMap.circledDict; + break; + case 'doublestruck': + dict = convertMap.doublestruckDict; + break; + case 'frakturBold': + dict = convertMap.frakturBoldDict; + break; + case 'fraktur': + dict = convertMap.frakturDict; + break; + case 'monospace': + dict = convertMap.monospaceDict; + break; + case 'sansBold': + dict = convertMap.sansBoldDict; + break; + case 'sansBoldItalic': + dict = convertMap.sansBoldItalicDict; + break; + case 'sans': + dict = convertMap.sansDict; + break; + case 'sansItalic': + dict = convertMap.sansItalicDict; + break; + case 'scriptBold': + dict = convertMap.scriptBoldDict; + break; + case 'script': + dict = convertMap.scriptDict; + break; + case 'serifBold': + dict = convertMap.serifBoldDict; + break; + case 'serifBoldItalic': + dict = convertMap.serifBoldItalicDict; + break; + case 'squaredBlack': + dict = convertMap.squaredBlackDict; + break; + case 'squared': + dict = convertMap.squaredDict; + break; + default: + return text; + } + let newText = ''; + for (let i = 0; i < text.length; i++) { + const char = text.charAt(i); + newText += dict.get(char) || char; + } + return newText; +} From b198440cc5fd28d441818b86916ea15fca3b4acf Mon Sep 17 00:00:00 2001 From: kakakaya Date: Sun, 17 Mar 2024 20:36:45 +0900 Subject: [PATCH 3/5] Add coverage plugin --- frontend/package-lock.json | 273 +++++++++++++++++++++++++++++++++++++ frontend/package.json | 1 + frontend/vite.config.ts | 16 ++- 3 files changed, 287 insertions(+), 3 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index ce39835..0fad5ed 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -10,6 +10,7 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "^3.0.2", "@tsconfig/svelte": "^5.0.2", + "@vitest/coverage-v8": "^1.4.0", "svelte": "^4.2.12", "svelte-check": "^3.6.7", "svelte-preprocess": "^5.1.3", @@ -32,6 +33,56 @@ "node": ">=6.0.0" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz", + "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", + "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.19.12", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", @@ -400,6 +451,15 @@ "node": ">=12" } }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/@jest/schemas": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", @@ -721,12 +781,46 @@ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true + }, "node_modules/@types/pug": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/@types/pug/-/pug-2.0.10.tgz", "integrity": "sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==", "dev": true }, + "node_modules/@vitest/coverage-v8": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.4.0.tgz", + "integrity": "sha512-4hDGyH1SvKpgZnIByr9LhGgCEuF9DKM34IBLCC/fVfy24Z3+PZ+Ii9hsVBsHvY1umM1aGPEjceRkzxCfcQ10wg==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.1", + "@bcoe/v8-coverage": "^0.2.3", + "debug": "^4.3.4", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-lib-source-maps": "^5.0.4", + "istanbul-reports": "^3.1.6", + "magic-string": "^0.30.5", + "magicast": "^0.3.3", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^9.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "1.4.0" + } + }, "node_modules/@vitest/expect": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.4.0.tgz", @@ -1009,6 +1103,12 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -1293,6 +1393,21 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, "node_modules/human-signals": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", @@ -1403,6 +1518,56 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.4.tgz", + "integrity": "sha512-wHOoEsNJTVltaJp8eVkm8w+GVkVNHT2YDYo53YdzQEL2gWm1hBX5cGFR9hQJtuGLebidVX7et3+dmDZrmclduw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.23", + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/js-tokens": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz", @@ -1455,6 +1620,18 @@ "get-func-name": "^2.0.1" } }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/magic-string": { "version": "0.30.8", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", @@ -1467,6 +1644,32 @@ "node": ">=12" } }, + "node_modules/magicast": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.3.tgz", + "integrity": "sha512-ZbrP1Qxnpoes8sz47AM0z08U+jW6TyRgZzcWy3Ma3vDhJttwMwAFDMMQFobwdBxByBD46JYmxRzeF7w2+wJEuw==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.23.6", + "@babel/types": "^7.23.6", + "source-map-js": "^1.0.2" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/mdn-data": { "version": "2.0.30", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", @@ -1950,6 +2153,21 @@ "rimraf": "^2.5.2" } }, + "node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -2061,6 +2279,18 @@ "url": "https://github.com/sponsors/antfu" } }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/svelte": { "version": "4.2.12", "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.12.tgz", @@ -2183,6 +2413,20 @@ } } }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/tinybench": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", @@ -2207,6 +2451,15 @@ "node": ">=14.0.0" } }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -2253,6 +2506,20 @@ "integrity": "sha512-HGyF79+/qZ4soRvM+nHERR2pJ3VXDZ/8sL1uLahdgEDf580NkgiWOxLk33FetExqOWp352JZRsgXbG/4MaGOSg==", "dev": true }, + "node_modules/v8-to-istanbul": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", + "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, "node_modules/vite": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.6.tgz", @@ -2446,6 +2713,12 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/yocto-queue": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index b4dd68d..93af7b9 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -13,6 +13,7 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "^3.0.2", "@tsconfig/svelte": "^5.0.2", + "@vitest/coverage-v8": "^1.4.0", "svelte": "^4.2.12", "svelte-check": "^3.6.7", "svelte-preprocess": "^5.1.3", diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index d37616f..09fd72f 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,7 +1,17 @@ -import {defineConfig} from 'vite' -import {svelte} from '@sveltejs/vite-plugin-svelte' +import { defineConfig } from 'vite' +import { svelte } from '@sveltejs/vite-plugin-svelte' // https://vitejs.dev/config/ export default defineConfig({ - plugins: [svelte()] + plugins: [svelte()], + test: { + coverage: { + // you can include other reporters, but 'json-summary' is required, json is recommended + reporter: ['text', 'json-summary', 'json'], + // If you want a coverage reports even if your tests are failing, include the reportOnFailure option + reportOnFailure: true, + all: false, + enabled: true, + } + } }) From e38c91949f71a2c8da0f2125bd2da4fafcc8cf7c Mon Sep 17 00:00:00 2001 From: kakakaya Date: Sun, 17 Mar 2024 20:36:57 +0900 Subject: [PATCH 4/5] Add vitest.yml for CI --- .github/workflows/vitest.yml | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/vitest.yml diff --git a/.github/workflows/vitest.yml b/.github/workflows/vitest.yml new file mode 100644 index 0000000..9d9b850 --- /dev/null +++ b/.github/workflows/vitest.yml @@ -0,0 +1,38 @@ +name: 'frontend vitest' +on: + pull_request: + paths-ignore: + - 'docs/**' + push: + branches: + - main + paths-ignore: + - 'docs/**' + +jobs: + test: + runs-on: ubuntu-latest + + permissions: + # Required to checkout the code + contents: read + # Required to put a comment into the pull-request + pull-requests: write + defaults: + run: + working-directory: ./frontend + steps: + - uses: actions/checkout@v4 + - name: 'Install Node' + uses: actions/setup-node@v4 + with: + node-version: '20.x' + - name: 'Install Deps' + run: npm install + - name: 'Test' + run: npx vitest --coverage.enabled true + - name: 'Report Coverage' + # Set if: always() to also generate the report if tests are failing + # Only works if you set `reportOnFailure: true` in your vite config as specified above + if: always() + uses: davelosert/vitest-coverage-report-action@v2 \ No newline at end of file From 64acb7002d9b8637df6f905a29db6aec29a25f16 Mon Sep 17 00:00:00 2001 From: kakakaya Date: Sun, 17 Mar 2024 20:39:23 +0900 Subject: [PATCH 5/5] Add working-directory for vitest action --- .github/workflows/vitest.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vitest.yml b/.github/workflows/vitest.yml index 9d9b850..5ad2ada 100644 --- a/.github/workflows/vitest.yml +++ b/.github/workflows/vitest.yml @@ -35,4 +35,5 @@ jobs: # Set if: always() to also generate the report if tests are failing # Only works if you set `reportOnFailure: true` in your vite config as specified above if: always() - uses: davelosert/vitest-coverage-report-action@v2 \ No newline at end of file + uses: davelosert/vitest-coverage-report-action@v2 + working-directory: ./frontend