Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More →
Socket
Sign inDemoInstall
Socket

x-address-codec

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

x-address-codec - npm Package Compare versions

Comparing version 0.5.2 to 0.6.0

4

dist/npm/address-codec.js

@@ -115,3 +115,3 @@ 'use strict';

possibleVersions.some(function (version, i) {
var foundVersion = possibleVersions.some(function (version, i) {
var asArray = Array.isArray(version) ? version : [version];

@@ -128,3 +128,3 @@ if (seqEqual(versionBytes, asArray)) {

if (!ret.bytes) {
if (!foundVersion) {
throw new Error('version_invalid');

@@ -131,0 +131,0 @@ }

@@ -13,12 +13,24 @@ 'use strict';

function addMethods(codecMethods, api) {
function addVersion(name, args) {
function addVersion(name, opts) {
function add(operation) {
api[operation + name] = function (string) {
return api[operation](string, args);
var encode = operation === 'encode';
var func = api[operation + name] = function (arg, arg2) {
var params = opts;
if (arg2 && encode) {
params = { version: opts.versions[opts.versionTypes.indexOf(arg2)] };
}
return api[operation](arg, params);
};
return func;
}
add('decode');
if (!args.versions) {
add('encode');
}
var decode = add('decode');
add('encode');
api['validate' + name] = function (arg) {
try {
decode(arg);
} catch (e) {
return false;
}
return true;
};
}

@@ -25,0 +37,0 @@ for (var k in codecMethods) {

{
"name": "x-address-codec",
"version": "0.5.2",
"version": "0.6.0",
"description": "crypto currency address codec",

@@ -38,3 +38,3 @@ "files": [

"compile-with-source-maps": "babel -i runtime -s -t -d dist/npm/ src/",
"prepublish": "npm run compile",
"prepublish": "npm test && npm run lint && npm run compile",
"test": "istanbul test _mocha",

@@ -41,0 +41,0 @@ "coveralls": "cat ./coverage/lcov.info | coveralls",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡ī¸ by Socket Inc