diff --git a/src/index.js b/src/index.js index 3d6d9a6..d19a3de 100644 --- a/src/index.js +++ b/src/index.js @@ -13,8 +13,6 @@ exports.isEncoded = isEncoded exports.names = Object.freeze(Object.keys(constants.names)) exports.codes = Object.freeze(Object.keys(constants.codes)) -const errNotSupported = new Error('Unsupported encoding') - /** * Create a new buffer with the multibase varint+code. * @@ -120,7 +118,7 @@ function getBase (nameOrCode) { } else if (constants.codes[nameOrCode]) { base = constants.codes[nameOrCode] } else { - throw errNotSupported + throw new Error('Unsupported encoding') } if (!base.isImplemented()) {