Skip to content

Commit

Permalink
chore: build and formatted code
Browse files Browse the repository at this point in the history
  • Loading branch information
Nesopie committed Aug 18, 2024
1 parent 9b708fb commit cc756cc
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [14, 'lts/*']
node-version: [18, 'lts/*']
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
Expand Down
5 changes: 3 additions & 2 deletions src/cjs/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21474,7 +21474,9 @@ function generateMnemonic(strength, rng, wordlist) {
if (strength % 32 !== 0) {
throw new TypeError(INVALID_ENTROPY);
}
rng = rng || ((size) => crypto.getRandomValues(new Uint8Array(size)));
rng =
rng ||
((size) => crypto.getRandomValues(new Uint8Array(size)));
return entropyToMnemonic(rng(strength / 8), wordlist);
}
function validateMnemonic(mnemonic, wordlist) {
Expand All @@ -21497,7 +21499,6 @@ function validateWordlist(wordlist) {
if (unique.size !== wordlist.length) {
return false;
}
console.log("hi");
return true;
}
function setDefaultWordlist(wordlist) {
Expand Down
2 changes: 1 addition & 1 deletion src/cjs/index.cjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/cjs/index.d.ts.map

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

2 changes: 1 addition & 1 deletion src/esm/index.d.ts.map

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

5 changes: 3 additions & 2 deletions src/esm/index.js

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

2 changes: 1 addition & 1 deletion src/esm/index.js.map

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions ts_src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ export function generateMnemonic(
if (strength % 32 !== 0) {
throw new TypeError(INVALID_ENTROPY);
}
rng = rng || ((size: number): Uint8Array => crypto.getRandomValues(new Uint8Array(size)));
rng =
rng ||
((size: number): Uint8Array =>
crypto.getRandomValues(new Uint8Array(size)));
return entropyToMnemonic(rng(strength / 8), wordlist);
}

Expand All @@ -191,16 +194,16 @@ function validateWordlist(wordlist: string[]): boolean {
if (!Array.isArray(wordlist)) {
return false;
}

if (wordlist.length !== 2048) {
return false;
}

const unique = new Set(wordlist);
if (unique.size !== wordlist.length) {
return false;
}

return true;
}

Expand Down

0 comments on commit cc756cc

Please sign in to comment.