@xyo-network/bip39 2.84.6 → 2.84.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "description": "Primary SDK for using XYO Protocol 2.0",
17
17
  "devDependencies": {
18
- "@xylabs/ts-scripts-yarn3": "^3.2.19",
19
- "@xylabs/tsconfig": "^3.2.19",
18
+ "@xylabs/ts-scripts-yarn3": "^3.2.24",
19
+ "@xylabs/tsconfig": "^3.2.24",
20
20
  "typescript": "^5.3.3"
21
21
  },
22
22
  "exports": {
@@ -47,7 +47,6 @@
47
47
  "main": "dist/node/index.cjs",
48
48
  "module": "dist/node/index.js",
49
49
  "types": "dist/node/index.d.mts",
50
- "type": "module",
51
50
  "homepage": "https://xyo.network",
52
51
  "license": "LGPL-3.0-only",
53
52
  "publishConfig": {
@@ -58,5 +57,6 @@
58
57
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
59
58
  },
60
59
  "sideEffects": false,
61
- "version": "2.84.6"
60
+ "version": "2.84.7",
61
+ "type": "module"
62
62
  }
package/src/index.ts CHANGED
@@ -11,7 +11,7 @@ import { utils as baseUtils } from '@scure/base'
11
11
  export * from './wordlists'
12
12
 
13
13
  // Japanese wordlist
14
- const isJapanese = (wordlist: string[]) => wordlist[0] === '\u3042\u3044\u3053\u304f\u3057\u3093'
14
+ const isJapanese = (wordlist: string[]) => wordlist[0] === '\u3042\u3044\u3053\u304F\u3057\u3093'
15
15
 
16
16
  // Normalization replaces equivalent sequences of characters
17
17
  // so that any two texts that are equivalent will be reduced
@@ -58,9 +58,9 @@ const calcChecksum = (entropy: Uint8Array) => {
58
58
  function getCoder(wordlist: string[]) {
59
59
  if (!Array.isArray(wordlist) || wordlist.length !== 2048 || typeof wordlist[0] !== 'string')
60
60
  throw new Error('Worlist: expected array of 2048 strings')
61
- wordlist.forEach((i) => {
61
+ for (const i of wordlist) {
62
62
  if (typeof i !== 'string') throw new Error(`Wordlist: non-string element: ${i}`)
63
- })
63
+ }
64
64
  return baseUtils.chain(baseUtils.checksum(1, calcChecksum), baseUtils.radix2(11, true), baseUtils.alphabet(wordlist))
65
65
  }
66
66
 
@@ -115,7 +115,7 @@ export function entropyToMnemonic(entropy: Uint8Array, wordlist: string[]): stri
115
115
  export function validateMnemonic(mnemonic: string, wordlist: string[]): boolean {
116
116
  try {
117
117
  mnemonicToEntropy(mnemonic, wordlist)
118
- } catch (e) {
118
+ } catch {
119
119
  return false
120
120
  }
121
121
  return true