Skip to content

Commit

Permalink
refactor: use punycode.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki committed Nov 23, 2024
1 parent c69c13b commit 59e350c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
12 changes: 2 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"@types/eslint__js": "^8.42.3",
"@types/get-stdin": "^7.0.0",
"@types/node": "22.9.2",
"@types/tr46": "^5.0.0",
"@vitest/coverage-v8": "^2.1.5",
"coveralls": "3.1.1",
"eslint": "^9.15.0",
Expand All @@ -86,6 +85,7 @@
},
"dependencies": {
"commander": "^12.1.0",
"get-stdin": "9.0.0"
"get-stdin": "9.0.0",
"punycode.js": "^2.3.1"
}
}
13 changes: 13 additions & 0 deletions src/@types/punycode.js.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
declare module "punycode.js" {
export function decode(input: string): string;
export function encode(input: string): string;
export function toUnicode(input: string): string;
export function toASCII(input: string): string;

export namespace ucs2 {
function decode(string: string): number[];
function encode(array: readonly number[]): string;
}

export const version: string;
}
2 changes: 1 addition & 1 deletion src/aux/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import punycode from "node:punycode";
import punycode from "punycode.js";

/**
* Reject duplications from an array
Expand Down

0 comments on commit 59e350c

Please sign in to comment.