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

@xylabs/hex

Package Overview
Dependencies
Maintainers
5
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.6.12 to 4.0.0

xy.config.ts

56

dist/neutral/index.d.ts

@@ -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 };

17

package.json

@@ -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"
}
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