Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from bitcoinjs/tsAllowExclude
Allow excluding wordlists when building for browserify
- Loading branch information
Showing
12 changed files
with
237 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// 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 | ||
// 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 = {}; | ||
exports.wordlists = wordlists; | ||
let _default; | ||
exports._default = _default; | ||
wordlistFilenames.forEach(lang => { | ||
try { | ||
exports._default = _default = require('./wordlists/' + lang + '.json'); | ||
wordlists[lang] = _default; | ||
if (lang === 'japanese') | ||
wordlists.JA = _default; | ||
if (lang === 'english') | ||
wordlists.EN = _default; | ||
} | ||
catch (err) { } | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// 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 | ||
// 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[] } = {}; | ||
let _default: string[] | undefined; | ||
wordlistFilenames.forEach(lang => { | ||
try { | ||
_default = require('./wordlists/' + lang + '.json'); | ||
wordlists[lang] = _default as string[]; | ||
if (lang === 'japanese') wordlists.JA = _default as string[]; | ||
if (lang === 'english') wordlists.EN = _default as string[]; | ||
} catch (err) {} | ||
}); | ||
|
||
// Last one to overwrite wordlist gets to be default. | ||
export { wordlists, _default }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare const wordlists: { | ||
[index: string]: string[]; | ||
}; | ||
declare let _default: string[] | undefined; | ||
export { wordlists, _default }; |
Oops, something went wrong.