From 3b5faf16e6948360133b3176f7506feb031aac0e Mon Sep 17 00:00:00 2001 From: Andrey Ilin Date: Mon, 6 Jul 2026 15:54:50 +0200 Subject: [PATCH 1/5] refactor: switched from mocha to node:test --- .eslintrc.js | 1 - .gitignore | 1 + DATA_REQUIREMENTS.md | 2 +- package-lock.json | 828 ++----------------------------------------- package.json | 11 +- test/tests.js | 13 +- 6 files changed, 49 insertions(+), 807 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index d32820c..2a3e522 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,7 +2,6 @@ module.exports = { env: { commonjs: true, node: true, - mocha: true, }, extends: ['@parcellab/eslint-config/base'], rules: { diff --git a/.gitignore b/.gitignore index d7f293f..45d53bb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /tmp update/readme.txt .vscode +.zed diff --git a/DATA_REQUIREMENTS.md b/DATA_REQUIREMENTS.md index 9746d7e..0e5f18f 100644 --- a/DATA_REQUIREMENTS.md +++ b/DATA_REQUIREMENTS.md @@ -44,7 +44,7 @@ Additional format notes: ## 5) Testing - Add test cases to `test/tests.js` under `countriesPostalCodes`: include the country ISO/name, a representative zip, expected region code, and set `usingGoogle: false`. -- Run `npm test` to execute Mocha tests. +- Run `npm test` to execute the Node.js test runner. - Optional: verify pretty-name lookups via `getNameFromCountryAndRegion` using the `regionNames` file. ## 6) Data quality checklist diff --git a/package-lock.json b/package-lock.json index 9e35686..40ca9fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "region_identifier", - "version": "2.0.2", + "version": "2.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "region_identifier", - "version": "2.0.2", + "version": "2.1.0", "license": "CC BY 3.0", "dependencies": { "axios": "^1.18.1", @@ -14,13 +14,11 @@ }, "devDependencies": { "@parcellab/eslint-config": "^0.5.5", - "chai": "^6.2.2", "eslint-plugin-import": "^2.32.0", - "eslint-plugin-promise": "^7.3.0", - "mocha": "^11.7.6" + "eslint-plugin-promise": "^7.3.0" }, "engines": { - "node": ">=20.0.0" + "node": ">=24.0.0" } }, "node_modules/@babel/code-frame": { @@ -246,53 +244,6 @@ "license": "BSD-3-Clause", "peer": true }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", - "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.2.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/@napi-rs/wasm-runtime": { "version": "0.2.12", "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz", @@ -426,17 +377,6 @@ "eslint-utils": ">=3" } }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=14" - } - }, "node_modules/@rtsao/scc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", @@ -941,6 +881,7 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -951,6 +892,7 @@ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -966,7 +908,8 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, - "license": "Python-2.0" + "license": "Python-2.0", + "peer": true }, "node_modules/array-buffer-byte-length": { "version": "1.0.2", @@ -1158,6 +1101,7 @@ "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -1176,13 +1120,6 @@ "node": ">=8" } }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true, - "license": "ISC" - }, "node_modules/builtin-modules": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", @@ -1257,35 +1194,13 @@ "node": ">=6" } }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/chai": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", - "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, "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", + "peer": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -1297,22 +1212,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/ci-info": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", @@ -1355,67 +1254,13 @@ "node": ">=0.8.0" } }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/cliui/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/cliui/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "color-name": "~1.1.4" }, @@ -1428,7 +1273,8 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/combined-stream": { "version": "1.0.8", @@ -1468,6 +1314,7 @@ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -1548,19 +1395,6 @@ } } }, - "node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -1614,16 +1448,6 @@ "node": ">=0.4.0" } }, - "node_modules/diff": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.4.tgz", - "integrity": "sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -1666,20 +1490,6 @@ "node": ">= 0.4" } }, - "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, - "license": "MIT" - }, - "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, - "license": "MIT" - }, "node_modules/error-ex": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", @@ -1836,22 +1646,13 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "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", + "peer": true, "engines": { "node": ">=10" }, @@ -2448,6 +2249,7 @@ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -2459,16 +2261,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true, - "license": "BSD-3-Clause", - "bin": { - "flat": "cli.js" - } - }, "node_modules/flat-cache": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", @@ -2529,23 +2321,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/foreground-child": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", - "dev": true, - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.6", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/form-data": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", @@ -2632,16 +2407,6 @@ "node": ">= 0.4" } }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "license": "ISC", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, "node_modules/get-intrinsic": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", @@ -2711,28 +2476,6 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, - "node_modules/glob": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", - "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", - "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -2842,6 +2585,7 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -2914,16 +2658,6 @@ "node": ">= 0.4" } }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true, - "license": "MIT", - "bin": { - "he": "bin/he" - } - }, "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", @@ -3229,16 +2963,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-generator-function": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", @@ -3332,16 +3056,7 @@ "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true, - "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -3445,19 +3160,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-weakmap": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", @@ -3516,23 +3218,8 @@ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true, - "license": "ISC" - }, - "node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } + "license": "ISC", + "peer": true }, "node_modules/js-tokens": { "version": "4.0.0", @@ -3558,6 +3245,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "argparse": "^2.0.1" }, @@ -3664,6 +3352,7 @@ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -3688,30 +3377,6 @@ "license": "MIT", "peer": true }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true, - "license": "ISC" - }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -3785,6 +3450,7 @@ "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "brace-expansion": "^2.0.2" }, @@ -3805,69 +3471,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/mocha": { - "version": "11.7.6", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.6.tgz", - "integrity": "sha512-nS9xOGbw2I3cjCpxwZAEJ9xK9lmJ08vEkQvLtz4du9ZrF9UrjRpeJGiIgl2Z+Qs++pmB4ecDe48Fwsh+j+j7xA==", - "dev": true, - "license": "MIT", - "dependencies": { - "browser-stdout": "^1.3.1", - "chokidar": "^4.0.1", - "debug": "^4.3.5", - "diff": "^7.0.0", - "escape-string-regexp": "^4.0.0", - "find-up": "^5.0.0", - "glob": "^10.4.5", - "he": "^1.2.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "log-symbols": "^4.1.0", - "minimatch": "^9.0.5", - "ms": "^2.1.3", - "picocolors": "^1.1.1", - "serialize-javascript": "^6.0.2", - "strip-json-comments": "^3.1.1", - "supports-color": "^8.1.1", - "workerpool": "^9.2.0", - "yargs": "^17.7.2", - "yargs-parser": "^21.1.1", - "yargs-unparser": "^2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha.js" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/mocha/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -4143,6 +3746,7 @@ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -4159,6 +3763,7 @@ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -4180,13 +3785,6 @@ "node": ">=6" } }, - "node_modules/package-json-from-dist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true, - "license": "BlueOak-1.0.0" - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -4227,6 +3825,7 @@ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -4248,6 +3847,7 @@ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -4259,23 +3859,6 @@ "dev": true, "license": "MIT" }, - "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "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", @@ -4292,7 +3875,8 @@ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/picomatch": { "version": "2.3.2", @@ -4399,16 +3983,6 @@ "license": "MIT", "peer": true }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, "node_modules/read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -4527,20 +4101,6 @@ "node": ">=8" } }, - "node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", @@ -4629,16 +4189,6 @@ "node": "*" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/resolve": { "version": "2.0.0-next.6", "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.6.tgz", @@ -4809,27 +4359,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, "node_modules/safe-push-apply": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", @@ -4890,16 +4419,6 @@ "node": ">=10" } }, - "node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "randombytes": "^2.1.0" - } - }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -4955,6 +4474,7 @@ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -4968,6 +4488,7 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -5048,19 +4569,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "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, - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -5137,76 +4645,6 @@ "node": ">= 0.4" } }, - "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", - "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.2.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/string.prototype.trim": { "version": "1.2.10", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", @@ -5272,20 +4710,7 @@ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", + "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -5323,6 +4748,7 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" }, @@ -5336,6 +4762,7 @@ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -5670,6 +5097,7 @@ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "isexe": "^2.0.0" }, @@ -5780,114 +5208,6 @@ "node": ">=0.10.0" } }, - "node_modules/workerpool": { - "version": "9.3.4", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.4.tgz", - "integrity": "sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", - "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.2.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -5896,89 +5216,13 @@ "license": "ISC", "peer": true }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "license": "MIT", - "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index 009e3af..d57a907 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "region_identifier", - "version": "2.0.2", + "version": "2.1.0", "description": "Gets the name of the region depending of the country and zip code.", "main": "index.js", "repository": { @@ -18,11 +18,11 @@ }, "homepage": "https://github.com/parcelLab/regionIdentifier", "scripts": { - "test": "mocha test", + "test": "node --test test/tests.js", "lint": "eslint ." }, "engines": { - "node": ">=20.0.0" + "node": ">=24.0.0" }, "dependencies": { "axios": "^1.18.1", @@ -30,14 +30,11 @@ }, "devDependencies": { "@parcellab/eslint-config": "^0.5.5", - "chai": "^6.2.2", "eslint-plugin-import": "^2.32.0", - "eslint-plugin-promise": "^7.3.0", - "mocha": "^11.7.6" + "eslint-plugin-promise": "^7.3.0" }, "overrides": { "eslint-plugin-unicorn": "47.0.0", - "diff": "^8.0.3", "js-yaml": "^4.2.0" } } diff --git a/test/tests.js b/test/tests.js index a65c32e..457288f 100644 --- a/test/tests.js +++ b/test/tests.js @@ -1,4 +1,5 @@ -const { expect } = require('chai'); +const assert = require('node:assert/strict'); +const { describe, it } = require('node:test'); const RegionIdentifier = require('../lib/region'); @@ -443,12 +444,12 @@ const countriesPostalCodes = { describe('REGION IDENTIFIER', () => { Object.entries(countriesPostalCodes).forEach(([countryName, countryPostalCodes]) => { describe(`get() for ${countryName}`, () => { - countryPostalCodes.forEach(async (test) => { - const [region, googleUsed] = await identifier.get(test.name, test.zip); + countryPostalCodes.forEach((test) => { + it(`result for: ${test.name} with zip code: ${test.zip}`, async () => { + const [region, googleUsed] = await identifier.get(test.name, test.zip); - it(`result for: ${test.name} with zip code: ${test.zip} result: ${region}, google was used: ${googleUsed}`, () => { - expect(region).to.be.equals(test.result); - expect(googleUsed).to.be.equals(test.usingGoogle); + assert.equal(region, test.result); + assert.equal(googleUsed, test.usingGoogle); }); }); }); From 8b8796e7b17af46819bf0a62d9015410ccb48c10 Mon Sep 17 00:00:00 2001 From: Andrey Ilin Date: Mon, 6 Jul 2026 15:58:09 +0200 Subject: [PATCH 2/5] ci(workflow): Update Node test matrix --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fc7b202..55681a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - node-version: [22.x, 24.x] + node-version: [24.x, 26.x] steps: - uses: actions/checkout@v7.0.0 From be230126adbfa2e61cb533ede676a35ce9cd7218 Mon Sep 17 00:00:00 2001 From: Andrey Ilin Date: Mon, 6 Jul 2026 16:02:38 +0200 Subject: [PATCH 3/5] feat: added prettier --- .editorconfig | 9 +++++++++ .prettierignore | 7 +++++++ .prettierrc.json | 7 +++++++ package-lock.json | 10 +++++----- package.json | 7 +++++-- 5 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 .editorconfig create mode 100644 .prettierignore create mode 100644 .prettierrc.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..86a63dc --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..0f528ff --- /dev/null +++ b/.prettierignore @@ -0,0 +1,7 @@ +node_modules +package-lock.json + +# Generated/large data files: keep existing formatting to avoid noisy diffs. +country/**/*.json +regionNames/**/*.json +regions/**/*.json diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..433de3b --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,7 @@ +{ + "singleQuote": true, + "semi": true, + "trailingComma": "all", + "quoteProps": "consistent", + "printWidth": 100 +} diff --git a/package-lock.json b/package-lock.json index 40ca9fe..c9ea4d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,8 @@ "devDependencies": { "@parcellab/eslint-config": "^0.5.5", "eslint-plugin-import": "^2.32.0", - "eslint-plugin-promise": "^7.3.0" + "eslint-plugin-promise": "^7.3.0", + "prettier": "^3.9.4" }, "engines": { "node": ">=24.0.0" @@ -3925,12 +3926,11 @@ } }, "node_modules/prettier": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz", - "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", + "version": "3.9.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.4.tgz", + "integrity": "sha512-yWG/o/4oJfo036EKAfK6ACAoDOfHeRHx4tuxkfBZiauURiaSmYwlpOr5LQqKtIkRD2z1PLteme2WoxEnj4tHTg==", "dev": true, "license": "MIT", - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/package.json b/package.json index d57a907..b761c67 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,9 @@ "homepage": "https://github.com/parcelLab/regionIdentifier", "scripts": { "test": "node --test test/tests.js", - "lint": "eslint ." + "lint": "eslint .", + "format": "prettier --write .", + "format:check": "prettier --check ." }, "engines": { "node": ">=24.0.0" @@ -31,7 +33,8 @@ "devDependencies": { "@parcellab/eslint-config": "^0.5.5", "eslint-plugin-import": "^2.32.0", - "eslint-plugin-promise": "^7.3.0" + "eslint-plugin-promise": "^7.3.0", + "prettier": "^3.9.4" }, "overrides": { "eslint-plugin-unicorn": "47.0.0", From 8d6a5f96d69f20e85607f20923f6e68d41e7f51a Mon Sep 17 00:00:00 2001 From: Andrey Ilin Date: Mon, 6 Jul 2026 16:11:12 +0200 Subject: [PATCH 4/5] chore(format): applied formatting --- .editorconfig | 3 + .github/workflows/test.yml | 1 + .prettierrc.json | 10 +- DATA_REQUIREMENTS.md | 13 + README.md | 15 +- lib/region.js | 48 +- test/resolve.js | 2 +- test/tests.js | 975 +++++++++++++++++++++---------------- update/usa.js | 5 +- 9 files changed, 603 insertions(+), 469 deletions(-) diff --git a/.editorconfig b/.editorconfig index 86a63dc..91e4d97 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,3 +7,6 @@ indent_style = space indent_size = 2 insert_final_newline = true trim_trailing_whitespace = true + +[*.{yml,yaml}] +indent_size = 2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 55681a9..a6e6569 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,5 +21,6 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm ci + - run: npm run format:check - run: npm run build --if-present - run: npm test diff --git a/.prettierrc.json b/.prettierrc.json index 433de3b..9955296 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -3,5 +3,13 @@ "semi": true, "trailingComma": "all", "quoteProps": "consistent", - "printWidth": 100 + "printWidth": 100, + "overrides": [ + { + "files": ["*.yml", "*.yaml"], + "options": { + "singleQuote": false + } + } + ] } diff --git a/DATA_REQUIREMENTS.md b/DATA_REQUIREMENTS.md index 0e5f18f..37b4cc3 100644 --- a/DATA_REQUIREMENTS.md +++ b/DATA_REQUIREMENTS.md @@ -1,18 +1,23 @@ # Country Data Requirements + Guide for adding a new country to the static Region Identifier dataset. Each supported country needs three JSON files plus a small code change. ## 1) Country config – `country/ISO3.json` + - Keys: - `zipCodeFormat`: `"numeric"` or `"alpha"`. - `zipCodeLength`: integer, required for numeric formats to pad/compare values (USA=5, AUS=4, DEU=5, etc.). Omit for alpha formats (CAN/GBR/NLD). - Example: + ```json { "zipCodeFormat": "numeric", "zipCodeLength": 5 } ``` ## 2) Region names – `regionNames/ISO3.json` + - Plain object mapping ISO 3166-2 region codes (same codes used in `regions/*.json`) to display names in English. - Example (`regionNames/AUS.json`): + ```json { "AU-NSW": "New South Wales", @@ -21,11 +26,15 @@ Guide for adding a new country to the static Region Identifier dataset. Each sup ``` ## 3) Region mappings – `regions/ISO3.json` + Array of objects that map postal codes to ISO 3166-2 region codes. Formats already used in the repo: + - **Numeric intervals** (inclusive): objects with `low`, `high`, `region`. Values can be numbers or numeric strings if leading zeros matter. Example (`regions/AUS.json`): + ```json { "region": "AU-NSW", "low": 1000, "high": 1999 } ``` + - **Explicit codes**: objects with `low`, `region`, no `high`. Every postal code (or prefix) must be listed. Use strings to preserve zeros. Examples: - Belgium lists every 4-digit code (`regions/BEL.json`). - Spain lists 5-digit codes as strings (`regions/ESP.json`). @@ -34,20 +43,24 @@ Array of objects that map postal codes to ISO 3166-2 region codes. Formats alrea - **Discrete lists**: objects with `region` and `list` (array of codes). Numeric countries store numbers; matching uses `zipCodeLength` to pad leading zeros before comparison. Examples: USA (`list` of 5-digit numbers), RUS (per-region lists). Additional format notes: + - Files can mix formats if needed. Order matters because the lookup stops at the first match. - Intervals and lists are treated as inclusive ranges; for alpha codes only exact equality is used. - Keep codes as strings when leading zeros are significant. ## 4) Code wiring + - Add the ISO3 code to `availableCountries` in `lib/region.js`; otherwise the static data is ignored and Google is used. - If the country needs custom postal-code normalization, extend `validateZipCode` (see existing cases for GBR, CAN, NLD, MEX). ## 5) Testing + - Add test cases to `test/tests.js` under `countriesPostalCodes`: include the country ISO/name, a representative zip, expected region code, and set `usingGoogle: false`. - Run `npm test` to execute the Node.js test runner. - Optional: verify pretty-name lookups via `getNameFromCountryAndRegion` using the `regionNames` file. ## 6) Data quality checklist + - Region codes must be valid ISO 3166-2 for the country. - `regionNames` should be English and cover every region code present in `regions/ISO3.json`. - Postal-code coverage should include territories and edge prefixes (e.g., US territories, Canadian northern prefixes). diff --git a/README.md b/README.md index ad81de4..69d4b2f 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,14 @@ Utility module that provides an easy way to identify the region of the country depending on the postal code, brings a set of determined regions for some of the countries and if it doesn't find a match uses google geolocation API to get the region. -*Relevant links:* -* https://en.wikipedia.org/wiki/ISO_3166-2 — codes used for all the regions can be found here -* https://en.wikipedia.org/wiki/Category:Postal_codes_by_country - explanations of postal code structure per country -* https://download.geonames.org/export/zip/ - all the Geoname files for download (see below) +_Relevant links:_ + +- https://en.wikipedia.org/wiki/ISO_3166-2 — codes used for all the regions can be found here +- https://en.wikipedia.org/wiki/Category:Postal_codes_by_country - explanations of postal code structure per country +- https://download.geonames.org/export/zip/ - all the Geoname files for download (see below) #### Predefined Regions + - AUS - AUT - BRA @@ -39,22 +41,27 @@ Utility module that provides an easy way to identify the region of the country d - USA ## Test + ```sh $ npm test ``` ### License + This module was built using adapted information from http://download.geonames.org/ that's registered under the **CC BY 3.0** as well as this module. Link to more information about **CC BY 3.0** http://creativecommons.org/licenses/by/3.0/. ## Usage #### Basic: + ```javascript const { RegionIdentifier } = requrie('regionIdentifier'); const identifier = new RegionIdentifier(''); ``` + #### Get region: + ```javascript //Using country name identifier.get('Deutschland', '6578') diff --git a/lib/region.js b/lib/region.js index ce94442..3173c62 100644 --- a/lib/region.js +++ b/lib/region.js @@ -172,19 +172,13 @@ function getRegionByZipCodeOnStaticFiles(countryIso, zip) { (regionMapping.list.includes(parseInt(zip)) || (countryConfig.zipCodeFormat === 'numeric' ? regionMapping.list.some((l) => - zip.startsWith( - String(l).padStart(countryConfig.zipCodeLength, '0'), - ), + zip.startsWith(String(l).padStart(countryConfig.zipCodeLength, '0')), ) : false)) ) { return regionMapping.region; - } else if (!regionMapping.high && zip === regionMapping.low) - return regionMapping.region; - else if ( - parseInt(zip) >= regionMapping.low && - parseInt(zip) <= regionMapping.high - ) + } else if (!regionMapping.high && zip === regionMapping.low) return regionMapping.region; + else if (parseInt(zip) >= regionMapping.low && parseInt(zip) <= regionMapping.high) return regionMapping.region; } } @@ -293,34 +287,30 @@ class RegionIdentifier { let response; try { - response = await axios.get( - googleLink.replace('####', encodeURIComponent(param)), - ); + response = await axios.get(googleLink.replace('####', encodeURIComponent(param))); } catch (err) { throw new GoogleMapsAPIError('Google Maps API request failed: ' + JSON.stringify(err)); } - if (!response?.data) { - return null; - } + if (!response?.data) { + return null; + } - if (response.data?.results?.length <= 0) { - return null; - } + if (response.data?.results?.length <= 0) { + return null; + } - // find country inside of the nested array - const region = response.data.results[0].address_components.find((component) => { - const typeFound = component.types.find( - (type) => type === 'administrative_area_level_1', - ); - return typeFound && typeFound.length > 0; - }); + // find country inside of the nested array + const region = response.data.results[0].address_components.find((component) => { + const typeFound = component.types.find((type) => type === 'administrative_area_level_1'); + return typeFound && typeFound.length > 0; + }); - if (!region) { - throw new GoogleMapsAPIError('NOT FOUND'); - } + if (!region) { + throw new GoogleMapsAPIError('NOT FOUND'); + } - return `${countryIso.alpha2}-${cleanAndCatchFaultyRegionName(region)}`; + return `${countryIso.alpha2}-${cleanAndCatchFaultyRegionName(region)}`; } } diff --git a/test/resolve.js b/test/resolve.js index a5c4c90..6993b3e 100644 --- a/test/resolve.js +++ b/test/resolve.js @@ -18,7 +18,7 @@ identifier .catch((err) => { console.error(err); - if(err instanceof GoogleMapsAPIError) { + if (err instanceof GoogleMapsAPIError) { console.error('Google Maps API error'); } }); diff --git a/test/tests.js b/test/tests.js index 457288f..310a7a9 100644 --- a/test/tests.js +++ b/test/tests.js @@ -6,439 +6,548 @@ const RegionIdentifier = require('../lib/region'); const identifier = new RegionIdentifier(''); const countriesPostalCodes = { - 'Austria': [{ - name: 'AUT', - zip: '1999', - result: 'AT-9', - usingGoogle: false, - }, { - name: 'Austria', - usingGoogle: false, - zip: '1999', - result: 'AT-9', - }], - 'Deutschland': [{ - name: 'DEU', - zip: '6578', - result: 'DE-TH', - usingGoogle: false, - }], - 'Belgium': [{ - name: 'BEL', - zip: '1701', - result: 'BE-VLG', - usingGoogle: false, - }], - 'Switzerland': [{ - name: 'CHE', - zip: '2333', - result: 'CH-BE', - usingGoogle: false, - }, { - name: 'CHE', - zip: '9488', - result: 'CH-SG', - usingGoogle: false, - }], - 'Spain': [{ - name: 'ESP', - zip: '04004', - result: 'ES-AN', - usingGoogle: false, - }], - 'France': [{ - name: 'FRA', - zip: '25090', - result: 'FR-I', - usingGoogle: false, - }, { - name: 'FRA', - zip: '92440', - result: 'FR-J', - usingGoogle: false, - }, { - name: 'FRA', - zip: '75116', - result: 'FR-J', - usingGoogle: false, - }, { - name: 'FRA', - zip: '51000', - result: 'FR-G', - usingGoogle: false, - }, { - name: 'FRA', - zip: '51100', - result: 'FR-G', - usingGoogle: false, - }, { - name: 'FRA', - zip: '75020', - result: 'FR-J', - usingGoogle: false, - }, { - name: 'FR', - zip: '25090', - result: 'FR-I', - usingGoogle: false, - }, { - name: 'FR', - zip: '87200', - result: 'FR-L', - usingGoogle: false, - }, { - name: 'FR', - zip: '87200 CEDEX 1', - result: 'FR-L', - usingGoogle: false, - }, { - name: 'FR', - zip: '61100', - result: 'FR-P', - usingGoogle: false, - }, { - name: 'FR', - zip: '81000', - result: 'FR-N', - usingGoogle: false, - }], - 'United Kingdom': [{ - name: 'GBR', - zip: 'PA13 4PS', - result: 'GB-SCT', - usingGoogle: false, - }, { - name: 'GBR', - zip: 'EC2N 1AR', - result: 'GB-ENG', - usingGoogle: false, - }, { - name: 'GBR', - zip: 'FY83QN', - result: 'GB-ENG', - usingGoogle: false, - }, { - name: 'GBR', - zip: 'CF466RT', - result: 'GB-WLS', - usingGoogle: false, - }, { - name: 'GBR', - zip: 'AL10 9BL', - result: 'GB-ENG', - usingGoogle: false, - }, { - name: 'GBR', - zip: 'm14 5pq', - result: 'GB-ENG', - usingGoogle: false, - }, { - name: 'GBR', - zip: 'Po10 8Eg', - result: 'GB-ENG', - usingGoogle: false, - }, { - name: 'GBR', - zip: 'L5 3QN', - result: 'GB-ENG', - usingGoogle: false, - }], - 'Italy': [{ - name: 'ITA', - zip: '67033', - result: 'IT-65', - usingGoogle: false, - }, { - name: 'ITA', - zip: '41121', - result: 'IT-45', - usingGoogle: false, - }], - 'India': [{ - name: 'IND', - zip: '110001', - result: 'IN-DL', - usingGoogle: false, - }], - 'Ireland': [{ - name: 'IRL', - zip: 'D02 X285', - result: 'IE-L', - usingGoogle: false, - }], - 'Romania': [{ - name: 'ROU', - zip: '010011', - result: 'RO-B', - usingGoogle: false, - }], - 'Hungary': [{ - name: 'HUN', - zip: '1011', - result: 'HU-BU', - usingGoogle: false, - }], - 'Japan': [{ - name: 'JPN', - zip: '100-0001', - result: 'JP-13', - usingGoogle: false, - }, { - name: 'JPN', - zip: '530-0001', - result: 'JP-27', - usingGoogle: false, - }], - 'Brazil': [{ - name: 'BRA', - zip: '69900-000', - result: 'BR-AC', - usingGoogle: false, - }], - 'South Korea': [{ - name: 'KOR', - zip: '01000', - result: 'KR-11', - usingGoogle: false, - }], - 'Lithuania': [{ - name: 'LTU', - zip: '62001', - result: 'LT-03', - usingGoogle: false, - }], - 'Luxembourg': [{ - name: 'LUX', - zip: 'L-4795', - result: 'LU-CA', - usingGoogle: false, - }], - 'Portugal': [{ - name: 'PRT', - zip: '3020-740', - result: 'PT-01', - usingGoogle: false, - }], - 'Slovakia': [{ - name: 'SVK', - zip: '049 01', - result: 'SK-BC', - usingGoogle: false, - }], - 'Turkey': [{ - name: 'TUR', - zip: '01010', - result: 'TR-01', - usingGoogle: false, - }], - 'Netherlands': [{ - name: 'NLD', - zip: '3541', - result: 'NL-UT', - usingGoogle: false, - }, { - name: 'NLD', - zip: '6869 VC', - result: 'NL-GE', - usingGoogle: false, - }, { - name: 'NLD', - zip: '2294 HC', - result: 'NL-ZH', - usingGoogle: false, - }, { - name: 'NLD', - zip: '2294HC', - result: 'NL-ZH', - usingGoogle: false, - }], - 'Canada': [{ - name: 'CAN', - zip: 'X1A 0E2', - result: 'CA-NT', - usingGoogle: false, - }, { - name: 'CAN', - zip: 'X1A 0E2', - result: 'CA-NT', - usingGoogle: false, - }, { - name: 'CAN', - zip: 'X1A0E2', - result: 'CA-NT', - usingGoogle: false, - }, { - name: 'CAN', - zip: 'G1P 2J1', - result: 'CA-QC', - usingGoogle: false, - }, { - name: 'CAN', - zip: 'S0J 0G0', - result: 'CA-SK', - usingGoogle: false, - }], - 'Mexico': [{ - name: 'MEX', - zip: '06000', - result: 'MX-CMX', - usingGoogle: false, - }], - 'Serbia': [{ - name: 'SRB', - zip: '11000', - result: 'RS-00', - usingGoogle: false, - }, { - name: 'SRB', - zip: '11320', - result: 'RS-10', - usingGoogle: false, - }, { - name: 'SRB', - zip: '18230', - result: 'RS-15', - usingGoogle: false, - }, { - name: 'SRB', - zip: '24430', - result: 'RS-03', - usingGoogle: false, - }, { - name: 'SRB', - zip: '21000', - result: 'RS-VO', - usingGoogle: false, - }, { - name: 'SRB', - zip: '38000', - result: 'RS-KM', - usingGoogle: false, - }], - 'United States': [{ - name: 'USA', - zip: '972022239', - result: 'US-OR', - usingGoogle: false, - }, { - name: 'USA', - zip: '06103', - result: 'US-CT', - usingGoogle: false, - }, { - name: 'USA', - zip: '00646', - result: 'US-PR', - usingGoogle: false, - }, { - name: 'USA', - zip: '96799', - result: 'US-AS', - usingGoogle: false, - }, { - name: 'USA', - zip: '96921', - result: 'US-GU', - usingGoogle: false, - }, { - name: 'USA', - zip: '96951', - result: 'US-MP', - usingGoogle: false, - }, { - name: 'USA', - zip: '00831', - result: 'US-VI', - usingGoogle: false, - }, { - name: 'USA', - zip: '10038', - result: 'US-NY', - usingGoogle: false, - }], - 'Qatar': [{ - name: 'QAT', - zip: '06000', - result: null, - usingGoogle: false, - }], - 'Sweden': [{ - name: 'SWE', - zip: '11337', - result: 'SE-AB', - usingGoogle: false, - },{ - name: 'SWE', - zip: '95435', - result: 'SE-BD', - usingGoogle: false, - },{ - name: 'SWE', - zip: '23531', - result: 'SE-M', - usingGoogle: false, - },{ - name: 'SWE', - zip: '10000', - result: 'SE-AB', - usingGoogle: false, - },{ - name: 'SWE', - zip: '99999', - result: 'SE-BD', - usingGoogle: false, - },{ - name: 'SWE', - zip: '81999', - result: 'SE-C', - usingGoogle: false, - }], - 'Finland': [{ - name: 'FIN', - zip: '00940', - result: 'FI-18', - usingGoogle: false, - },{ - name: 'FIN', - zip: '70840', - result: 'FI-15', - usingGoogle: false, - },{ - name: 'FIN', - zip: '96900', - result: 'FI-10', - usingGoogle: false, - },{ - name: 'FIN', - zip: '00100', - result: 'FI-18', - usingGoogle: false, - },{ - name: 'FIN', - zip: '99990', - result: 'FI-10', - usingGoogle: false, - },{ - name: 'FIN', - zip: '20200', - result: 'FI-19', - usingGoogle: false, - },{ - name: 'FIN', - zip: '22100', - result: 'FI-01', - usingGoogle: false, - },{ - name: 'AUS', - zip: '0841', - result: 'AU-NT', - usingGoogle: false, - },{ - name: 'AUS', - zip: '2111', - result: 'AU-NSW', - usingGoogle: false, - }], + 'Austria': [ + { + name: 'AUT', + zip: '1999', + result: 'AT-9', + usingGoogle: false, + }, + { + name: 'Austria', + usingGoogle: false, + zip: '1999', + result: 'AT-9', + }, + ], + 'Deutschland': [ + { + name: 'DEU', + zip: '6578', + result: 'DE-TH', + usingGoogle: false, + }, + ], + 'Belgium': [ + { + name: 'BEL', + zip: '1701', + result: 'BE-VLG', + usingGoogle: false, + }, + ], + 'Switzerland': [ + { + name: 'CHE', + zip: '2333', + result: 'CH-BE', + usingGoogle: false, + }, + { + name: 'CHE', + zip: '9488', + result: 'CH-SG', + usingGoogle: false, + }, + ], + 'Spain': [ + { + name: 'ESP', + zip: '04004', + result: 'ES-AN', + usingGoogle: false, + }, + ], + 'France': [ + { + name: 'FRA', + zip: '25090', + result: 'FR-I', + usingGoogle: false, + }, + { + name: 'FRA', + zip: '92440', + result: 'FR-J', + usingGoogle: false, + }, + { + name: 'FRA', + zip: '75116', + result: 'FR-J', + usingGoogle: false, + }, + { + name: 'FRA', + zip: '51000', + result: 'FR-G', + usingGoogle: false, + }, + { + name: 'FRA', + zip: '51100', + result: 'FR-G', + usingGoogle: false, + }, + { + name: 'FRA', + zip: '75020', + result: 'FR-J', + usingGoogle: false, + }, + { + name: 'FR', + zip: '25090', + result: 'FR-I', + usingGoogle: false, + }, + { + name: 'FR', + zip: '87200', + result: 'FR-L', + usingGoogle: false, + }, + { + name: 'FR', + zip: '87200 CEDEX 1', + result: 'FR-L', + usingGoogle: false, + }, + { + name: 'FR', + zip: '61100', + result: 'FR-P', + usingGoogle: false, + }, + { + name: 'FR', + zip: '81000', + result: 'FR-N', + usingGoogle: false, + }, + ], + 'United Kingdom': [ + { + name: 'GBR', + zip: 'PA13 4PS', + result: 'GB-SCT', + usingGoogle: false, + }, + { + name: 'GBR', + zip: 'EC2N 1AR', + result: 'GB-ENG', + usingGoogle: false, + }, + { + name: 'GBR', + zip: 'FY83QN', + result: 'GB-ENG', + usingGoogle: false, + }, + { + name: 'GBR', + zip: 'CF466RT', + result: 'GB-WLS', + usingGoogle: false, + }, + { + name: 'GBR', + zip: 'AL10 9BL', + result: 'GB-ENG', + usingGoogle: false, + }, + { + name: 'GBR', + zip: 'm14 5pq', + result: 'GB-ENG', + usingGoogle: false, + }, + { + name: 'GBR', + zip: 'Po10 8Eg', + result: 'GB-ENG', + usingGoogle: false, + }, + { + name: 'GBR', + zip: 'L5 3QN', + result: 'GB-ENG', + usingGoogle: false, + }, + ], + 'Italy': [ + { + name: 'ITA', + zip: '67033', + result: 'IT-65', + usingGoogle: false, + }, + { + name: 'ITA', + zip: '41121', + result: 'IT-45', + usingGoogle: false, + }, + ], + 'India': [ + { + name: 'IND', + zip: '110001', + result: 'IN-DL', + usingGoogle: false, + }, + ], + 'Ireland': [ + { + name: 'IRL', + zip: 'D02 X285', + result: 'IE-L', + usingGoogle: false, + }, + ], + 'Romania': [ + { + name: 'ROU', + zip: '010011', + result: 'RO-B', + usingGoogle: false, + }, + ], + 'Hungary': [ + { + name: 'HUN', + zip: '1011', + result: 'HU-BU', + usingGoogle: false, + }, + ], + 'Japan': [ + { + name: 'JPN', + zip: '100-0001', + result: 'JP-13', + usingGoogle: false, + }, + { + name: 'JPN', + zip: '530-0001', + result: 'JP-27', + usingGoogle: false, + }, + ], + 'Brazil': [ + { + name: 'BRA', + zip: '69900-000', + result: 'BR-AC', + usingGoogle: false, + }, + ], + 'South Korea': [ + { + name: 'KOR', + zip: '01000', + result: 'KR-11', + usingGoogle: false, + }, + ], + 'Lithuania': [ + { + name: 'LTU', + zip: '62001', + result: 'LT-03', + usingGoogle: false, + }, + ], + 'Luxembourg': [ + { + name: 'LUX', + zip: 'L-4795', + result: 'LU-CA', + usingGoogle: false, + }, + ], + 'Portugal': [ + { + name: 'PRT', + zip: '3020-740', + result: 'PT-01', + usingGoogle: false, + }, + ], + 'Slovakia': [ + { + name: 'SVK', + zip: '049 01', + result: 'SK-BC', + usingGoogle: false, + }, + ], + 'Turkey': [ + { + name: 'TUR', + zip: '01010', + result: 'TR-01', + usingGoogle: false, + }, + ], + 'Netherlands': [ + { + name: 'NLD', + zip: '3541', + result: 'NL-UT', + usingGoogle: false, + }, + { + name: 'NLD', + zip: '6869 VC', + result: 'NL-GE', + usingGoogle: false, + }, + { + name: 'NLD', + zip: '2294 HC', + result: 'NL-ZH', + usingGoogle: false, + }, + { + name: 'NLD', + zip: '2294HC', + result: 'NL-ZH', + usingGoogle: false, + }, + ], + 'Canada': [ + { + name: 'CAN', + zip: 'X1A 0E2', + result: 'CA-NT', + usingGoogle: false, + }, + { + name: 'CAN', + zip: 'X1A 0E2', + result: 'CA-NT', + usingGoogle: false, + }, + { + name: 'CAN', + zip: 'X1A0E2', + result: 'CA-NT', + usingGoogle: false, + }, + { + name: 'CAN', + zip: 'G1P 2J1', + result: 'CA-QC', + usingGoogle: false, + }, + { + name: 'CAN', + zip: 'S0J 0G0', + result: 'CA-SK', + usingGoogle: false, + }, + ], + 'Mexico': [ + { + name: 'MEX', + zip: '06000', + result: 'MX-CMX', + usingGoogle: false, + }, + ], + 'Serbia': [ + { + name: 'SRB', + zip: '11000', + result: 'RS-00', + usingGoogle: false, + }, + { + name: 'SRB', + zip: '11320', + result: 'RS-10', + usingGoogle: false, + }, + { + name: 'SRB', + zip: '18230', + result: 'RS-15', + usingGoogle: false, + }, + { + name: 'SRB', + zip: '24430', + result: 'RS-03', + usingGoogle: false, + }, + { + name: 'SRB', + zip: '21000', + result: 'RS-VO', + usingGoogle: false, + }, + { + name: 'SRB', + zip: '38000', + result: 'RS-KM', + usingGoogle: false, + }, + ], + 'United States': [ + { + name: 'USA', + zip: '972022239', + result: 'US-OR', + usingGoogle: false, + }, + { + name: 'USA', + zip: '06103', + result: 'US-CT', + usingGoogle: false, + }, + { + name: 'USA', + zip: '00646', + result: 'US-PR', + usingGoogle: false, + }, + { + name: 'USA', + zip: '96799', + result: 'US-AS', + usingGoogle: false, + }, + { + name: 'USA', + zip: '96921', + result: 'US-GU', + usingGoogle: false, + }, + { + name: 'USA', + zip: '96951', + result: 'US-MP', + usingGoogle: false, + }, + { + name: 'USA', + zip: '00831', + result: 'US-VI', + usingGoogle: false, + }, + { + name: 'USA', + zip: '10038', + result: 'US-NY', + usingGoogle: false, + }, + ], + 'Qatar': [ + { + name: 'QAT', + zip: '06000', + result: null, + usingGoogle: false, + }, + ], + 'Sweden': [ + { + name: 'SWE', + zip: '11337', + result: 'SE-AB', + usingGoogle: false, + }, + { + name: 'SWE', + zip: '95435', + result: 'SE-BD', + usingGoogle: false, + }, + { + name: 'SWE', + zip: '23531', + result: 'SE-M', + usingGoogle: false, + }, + { + name: 'SWE', + zip: '10000', + result: 'SE-AB', + usingGoogle: false, + }, + { + name: 'SWE', + zip: '99999', + result: 'SE-BD', + usingGoogle: false, + }, + { + name: 'SWE', + zip: '81999', + result: 'SE-C', + usingGoogle: false, + }, + ], + 'Finland': [ + { + name: 'FIN', + zip: '00940', + result: 'FI-18', + usingGoogle: false, + }, + { + name: 'FIN', + zip: '70840', + result: 'FI-15', + usingGoogle: false, + }, + { + name: 'FIN', + zip: '96900', + result: 'FI-10', + usingGoogle: false, + }, + { + name: 'FIN', + zip: '00100', + result: 'FI-18', + usingGoogle: false, + }, + { + name: 'FIN', + zip: '99990', + result: 'FI-10', + usingGoogle: false, + }, + { + name: 'FIN', + zip: '20200', + result: 'FI-19', + usingGoogle: false, + }, + { + name: 'FIN', + zip: '22100', + result: 'FI-01', + usingGoogle: false, + }, + { + name: 'AUS', + zip: '0841', + result: 'AU-NT', + usingGoogle: false, + }, + { + name: 'AUS', + zip: '2111', + result: 'AU-NSW', + usingGoogle: false, + }, + ], }; describe('REGION IDENTIFIER', () => { diff --git a/update/usa.js b/update/usa.js index c6d9785..467c255 100644 --- a/update/usa.js +++ b/update/usa.js @@ -37,4 +37,7 @@ for (const code of codes) { fs.unlinkSync(path.join(__dirname, `${code}.zip`)); } -fs.writeFileSync(path.join(__dirname, '..', 'regions', 'USA.json'), JSON.stringify(result, null, 2)); +fs.writeFileSync( + path.join(__dirname, '..', 'regions', 'USA.json'), + JSON.stringify(result, null, 2), +); From 663b56f6706a545746f73b41798de7c35d66839d Mon Sep 17 00:00:00 2001 From: Andrey Ilin Date: Mon, 6 Jul 2026 16:22:41 +0200 Subject: [PATCH 5/5] chore(lint): added eslint-config-prettier --- .eslintrc.js | 6 +----- package-lock.json | 2 +- package.json | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 2a3e522..c7b177d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,13 +3,9 @@ module.exports = { commonjs: true, node: true, }, - extends: ['@parcellab/eslint-config/base'], + extends: ['@parcellab/eslint-config/base', 'prettier'], rules: { - 'comma-dangle': ['error', 'always-multiline'], 'prefer-const': 'error', - 'quote-props': ['error', 'consistent-as-needed'], - 'quotes': ['error', 'single'], - 'semi': ['error', 'always'], 'unicorn/prefer-module': 'off', }, }; diff --git a/package-lock.json b/package-lock.json index c9ea4d8..a1fce1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ }, "devDependencies": { "@parcellab/eslint-config": "^0.5.5", + "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.32.0", "eslint-plugin-promise": "^7.3.0", "prettier": "^3.9.4" @@ -1725,7 +1726,6 @@ "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "dev": true, "license": "MIT", - "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, diff --git a/package.json b/package.json index b761c67..b9f3c06 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ }, "devDependencies": { "@parcellab/eslint-config": "^0.5.5", + "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.32.0", "eslint-plugin-promise": "^7.3.0", "prettier": "^3.9.4"