From 0ae0a696e4052e6dcdfb2747ccaa8d48bec0918a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 04:01:02 +0000 Subject: [PATCH 1/4] chore(deps-dev): bump mocha from 10.8.2 to 11.0.1 in /finder/nodejs Bumps [mocha](https://github.com/mochajs/mocha) from 10.8.2 to 11.0.1. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v10.8.2...v11.0.1) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- finder/nodejs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/finder/nodejs/package.json b/finder/nodejs/package.json index 32f53acc..f5c7ced6 100644 --- a/finder/nodejs/package.json +++ b/finder/nodejs/package.json @@ -33,7 +33,7 @@ "@types/mocha": "^10.0.0", "@types/node": "^22.0.0", "expect": "^29.2.0", - "mocha": "^10.0.0", + "mocha": "^11.0.1", "ts-mocha": "^10.0.0", "tslint": "^6.1.3", "typescript": "^5.0.2" From 8c129893570e4d69d63f1c6f008fbd916fdee241 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Sun, 8 Dec 2024 21:24:24 -0800 Subject: [PATCH 2/4] use ts-mocha 11.0.1 --- finder/nodejs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/finder/nodejs/package.json b/finder/nodejs/package.json index f5c7ced6..5b6eae2c 100644 --- a/finder/nodejs/package.json +++ b/finder/nodejs/package.json @@ -34,7 +34,7 @@ "@types/node": "^22.0.0", "expect": "^29.2.0", "mocha": "^11.0.1", - "ts-mocha": "^10.0.0", + "ts-mocha": "^11.0.1", "tslint": "^6.1.3", "typescript": "^5.0.2" } From 53192788f7cce79a212f04b7580c557142339714 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Sun, 8 Dec 2024 21:27:06 -0800 Subject: [PATCH 3/4] bring ts-mocha back --- finder/nodejs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/finder/nodejs/package.json b/finder/nodejs/package.json index 5b6eae2c..f5c7ced6 100644 --- a/finder/nodejs/package.json +++ b/finder/nodejs/package.json @@ -34,7 +34,7 @@ "@types/node": "^22.0.0", "expect": "^29.2.0", "mocha": "^11.0.1", - "ts-mocha": "^11.0.1", + "ts-mocha": "^10.0.0", "tslint": "^6.1.3", "typescript": "^5.0.2" } From d1e837d811a60bb71b6c723f638b763df2f64c7f Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Sun, 8 Dec 2024 22:32:35 -0800 Subject: [PATCH 4/4] update types --- finder/nodejs/lib/base64url.ts | 11 +++++------ finder/nodejs/package.json | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/finder/nodejs/lib/base64url.ts b/finder/nodejs/lib/base64url.ts index 163a1c6e..c2e9a59d 100644 --- a/finder/nodejs/lib/base64url.ts +++ b/finder/nodejs/lib/base64url.ts @@ -1,4 +1,5 @@ const W3C_ELEMENT: string = `element-6066-11e4-a52e-4f735466cecf`; +const MJSON_ELEMENT: string = `ELEMENT`; export const encode = (input: string) => Buffer.from(input) @@ -7,16 +8,14 @@ export const encode = (input: string) => .replace(/\+/g, `-`) .replace(/\//g, `_`); -export const decode = (input: string | {ELEMENT: string}) => { +export const decode = (input: string | {[key: string]: string}) => { let base64String: string = ``; if (typeof input === `string`) { base64String = input; - // @ts-ignore - } else if (typeof input === `object` && input[W3C_ELEMENT]) { - // @ts-ignore + } else if (typeof input === `object` && W3C_ELEMENT in input) { base64String = input[W3C_ELEMENT]; - } else if (typeof input === `object` && input.ELEMENT) { - base64String = input.ELEMENT; + } else if (typeof input === `object` && MJSON_ELEMENT in input) { + base64String = input[MJSON_ELEMENT]; } else { throw new Error(`input is invalid ${JSON.stringify(input)}`); } diff --git a/finder/nodejs/package.json b/finder/nodejs/package.json index f5c7ced6..8e7fa8bd 100644 --- a/finder/nodejs/package.json +++ b/finder/nodejs/package.json @@ -21,7 +21,7 @@ "build" ], "scripts": { - "test": "ts-mocha lib/**/*_test.ts", + "test": "mocha --require ts-node/register lib/**/*_test.ts", "prepublishOnly": "cp ../../LICENSE ./", "prepare": "npm run clean && npm run compile", "clean": "rm -rf build", @@ -34,7 +34,7 @@ "@types/node": "^22.0.0", "expect": "^29.2.0", "mocha": "^11.0.1", - "ts-mocha": "^10.0.0", + "ts-node": "^10.9.2", "tslint": "^6.1.3", "typescript": "^5.0.2" }