@xyo-network/hash
Advanced tools
Comparing version 3.3.0 to 3.3.1
@@ -30,7 +30,29 @@ import type { Hash } from '@xylabs/hex'; | ||
static findByHash<T extends EmptyObject>(objs: T[] | undefined, hash: Hash): Promise<T | undefined>; | ||
/** | ||
* Asynchronously hashes a payload | ||
* @param obj A payload | ||
* @returns The payload hash | ||
*/ | ||
static hash<T extends EmptyObject>(obj: T): Promise<Hash>; | ||
static hashFields<T extends EmptyObject>(obj: T): T; | ||
/** | ||
* Creates an array of payload/hash tuples based on the payloads passed in | ||
* @param objs Any array of payloads | ||
* @returns An array of payload/hash tuples | ||
*/ | ||
static hashPairs<T extends EmptyObject>(objs: T[]): Promise<[T, Hash][]>; | ||
/** | ||
* Creates an array of payload hashes based on the payloads passed in | ||
* @param objs Any array of payloads | ||
* @returns An array of payload hashes | ||
*/ | ||
static hashes<T extends EmptyObject>(objs?: T[]): Promise<Hash[] | undefined>; | ||
/** | ||
* Returns a clone of the payload that is JSON safe | ||
* @param obj A payload | ||
* @param meta Keeps underscore (meta) fields if set to true | ||
* @returns Returns a clone of the payload that is JSON safe | ||
*/ | ||
static json<T extends EmptyObject>(payload: T, meta?: boolean): T; | ||
/** @deprecated us json instead */ | ||
static jsonPayload<T extends EmptyObject>(payload: T, meta?: boolean): T; | ||
@@ -42,4 +64,9 @@ static stringifyHashFields<T extends EmptyObject>(obj: T): string; | ||
hash(): Promise<Hash>; | ||
/** | ||
* Returns a clone of the payload that is JSON safe | ||
* @param meta Keeps underscore (meta) fields if set to true | ||
* @returns Returns a clone of the payload that is JSON safe | ||
*/ | ||
json(meta?: boolean): T; | ||
} | ||
//# sourceMappingURL=PayloadHasher.d.ts.map |
@@ -30,7 +30,29 @@ import type { Hash } from '@xylabs/hex'; | ||
static findByHash<T extends EmptyObject>(objs: T[] | undefined, hash: Hash): Promise<T | undefined>; | ||
/** | ||
* Asynchronously hashes a payload | ||
* @param obj A payload | ||
* @returns The payload hash | ||
*/ | ||
static hash<T extends EmptyObject>(obj: T): Promise<Hash>; | ||
static hashFields<T extends EmptyObject>(obj: T): T; | ||
/** | ||
* Creates an array of payload/hash tuples based on the payloads passed in | ||
* @param objs Any array of payloads | ||
* @returns An array of payload/hash tuples | ||
*/ | ||
static hashPairs<T extends EmptyObject>(objs: T[]): Promise<[T, Hash][]>; | ||
/** | ||
* Creates an array of payload hashes based on the payloads passed in | ||
* @param objs Any array of payloads | ||
* @returns An array of payload hashes | ||
*/ | ||
static hashes<T extends EmptyObject>(objs?: T[]): Promise<Hash[] | undefined>; | ||
/** | ||
* Returns a clone of the payload that is JSON safe | ||
* @param obj A payload | ||
* @param meta Keeps underscore (meta) fields if set to true | ||
* @returns Returns a clone of the payload that is JSON safe | ||
*/ | ||
static json<T extends EmptyObject>(payload: T, meta?: boolean): T; | ||
/** @deprecated us json instead */ | ||
static jsonPayload<T extends EmptyObject>(payload: T, meta?: boolean): T; | ||
@@ -42,4 +64,9 @@ static stringifyHashFields<T extends EmptyObject>(obj: T): string; | ||
hash(): Promise<Hash>; | ||
/** | ||
* Returns a clone of the payload that is JSON safe | ||
* @param meta Keeps underscore (meta) fields if set to true | ||
* @returns Returns a clone of the payload that is JSON safe | ||
*/ | ||
json(meta?: boolean): T; | ||
} | ||
//# sourceMappingURL=PayloadHasher.d.ts.map |
@@ -30,7 +30,29 @@ import type { Hash } from '@xylabs/hex'; | ||
static findByHash<T extends EmptyObject>(objs: T[] | undefined, hash: Hash): Promise<T | undefined>; | ||
/** | ||
* Asynchronously hashes a payload | ||
* @param obj A payload | ||
* @returns The payload hash | ||
*/ | ||
static hash<T extends EmptyObject>(obj: T): Promise<Hash>; | ||
static hashFields<T extends EmptyObject>(obj: T): T; | ||
/** | ||
* Creates an array of payload/hash tuples based on the payloads passed in | ||
* @param objs Any array of payloads | ||
* @returns An array of payload/hash tuples | ||
*/ | ||
static hashPairs<T extends EmptyObject>(objs: T[]): Promise<[T, Hash][]>; | ||
/** | ||
* Creates an array of payload hashes based on the payloads passed in | ||
* @param objs Any array of payloads | ||
* @returns An array of payload hashes | ||
*/ | ||
static hashes<T extends EmptyObject>(objs?: T[]): Promise<Hash[] | undefined>; | ||
/** | ||
* Returns a clone of the payload that is JSON safe | ||
* @param obj A payload | ||
* @param meta Keeps underscore (meta) fields if set to true | ||
* @returns Returns a clone of the payload that is JSON safe | ||
*/ | ||
static json<T extends EmptyObject>(payload: T, meta?: boolean): T; | ||
/** @deprecated us json instead */ | ||
static jsonPayload<T extends EmptyObject>(payload: T, meta?: boolean): T; | ||
@@ -42,4 +64,9 @@ static stringifyHashFields<T extends EmptyObject>(obj: T): string; | ||
hash(): Promise<Hash>; | ||
/** | ||
* Returns a clone of the payload that is JSON safe | ||
* @param meta Keeps underscore (meta) fields if set to true | ||
* @returns Returns a clone of the payload that is JSON safe | ||
*/ | ||
json(meta?: boolean): T; | ||
} | ||
//# sourceMappingURL=PayloadHasher.d.ts.map |
{ | ||
"name": "@xyo-network/hash", | ||
"version": "3.3.0", | ||
"version": "3.3.1", | ||
"description": "Primary SDK for using XYO Protocol 2.0", | ||
@@ -53,15 +53,15 @@ "homepage": "https://xyo.network", | ||
"dependencies": { | ||
"@xylabs/assert": "^4.2.2", | ||
"@xylabs/hex": "^4.2.2", | ||
"@xylabs/object": "^4.2.2", | ||
"@xylabs/platform": "^4.2.2", | ||
"@xylabs/threads": "^4.2.2", | ||
"@xylabs/typeof": "^4.2.2", | ||
"@xyo-network/wasm": "^3.3.0", | ||
"@xylabs/assert": "^4.3.2", | ||
"@xylabs/hex": "^4.3.2", | ||
"@xylabs/object": "^4.3.2", | ||
"@xylabs/platform": "^4.3.2", | ||
"@xylabs/threads": "^4.3.2", | ||
"@xylabs/typeof": "^4.3.2", | ||
"@xyo-network/wasm": "^3.3.1", | ||
"hash-wasm": "^4.11.0" | ||
}, | ||
"devDependencies": { | ||
"@xylabs/delay": "^4.2.2", | ||
"@xylabs/ts-scripts-yarn3": "^4.2.1", | ||
"@xylabs/tsconfig": "^4.2.1", | ||
"@xylabs/delay": "^4.3.2", | ||
"@xylabs/ts-scripts-yarn3": "^4.2.3", | ||
"@xylabs/tsconfig": "^4.2.3", | ||
"esbuild": "^0.24.0", | ||
@@ -68,0 +68,0 @@ "publint": "^0.2.11", |
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
435906
7775
Updated@xylabs/assert@^4.3.2
Updated@xylabs/hex@^4.3.2
Updated@xylabs/object@^4.3.2
Updated@xylabs/platform@^4.3.2
Updated@xylabs/threads@^4.3.2
Updated@xylabs/typeof@^4.3.2
Updated@xyo-network/wasm@^3.3.1