Socket
Socket
Sign inDemoInstall

@xylabs/hex

Package Overview
Dependencies
Maintainers
5
Versions
109
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.5.3 to 3.5.4

2

dist/browser/address.d.ts
import { AssertConfig } from './assert';
import { Hex, HexConfig } from './hex';
export type Address = Exclude<Hex, 'reserved-address-value'>;
export declare const toAddress: (value: unknown, config?: HexConfig) => Lowercase<string>;
export declare const toAddress: (value: string | number | bigint | ArrayBuffer, config?: HexConfig) => Lowercase<string>;
export declare const isAddress: (value: unknown, config?: HexConfig) => value is Address;

@@ -6,0 +6,0 @@ export declare function asAddress(value: unknown): Address | undefined;

import { Hex, HexConfig } from '../model';
export declare const hexFrom: (value: unknown, config?: HexConfig) => Hex;
export declare const hexFrom: (value: string | number | bigint | ArrayBuffer, config?: HexConfig) => Hex;
//# sourceMappingURL=from.d.ts.map
import { HexConfig } from './model';
export declare const toHex: (value: unknown, config?: HexConfig) => Lowercase<string>;
export declare const toHex: (value: string | number | bigint | ArrayBuffer, config?: HexConfig) => Lowercase<string>;
//# sourceMappingURL=to.d.ts.map

@@ -12,5 +12,2 @@ // src/assert.ts

// src/hex/from/from.ts
import { isArrayBuffer } from "@xylabs/arraybuffer";
// src/hex/nibble.ts

@@ -83,7 +80,3 @@ var bitsToNibbles = (value) => {

case "object": {
if (isArrayBuffer(value)) {
return hexFromArrayBuffer(value, config);
} else {
throw new Error("Invalid type: object !== ArrayBuffer");
}
return hexFromArrayBuffer(value, config);
}

@@ -90,0 +83,0 @@ default: {

import { AssertConfig } from './assert';
import { Hex, HexConfig } from './hex';
export type Address = Exclude<Hex, 'reserved-address-value'>;
export declare const toAddress: (value: unknown, config?: HexConfig) => Lowercase<string>;
export declare const toAddress: (value: string | number | bigint | ArrayBuffer, config?: HexConfig) => Lowercase<string>;
export declare const isAddress: (value: unknown, config?: HexConfig) => value is Address;

@@ -6,0 +6,0 @@ export declare function asAddress(value: unknown): Address | undefined;

import { Hex, HexConfig } from '../model';
export declare const hexFrom: (value: unknown, config?: HexConfig) => Hex;
export declare const hexFrom: (value: string | number | bigint | ArrayBuffer, config?: HexConfig) => Hex;
//# sourceMappingURL=from.d.ts.map
import { HexConfig } from './model';
export declare const toHex: (value: unknown, config?: HexConfig) => Lowercase<string>;
export declare const toHex: (value: string | number | bigint | ArrayBuffer, config?: HexConfig) => Lowercase<string>;
//# sourceMappingURL=to.d.ts.map

@@ -12,5 +12,2 @@ // src/assert.ts

// src/hex/from/from.ts
import { isArrayBuffer } from "@xylabs/arraybuffer";
// src/hex/nibble.ts

@@ -83,7 +80,3 @@ var bitsToNibbles = (value) => {

case "object": {
if (isArrayBuffer(value)) {
return hexFromArrayBuffer(value, config);
} else {
throw new Error("Invalid type: object !== ArrayBuffer");
}
return hexFromArrayBuffer(value, config);
}

@@ -90,0 +83,0 @@ default: {

import { AssertConfig } from './assert';
import { Hex, HexConfig } from './hex';
export type Address = Exclude<Hex, 'reserved-address-value'>;
export declare const toAddress: (value: unknown, config?: HexConfig) => Lowercase<string>;
export declare const toAddress: (value: string | number | bigint | ArrayBuffer, config?: HexConfig) => Lowercase<string>;
export declare const isAddress: (value: unknown, config?: HexConfig) => value is Address;

@@ -6,0 +6,0 @@ export declare function asAddress(value: unknown): Address | undefined;

import { Hex, HexConfig } from '../model';
export declare const hexFrom: (value: unknown, config?: HexConfig) => Hex;
export declare const hexFrom: (value: string | number | bigint | ArrayBuffer, config?: HexConfig) => Hex;
//# sourceMappingURL=from.d.ts.map
import { HexConfig } from './model';
export declare const toHex: (value: unknown, config?: HexConfig) => Lowercase<string>;
export declare const toHex: (value: string | number | bigint | ArrayBuffer, config?: HexConfig) => Lowercase<string>;
//# sourceMappingURL=to.d.ts.map

@@ -12,5 +12,2 @@ // src/assert.ts

// src/hex/from/from.ts
import { isArrayBuffer } from "@xylabs/arraybuffer";
// src/hex/nibble.ts

@@ -83,7 +80,3 @@ var bitsToNibbles = (value) => {

case "object": {
if (isArrayBuffer(value)) {
return hexFromArrayBuffer(value, config);
} else {
throw new Error("Invalid type: object !== ArrayBuffer");
}
return hexFromArrayBuffer(value, config);
}

@@ -90,0 +83,0 @@ default: {

@@ -42,3 +42,3 @@ {

"dependencies": {
"@xylabs/arraybuffer": "^3.5.3"
"@xylabs/arraybuffer": "^3.5.4"
},

@@ -61,4 +61,4 @@ "devDependencies": {

"sideEffects": false,
"version": "3.5.3",
"version": "3.5.4",
"type": "module"
}

@@ -6,3 +6,3 @@ import { AssertConfig, assertError } from './assert'

export const toAddress = (value: unknown, config: HexConfig = {}) => {
export const toAddress = (value: string | number | bigint | ArrayBuffer, config: HexConfig = {}) => {
const { bitLength = 160, prefix = false } = config

@@ -9,0 +9,0 @@ return hexFrom(value, { bitLength, prefix, ...config })

@@ -1,3 +0,1 @@

import { isArrayBuffer } from '@xylabs/arraybuffer'
import { Hex, HexConfig } from '../model'

@@ -12,3 +10,3 @@ import { hexFromArrayBuffer } from './fromArrayBuffer'

/** Supported types are string, number, bigint, and ArrayBuffer */
value: unknown,
value: string | number | bigint | ArrayBuffer,
/** Configuration of output format and validation */

@@ -28,7 +26,3 @@ config?: HexConfig,

case 'object': {
if (isArrayBuffer(value)) {
return hexFromArrayBuffer(value, config)
} else {
throw new Error('Invalid type: object !== ArrayBuffer')
}
return hexFromArrayBuffer(value, config)
}

@@ -35,0 +29,0 @@ default: {

@@ -7,3 +7,3 @@ import { hexFrom } from './from'

/** Supported types are string, number, bigint, and ArrayBuffer */
value: unknown,
value: string | number | bigint | ArrayBuffer,
/** Configuration of output format and validation */

@@ -10,0 +10,0 @@ config: HexConfig = {},

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

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

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

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

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

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