Skip to content

Commit

Permalink
chore(deps-dev): bump mocha from 10.8.2 to 11.0.1 in /finder/nodejs (#…
Browse files Browse the repository at this point in the history
…757)

* 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](mochajs/mocha@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] <support@github.com>

* use ts-mocha 11.0.1

* bring ts-mocha back

* update types

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kazuaki Matsuo <fly.49.89.over@gmail.com>
  • Loading branch information
dependabot[bot] and KazuCocoa authored Dec 9, 2024
1 parent a759f6f commit 67ce86f
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions finder/nodejs/lib/base64url.ts
Original file line number Diff line number Diff line change
@@ -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)}`);
}
6 changes: 3 additions & 3 deletions finder/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -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",
@@ -33,8 +33,8 @@
"@types/mocha": "^10.0.0",
"@types/node": "^22.0.0",
"expect": "^29.2.0",
"mocha": "^10.0.0",
"ts-mocha": "^10.0.0",
"mocha": "^11.0.1",
"ts-node": "^10.9.2",
"tslint": "^6.1.3",
"typescript": "^5.0.2"
}

0 comments on commit 67ce86f

Please sign in to comment.