mirror of
https://github.com/status-im/bip39.git
synced 2025-01-09 20:25:59 +00:00
commit
2b05db702c
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bip39",
|
"name": "bip39",
|
||||||
"version": "3.0.1",
|
"version": "3.0.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bip39",
|
"name": "bip39",
|
||||||
"version": "3.0.1",
|
"version": "3.0.2",
|
||||||
"description": "Bitcoin BIP39: Mnemonic code for generating deterministic keys",
|
"description": "Bitcoin BIP39: Mnemonic code for generating deterministic keys",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"types": "./types/index.d.ts",
|
"types": "./types/index.d.ts",
|
||||||
|
@ -3,28 +3,49 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
// browserify by default only pulls in files that are hard coded in requires
|
// browserify by default only pulls in files that are hard coded in requires
|
||||||
// In order of last to first in this file, the default wordlist will be chosen
|
// In order of last to first in this file, the default wordlist will be chosen
|
||||||
// based on what is present. (Bundles may remove wordlists they don't need)
|
// based on what is present. (Bundles may remove wordlists they don't need)
|
||||||
const wordlistFilenames = [
|
|
||||||
'chinese_simplified',
|
|
||||||
'chinese_traditional',
|
|
||||||
'korean',
|
|
||||||
'french',
|
|
||||||
'italian',
|
|
||||||
'spanish',
|
|
||||||
'japanese',
|
|
||||||
'english',
|
|
||||||
];
|
|
||||||
const wordlists = {};
|
const wordlists = {};
|
||||||
exports.wordlists = wordlists;
|
exports.wordlists = wordlists;
|
||||||
let _default;
|
let _default;
|
||||||
exports._default = _default;
|
exports._default = _default;
|
||||||
wordlistFilenames.forEach(lang => {
|
try {
|
||||||
try {
|
exports._default = _default = require('./wordlists/chinese_simplified.json');
|
||||||
exports._default = _default = require('./wordlists/' + lang + '.json');
|
wordlists.chinese_simplified = _default;
|
||||||
wordlists[lang] = _default;
|
}
|
||||||
if (lang === 'japanese')
|
catch (err) { }
|
||||||
wordlists.JA = _default;
|
try {
|
||||||
if (lang === 'english')
|
exports._default = _default = require('./wordlists/chinese_traditional.json');
|
||||||
wordlists.EN = _default;
|
wordlists.chinese_traditional = _default;
|
||||||
}
|
}
|
||||||
catch (err) { }
|
catch (err) { }
|
||||||
});
|
try {
|
||||||
|
exports._default = _default = require('./wordlists/korean.json');
|
||||||
|
wordlists.korean = _default;
|
||||||
|
}
|
||||||
|
catch (err) { }
|
||||||
|
try {
|
||||||
|
exports._default = _default = require('./wordlists/french.json');
|
||||||
|
wordlists.french = _default;
|
||||||
|
}
|
||||||
|
catch (err) { }
|
||||||
|
try {
|
||||||
|
exports._default = _default = require('./wordlists/italian.json');
|
||||||
|
wordlists.italian = _default;
|
||||||
|
}
|
||||||
|
catch (err) { }
|
||||||
|
try {
|
||||||
|
exports._default = _default = require('./wordlists/spanish.json');
|
||||||
|
wordlists.spanish = _default;
|
||||||
|
}
|
||||||
|
catch (err) { }
|
||||||
|
try {
|
||||||
|
exports._default = _default = require('./wordlists/japanese.json');
|
||||||
|
wordlists.japanese = _default;
|
||||||
|
wordlists.JA = _default;
|
||||||
|
}
|
||||||
|
catch (err) { }
|
||||||
|
try {
|
||||||
|
exports._default = _default = require('./wordlists/english.json');
|
||||||
|
wordlists.english = _default;
|
||||||
|
wordlists.EN = _default;
|
||||||
|
}
|
||||||
|
catch (err) { }
|
||||||
|
@ -1,26 +1,42 @@
|
|||||||
// browserify by default only pulls in files that are hard coded in requires
|
// browserify by default only pulls in files that are hard coded in requires
|
||||||
// In order of last to first in this file, the default wordlist will be chosen
|
// In order of last to first in this file, the default wordlist will be chosen
|
||||||
// based on what is present. (Bundles may remove wordlists they don't need)
|
// based on what is present. (Bundles may remove wordlists they don't need)
|
||||||
const wordlistFilenames: string[] = [
|
|
||||||
'chinese_simplified',
|
|
||||||
'chinese_traditional',
|
|
||||||
'korean',
|
|
||||||
'french',
|
|
||||||
'italian',
|
|
||||||
'spanish',
|
|
||||||
'japanese',
|
|
||||||
'english', // Last language available in list will be the default.
|
|
||||||
];
|
|
||||||
const wordlists: { [index: string]: string[] } = {};
|
const wordlists: { [index: string]: string[] } = {};
|
||||||
let _default: string[] | undefined;
|
let _default: string[] | undefined;
|
||||||
wordlistFilenames.forEach(lang => {
|
try {
|
||||||
try {
|
_default = require('./wordlists/chinese_simplified.json');
|
||||||
_default = require('./wordlists/' + lang + '.json');
|
wordlists.chinese_simplified = _default as string[];
|
||||||
wordlists[lang] = _default as string[];
|
} catch (err) {}
|
||||||
if (lang === 'japanese') wordlists.JA = _default as string[];
|
try {
|
||||||
if (lang === 'english') wordlists.EN = _default as string[];
|
_default = require('./wordlists/chinese_traditional.json');
|
||||||
} catch (err) {}
|
wordlists.chinese_traditional = _default as string[];
|
||||||
});
|
} catch (err) {}
|
||||||
|
try {
|
||||||
|
_default = require('./wordlists/korean.json');
|
||||||
|
wordlists.korean = _default as string[];
|
||||||
|
} catch (err) {}
|
||||||
|
try {
|
||||||
|
_default = require('./wordlists/french.json');
|
||||||
|
wordlists.french = _default as string[];
|
||||||
|
} catch (err) {}
|
||||||
|
try {
|
||||||
|
_default = require('./wordlists/italian.json');
|
||||||
|
wordlists.italian = _default as string[];
|
||||||
|
} catch (err) {}
|
||||||
|
try {
|
||||||
|
_default = require('./wordlists/spanish.json');
|
||||||
|
wordlists.spanish = _default as string[];
|
||||||
|
} catch (err) {}
|
||||||
|
try {
|
||||||
|
_default = require('./wordlists/japanese.json');
|
||||||
|
wordlists.japanese = _default as string[];
|
||||||
|
wordlists.JA = _default as string[];
|
||||||
|
} catch (err) {}
|
||||||
|
try {
|
||||||
|
_default = require('./wordlists/english.json');
|
||||||
|
wordlists.english = _default as string[];
|
||||||
|
wordlists.EN = _default as string[];
|
||||||
|
} catch (err) {}
|
||||||
|
|
||||||
// Last one to overwrite wordlist gets to be default.
|
// Last one to overwrite wordlist gets to be default.
|
||||||
export { wordlists, _default };
|
export { wordlists, _default };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user