@xylabs/hex
Advanced tools
Comparing version 3.0.1 to 3.0.2
import { AssertConfig } from './assert'; | ||
import { Hex, HexConfig } from './hex'; | ||
export type Address = Hex; | ||
export type Address = Exclude<Hex, 'reserved-address-value'>; | ||
export declare const toAddress: (value: unknown, config?: HexConfig) => Lowercase<string>; | ||
@@ -5,0 +5,0 @@ export declare const isAddress: (value: unknown, bitLength?: number) => value is Lowercase<string>; |
@@ -6,3 +6,3 @@ import { AssertConfig } from './assert'; | ||
export declare const isHashBitLength: (value: unknown) => value is HashBitLength; | ||
export type Hash = Hex; | ||
export type Hash = Exclude<Hex, 'reserved-hash-value'>; | ||
export declare const isHash: (value: unknown, bitLength?: HashBitLength) => value is Lowercase<string>; | ||
@@ -9,0 +9,0 @@ export declare function asHash(value: unknown): Hash | undefined; |
@@ -1,2 +0,2 @@ | ||
export type Hex = Lowercase<string>; | ||
export type Hex = Exclude<Lowercase<string>, 'reserved-hex-value'>; | ||
export interface HexConfig { | ||
@@ -3,0 +3,0 @@ bitLength?: number; |
import { AssertConfig } from './assert'; | ||
import { Hex, HexConfig } from './hex'; | ||
export type Address = Hex; | ||
export type Address = Exclude<Hex, 'reserved-address-value'>; | ||
export declare const toAddress: (value: unknown, config?: HexConfig) => Lowercase<string>; | ||
@@ -5,0 +5,0 @@ export declare const isAddress: (value: unknown, bitLength?: number) => value is Lowercase<string>; |
@@ -6,3 +6,3 @@ import { AssertConfig } from './assert'; | ||
export declare const isHashBitLength: (value: unknown) => value is HashBitLength; | ||
export type Hash = Hex; | ||
export type Hash = Exclude<Hex, 'reserved-hash-value'>; | ||
export declare const isHash: (value: unknown, bitLength?: HashBitLength) => value is Lowercase<string>; | ||
@@ -9,0 +9,0 @@ export declare function asHash(value: unknown): Hash | undefined; |
@@ -1,2 +0,2 @@ | ||
export type Hex = Lowercase<string>; | ||
export type Hex = Exclude<Lowercase<string>, 'reserved-hex-value'>; | ||
export interface HexConfig { | ||
@@ -3,0 +3,0 @@ bitLength?: number; |
@@ -42,3 +42,3 @@ { | ||
"dependencies": { | ||
"@xylabs/arraybuffer": "~3.0.1" | ||
"@xylabs/arraybuffer": "~3.0.2" | ||
}, | ||
@@ -61,4 +61,4 @@ "devDependencies": { | ||
"sideEffects": false, | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"type": "module" | ||
} |
import { AssertConfig, assertError } from './assert' | ||
import { Hex, HexConfig, hexFrom, hexFromHexString, isHex } from './hex' | ||
export type Address = Hex | ||
export type Address = Exclude<Hex, 'reserved-address-value'> | ||
@@ -6,0 +6,0 @@ export const toAddress = (value: unknown, config: HexConfig = {}) => { |
@@ -11,3 +11,3 @@ import { AssertConfig, assertError } from './assert' | ||
export type Hash = Hex | ||
export type Hash = Exclude<Hex, 'reserved-hash-value'> | ||
export const isHash = (value: unknown, bitLength: HashBitLength = 256): value is Hash => { | ||
@@ -14,0 +14,0 @@ return isHex(value, { bitLength }) |
@@ -1,2 +0,3 @@ | ||
export type Hex = Lowercase<string> | ||
//we use Exclude to intentionally make the type not equal to string | ||
export type Hex = Exclude<Lowercase<string>, 'reserved-hex-value'> | ||
@@ -3,0 +4,0 @@ export interface 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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
137320
1070
Updated@xylabs/arraybuffer@~3.0.2