From c0d1398d6f2dda047501a6ba69f88c300f5932d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 5 Sep 2026 07:42:57 +0100 Subject: [PATCH 1/2] chore (deps): bump @humanfs/node from 0.16.7 to 0.16.8 (#2772) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index a48c038642..0af6bfa119 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3004,29 +3004,43 @@ } }, "node_modules/@humanfs/core": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", - "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", "dev": true, "license": "Apache-2.0", + "dependencies": { + "@humanfs/types": "^0.15.0" + }, "engines": { "node": ">=18.18.0" } }, "node_modules/@humanfs/node": { - "version": "0.16.7", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", - "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@humanfs/core": "^0.19.1", + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", "@humanwhocodes/retry": "^0.4.0" }, "engines": { "node": ">=18.18.0" } }, + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", From d3a9667c92cd3745a38180999f81a9db5c13ec38 Mon Sep 17 00:00:00 2001 From: Animesh Chandra Srivastava Date: Sat, 5 Sep 2026 13:01:51 +0530 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20use=20OperationError=20instead=20of?= =?UTF-8?q?=20bare=20Error=20in=20MOD,=20LuhnChecksum,=20a=E2=80=A6=20(#27?= =?UTF-8?q?66)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/operations/CSSSelector.mjs | 2 +- src/core/operations/LuhnChecksum.mjs | 2 +- src/core/operations/MOD.mjs | 3 ++- tests/operations/tests/LuhnChecksum.mjs | 11 +++++++++++ tests/operations/tests/MOD.mjs | 3 +-- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/core/operations/CSSSelector.mjs b/src/core/operations/CSSSelector.mjs index 639726c49d..59fdf6f87a 100644 --- a/src/core/operations/CSSSelector.mjs +++ b/src/core/operations/CSSSelector.mjs @@ -77,7 +77,7 @@ class CSSSelector extends Operation { case node.TEXT_NODE: return node.wholeText; case node.COMMENT_NODE: return node.data; case node.DOCUMENT_NODE: return node.outerHTML; - default: throw new Error("Unknown Node Type: " + node.nodeType); + default: throw new OperationError("Unknown Node Type: " + node.nodeType); }*/ }; diff --git a/src/core/operations/LuhnChecksum.mjs b/src/core/operations/LuhnChecksum.mjs index 58e904fb39..228cdca6cd 100644 --- a/src/core/operations/LuhnChecksum.mjs +++ b/src/core/operations/LuhnChecksum.mjs @@ -48,7 +48,7 @@ class LuhnChecksum extends Operation { // If element is not a valid number in the given radix. if (isNaN(temp)) { - throw new Error("Character: " + elem + " is not valid in radix " + radix + "."); + throw new OperationError("Character: " + elem + " is not valid in radix " + radix + "."); } // If element is in an even position diff --git a/src/core/operations/MOD.mjs b/src/core/operations/MOD.mjs index e50b339a42..358f9ed4a6 100644 --- a/src/core/operations/MOD.mjs +++ b/src/core/operations/MOD.mjs @@ -4,6 +4,7 @@ import BigNumber from "bignumber.js"; import Operation from "../Operation.mjs"; +import OperationError from "../errors/OperationError.mjs"; import { createNumArray } from "../lib/Arithmetic.mjs"; import { ARITHMETIC_DELIM_OPTIONS } from "../lib/Delim.mjs"; @@ -48,7 +49,7 @@ class MOD extends Operation { const delimiter = args[1]; if (modulus.isZero()) { - throw new Error("Modulus cannot be zero"); + throw new OperationError("Modulus cannot be zero"); } const numbers = createNumArray(input, delimiter); diff --git a/tests/operations/tests/LuhnChecksum.mjs b/tests/operations/tests/LuhnChecksum.mjs index 33d7372e85..87b3a45cbd 100644 --- a/tests/operations/tests/LuhnChecksum.mjs +++ b/tests/operations/tests/LuhnChecksum.mjs @@ -433,4 +433,15 @@ TestRegister.addTests([ }, ], }, + { + name: "Luhn Checksum: Invalid character for radix error", + input: "123G", + expectedOutput: "Character: G is not valid in radix 10.", + recipeConfig: [ + { + op: "Luhn Checksum", + args: [10] + }, + ], + }, ]); diff --git a/tests/operations/tests/MOD.mjs b/tests/operations/tests/MOD.mjs index 2ecd25f611..d364a589a2 100644 --- a/tests/operations/tests/MOD.mjs +++ b/tests/operations/tests/MOD.mjs @@ -163,8 +163,7 @@ TestRegister.addTests([ { name: "MOD: Zero modulus error", input: "15 4 7", - expectedError: true, - expectedOutput: "MOD - Modulus cannot be zero", + expectedOutput: "Modulus cannot be zero", recipeConfig: [ { "op": "MOD",