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

@erebos/hex

Package Overview
Dependencies
Maintainers
6
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@erebos/hex - npm Package Compare versions

Comparing version 0.11.0 to 0.12.0

60

cjs/index.js

@@ -42,2 +42,6 @@ "use strict";

function () {
Hex.from = function from(input) {
return new Hex(input);
};
function Hex(inputValue) {

@@ -57,30 +61,28 @@ (0, _defineProperty2.default)(this, "input", void 0);

this.hexValue = inputValue;
} else if (typeof inputValue === 'string') {
this.input = {
type: 'string',
value: inputValue
};
this.hexValue = toHexValue(inputValue);
} else if (Array.isArray(inputValue)) {
this.input = {
type: 'bytesArray',
value: inputValue
};
this.hexValue = toHexValue(inputValue);
} else if (Buffer.isBuffer(inputValue)) {
this.input = {
type: 'buffer',
value: inputValue
};
this.hexValue = toHexValue(inputValue);
} else if (typeof inputValue === 'object') {
this.input = {
type: 'object',
value: inputValue
};
this.hexValue = toHexValue(JSON.stringify(inputValue));
} else {
if (typeof inputValue === 'string') {
this.input = {
type: 'string',
value: inputValue
};
this.hexValue = toHexValue(inputValue);
} else if (Array.isArray(inputValue)) {
this.input = {
type: 'bytesArray',
value: inputValue
};
this.hexValue = toHexValue(inputValue);
} else if (Buffer.isBuffer(inputValue)) {
this.input = {
type: 'buffer',
value: inputValue
};
this.hexValue = toHexValue(inputValue);
} else if (typeof inputValue === 'object') {
this.input = {
type: 'object',
value: inputValue
};
this.hexValue = toHexValue(JSON.stringify(inputValue));
} else {
throw new Error('Invalid input');
}
throw new Error('Invalid input');
}

@@ -92,3 +94,3 @@ }

_proto.equals = function equals(other) {
return new Hex(other).value === this.hexValue;
return Hex.from(other).value === this.hexValue;
};

@@ -158,3 +160,3 @@

function createHex(input) {
return new Hex(input);
return Hex.from(input);
}

@@ -26,2 +26,6 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";

function () {
Hex.from = function from(input) {
return new Hex(input);
};
function Hex(inputValue) {

@@ -42,30 +46,28 @@ _defineProperty(this, "input", void 0);

this.hexValue = inputValue;
} else if (typeof inputValue === 'string') {
this.input = {
type: 'string',
value: inputValue
};
this.hexValue = toHexValue(inputValue);
} else if (Array.isArray(inputValue)) {
this.input = {
type: 'bytesArray',
value: inputValue
};
this.hexValue = toHexValue(inputValue);
} else if (Buffer.isBuffer(inputValue)) {
this.input = {
type: 'buffer',
value: inputValue
};
this.hexValue = toHexValue(inputValue);
} else if (typeof inputValue === 'object') {
this.input = {
type: 'object',
value: inputValue
};
this.hexValue = toHexValue(JSON.stringify(inputValue));
} else {
if (typeof inputValue === 'string') {
this.input = {
type: 'string',
value: inputValue
};
this.hexValue = toHexValue(inputValue);
} else if (Array.isArray(inputValue)) {
this.input = {
type: 'bytesArray',
value: inputValue
};
this.hexValue = toHexValue(inputValue);
} else if (Buffer.isBuffer(inputValue)) {
this.input = {
type: 'buffer',
value: inputValue
};
this.hexValue = toHexValue(inputValue);
} else if (typeof inputValue === 'object') {
this.input = {
type: 'object',
value: inputValue
};
this.hexValue = toHexValue(JSON.stringify(inputValue));
} else {
throw new Error('Invalid input');
}
throw new Error('Invalid input');
}

@@ -77,3 +79,3 @@ }

_proto.equals = function equals(other) {
return new Hex(other).value === this.hexValue;
return Hex.from(other).value === this.hexValue;
};

@@ -141,3 +143,3 @@

export function createHex(input) {
return new Hex(input);
return Hex.from(input);
}
{
"name": "@erebos/hex",
"version": "0.11.0",
"version": "0.12.0",
"description": "Hex conversion utilities",

@@ -27,4 +27,4 @@ "repository": "git@github.com:MainframeHQ/erebos.git",

"dependencies": {
"@babel/runtime": "^7.7.4"
"@babel/runtime": "^7.7.6"
}
}

@@ -27,2 +27,3 @@ /// <reference types="node" />

export declare class Hex {
static from(input: hexInput | Hex): Hex;
protected input: HexInput;

@@ -29,0 +30,0 @@ protected hexValue: hexValue;

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