From f3be9710a4b4f364bdfc44afebe403dff1a96d5d Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Fri, 10 May 2019 19:08:34 +0700 Subject: [PATCH] Don't wrap format objects in a map --- src/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/index.js b/src/index.js index 6294057..36741d6 100644 --- a/src/index.js +++ b/src/index.js @@ -2,22 +2,22 @@ const Emitter = require('tiny-emitter'); const ONE_SECOND = 1000; -const keyFormats = new Map(Object.entries({ +const keyFormats = { wif: require('./key-formats/wif'), bip39: require('./key-formats/bip39') -})); +}; -const addressFormats = new Map(Object.entries({ +const addressFormats = { p2pkh: require('./address-formats/p2pkh'), 'p2wpkh-p2sh': require('./address-formats/p2wpkh-p2sh'), p2wpkh: require('./address-formats/p2wpkh') -})); +}; class Vain extends Emitter { constructor({keyFormat = 'wif', addressFormat = 'p2pkh', prefix}) { super(); - this.generateKey = keyFormats.get(keyFormat); - this.addressFormat = addressFormats.get(addressFormat); + this.generateKey = keyFormats[keyFormat]; + this.addressFormat = addressFormats[addressFormat]; if (typeof prefix !== 'string' || prefix.length === 0) { throw new Error('Prefix must be set');