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

@xylabs/hex

Package Overview
Dependencies
Maintainers
7
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xylabs/hex - npm Package Compare versions

Comparing version 3.3.2 to 3.3.3

23

dist/browser/index.js

@@ -138,13 +138,18 @@ // src/assert.ts

function asAddress(value, assert) {
let stringValue = void 0;
switch (typeof value) {
case "string": {
stringValue = hexFromHexString(value, { prefix: false });
break;
try {
let stringValue = void 0;
switch (typeof value) {
case "string": {
stringValue = hexFromHexString(value, { prefix: false });
break;
}
default: {
return assert ? assertError(value, assert, `Unsupported type [${typeof value}]`) : void 0;
}
}
default: {
return assert ? assertError(value, assert, `Unsupported type [${typeof value}]`) : void 0;
}
return isAddress(stringValue) ? stringValue : assertError(value, assert, `Value is not an Address [${value}]`);
} catch (ex) {
const error = ex;
return assertError(void 0, assert, error.message);
}
return isAddress(stringValue) ? stringValue : assertError(value, assert, `Value is not an Address [${value}]`);
}

@@ -151,0 +156,0 @@

@@ -138,13 +138,18 @@ // src/assert.ts

function asAddress(value, assert) {
let stringValue = void 0;
switch (typeof value) {
case "string": {
stringValue = hexFromHexString(value, { prefix: false });
break;
try {
let stringValue = void 0;
switch (typeof value) {
case "string": {
stringValue = hexFromHexString(value, { prefix: false });
break;
}
default: {
return assert ? assertError(value, assert, `Unsupported type [${typeof value}]`) : void 0;
}
}
default: {
return assert ? assertError(value, assert, `Unsupported type [${typeof value}]`) : void 0;
}
return isAddress(stringValue) ? stringValue : assertError(value, assert, `Value is not an Address [${value}]`);
} catch (ex) {
const error = ex;
return assertError(void 0, assert, error.message);
}
return isAddress(stringValue) ? stringValue : assertError(value, assert, `Value is not an Address [${value}]`);
}

@@ -151,0 +156,0 @@

@@ -138,13 +138,18 @@ // src/assert.ts

function asAddress(value, assert) {
let stringValue = void 0;
switch (typeof value) {
case "string": {
stringValue = hexFromHexString(value, { prefix: false });
break;
try {
let stringValue = void 0;
switch (typeof value) {
case "string": {
stringValue = hexFromHexString(value, { prefix: false });
break;
}
default: {
return assert ? assertError(value, assert, `Unsupported type [${typeof value}]`) : void 0;
}
}
default: {
return assert ? assertError(value, assert, `Unsupported type [${typeof value}]`) : void 0;
}
return isAddress(stringValue) ? stringValue : assertError(value, assert, `Value is not an Address [${value}]`);
} catch (ex) {
const error = ex;
return assertError(void 0, assert, error.message);
}
return isAddress(stringValue) ? stringValue : assertError(value, assert, `Value is not an Address [${value}]`);
}

@@ -151,0 +156,0 @@

@@ -42,7 +42,7 @@ {

"dependencies": {
"@xylabs/arraybuffer": "~3.3.2"
"@xylabs/arraybuffer": "~3.3.3"
},
"devDependencies": {
"@xylabs/ts-scripts-yarn3": "^3.10.0",
"@xylabs/tsconfig": "^3.10.0",
"@xylabs/ts-scripts-yarn3": "^3.10.4",
"@xylabs/tsconfig": "^3.10.4",
"typescript": "^5.4.5"

@@ -61,4 +61,4 @@ },

"sideEffects": false,
"version": "3.3.2",
"version": "3.3.3",
"type": "module"
}

@@ -19,14 +19,19 @@ import { AssertConfig, assertError } from './assert'

export function asAddress(value: unknown, assert?: AssertConfig): Address | undefined {
let stringValue: string | undefined = undefined
try {
let stringValue: string | undefined = undefined
switch (typeof value) {
case 'string': {
stringValue = hexFromHexString(value, { prefix: false })
break
switch (typeof value) {
case 'string': {
stringValue = hexFromHexString(value, { prefix: false })
break
}
default: {
return assert ? assertError(value, assert, `Unsupported type [${typeof value}]`) : undefined
}
}
default: {
return assert ? assertError(value, assert, `Unsupported type [${typeof value}]`) : undefined
}
return isAddress(stringValue) ? stringValue : assertError(value, assert, `Value is not an Address [${value}]`)
} catch (ex) {
const error = ex as Error
return assertError(undefined, assert, error.message)
}
return isAddress(stringValue) ? stringValue : assertError(value, assert, `Value is not an Address [${value}]`)
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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