@xylabs/hex
Advanced tools
Comparing version 3.6.12 to 4.0.0
@@ -1,4 +0,52 @@ | ||
export * from './address.ts'; | ||
export * from './hash.ts'; | ||
export * from './hex/index.ts'; | ||
//# sourceMappingURL=index.d.ts.map | ||
type AssertCallback = (value: unknown, message: string) => string | boolean; | ||
type AssertConfig = string | AssertCallback | boolean; | ||
type Hex = Exclude<Lowercase<string>, 'reserved-hex-value'>; | ||
interface HexConfig { | ||
bitLength?: number; | ||
byteSize?: number; | ||
prefix?: boolean; | ||
} | ||
declare function asHex(value: unknown): Hex | undefined; | ||
declare function asHex(value: unknown, assert: AssertConfig): Hex; | ||
declare const hexFrom: (value: string | number | bigint | ArrayBuffer, config?: HexConfig) => Hex; | ||
declare const hexFromArrayBuffer: (buffer: ArrayBuffer, config?: HexConfig) => Hex; | ||
declare const hexFromBigInt: (value: bigint, config?: HexConfig) => Hex; | ||
declare const hexFromHexString: (value: string, config?: HexConfig) => Hex; | ||
declare const hexFromNumber: (value: number, config?: HexConfig) => Hex; | ||
declare const isHex: (value: unknown, config?: HexConfig) => value is Hex; | ||
declare const isHexZero: (value?: string) => boolean | undefined; | ||
declare const toHexLegacy: (buffer: ArrayBuffer) => string; | ||
declare const bitsToNibbles: (value: number) => number; | ||
declare const nibblesToBits: (value: number) => number; | ||
declare const hexRegex: RegExp; | ||
declare const hexRegexWithPrefix: RegExp; | ||
declare const toHex: (value: string | number | bigint | ArrayBuffer, config?: HexConfig) => Lowercase<string>; | ||
type Address = Exclude<Hex, 'reserved-address-value'>; | ||
declare const toAddress: (value: string | number | bigint | ArrayBuffer, config?: HexConfig) => Lowercase<string>; | ||
declare const isAddress: (value: unknown, config?: HexConfig) => value is Address; | ||
declare function asAddress(value: unknown): Address | undefined; | ||
declare function asAddress(value: unknown, assert: AssertConfig): Address; | ||
type HashBitLength = 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096; | ||
declare const HashBitLength: HashBitLength[]; | ||
declare const isHashBitLength: (value: unknown) => value is HashBitLength; | ||
type Hash = Exclude<Hex, 'reserved-hash-value'>; | ||
declare const isHash: (value: unknown, bitLength?: HashBitLength) => value is Hash; | ||
declare function asHash(value: unknown): Hash | undefined; | ||
declare function asHash(value: unknown, assert: AssertConfig): Hash; | ||
export { type Address, type Hash, HashBitLength, type Hex, type HexConfig, asAddress, asHash, asHex, bitsToNibbles, hexFrom, hexFromArrayBuffer, hexFromBigInt, hexFromHexString, hexFromNumber, hexRegex, hexRegexWithPrefix, isAddress, isHash, isHashBitLength, isHex, isHexZero, nibblesToBits, toAddress, toHex, toHexLegacy }; |
@@ -19,14 +19,7 @@ { | ||
".": { | ||
"require": { | ||
"types": "./dist/neutral/index.d.cts", | ||
"default": "./dist/neutral/index.cjs" | ||
}, | ||
"import": { | ||
"types": "./dist/neutral/index.d.ts", | ||
"default": "./dist/neutral/index.mjs" | ||
} | ||
"types": "./dist/neutral/index.d.ts", | ||
"default": "./dist/neutral/index.mjs" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"main": "./dist/neutral/index.cjs", | ||
"types": "./dist/neutral/index.d.ts", | ||
@@ -43,4 +36,4 @@ "module": "./dist/neutral/index.mjs", | ||
"devDependencies": { | ||
"@xylabs/ts-scripts-yarn3": "^3.15.14", | ||
"@xylabs/tsconfig": "^3.15.14", | ||
"@xylabs/ts-scripts-yarn3": "^4.0.0-rc.15", | ||
"@xylabs/tsconfig": "^4.0.0-rc.15", | ||
"typescript": "^5.5.4" | ||
@@ -59,4 +52,4 @@ }, | ||
"sideEffects": false, | ||
"version": "3.6.12", | ||
"version": "4.0.0", | ||
"type": "module" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
41484
26
460
1