2018-06-21 03:29:54 +03:00
|
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
// This gets overriddenby gulp during bip39-XX
|
|
|
|
var exportWordlist = false;
|
|
|
|
var properties_1 = require("../utils/properties");
|
|
|
|
var Wordlist = /** @class */ (function () {
|
|
|
|
function Wordlist(locale) {
|
|
|
|
properties_1.defineReadOnly(this, 'locale', locale);
|
|
|
|
}
|
|
|
|
// Subclasses may override this
|
|
|
|
Wordlist.prototype.split = function (mnemonic) {
|
|
|
|
return mnemonic.toLowerCase().split(/ +/g);
|
|
|
|
};
|
|
|
|
// Subclasses may override this
|
|
|
|
Wordlist.prototype.join = function (words) {
|
|
|
|
return words.join(' ');
|
|
|
|
};
|
|
|
|
return Wordlist;
|
|
|
|
}());
|
|
|
|
exports.Wordlist = Wordlist;
|
|
|
|
function register(lang) {
|
|
|
|
if (exportWordlist) {
|
2018-06-23 03:30:50 +03:00
|
|
|
if (!global.wordlists) {
|
2018-06-21 03:29:54 +03:00
|
|
|
properties_1.defineReadOnly(global, 'wordlists', {});
|
|
|
|
}
|
2018-06-23 03:30:50 +03:00
|
|
|
properties_1.defineReadOnly(global.wordlists, lang.locale, lang);
|
2018-06-21 03:29:54 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.register = register;
|