@xyo-network/hash
Advanced tools
Comparing version 2.77.14 to 2.77.15
@@ -113,2 +113,6 @@ // src/PayloadHasher.ts | ||
} | ||
/** @function jsonPayload Returns a clone of the payload that is JSON safe */ | ||
static jsonPayload(payload, meta = false) { | ||
return sortFields(removeEmptyFields(meta ? payload : deepOmitUnderscoreFields(payload))); | ||
} | ||
static stringifyHashFields(obj) { | ||
@@ -128,2 +132,6 @@ return JSON.stringify(this.hashFields(obj)); | ||
} | ||
/** @function jsonPayload Returns a clone of the payload that is JSON safe */ | ||
jsonPayload(meta = false) { | ||
return _PayloadHasher.jsonPayload(this.obj, meta); | ||
} | ||
}; | ||
@@ -130,0 +138,0 @@ export { |
@@ -16,2 +16,8 @@ import { AnyObject, ObjectWrapper } from '@xyo-network/object'; | ||
static hashes<T extends AnyObject>(objs: T[]): Promise<Hash[]>; | ||
/** @function jsonPayload Returns a clone of the payload that is JSON safe */ | ||
static jsonPayload<T extends AnyObject>( | ||
/** @param payload The payload to process */ | ||
payload: T, | ||
/** @param meta Keeps underscore (meta) fields if set to true */ | ||
meta?: boolean): T; | ||
static stringifyHashFields<T extends AnyObject>(obj: T): string; | ||
@@ -21,3 +27,7 @@ static toMap<T extends AnyObject>(objs: T[]): Promise<Record<Hash, T>>; | ||
hashSync(): Hash; | ||
/** @function jsonPayload Returns a clone of the payload that is JSON safe */ | ||
jsonPayload( | ||
/** @param meta Keeps underscore (meta) fields if set to true */ | ||
meta?: boolean): T; | ||
} | ||
//# sourceMappingURL=PayloadHasher.d.ts.map |
@@ -157,2 +157,6 @@ "use strict"; | ||
} | ||
/** @function jsonPayload Returns a clone of the payload that is JSON safe */ | ||
static jsonPayload(payload, meta = false) { | ||
return sortFields(removeEmptyFields(meta ? payload : deepOmitUnderscoreFields(payload))); | ||
} | ||
static stringifyHashFields(obj) { | ||
@@ -172,2 +176,6 @@ return JSON.stringify(this.hashFields(obj)); | ||
} | ||
/** @function jsonPayload Returns a clone of the payload that is JSON safe */ | ||
jsonPayload(meta = false) { | ||
return _PayloadHasher.jsonPayload(this.obj, meta); | ||
} | ||
}; | ||
@@ -174,0 +182,0 @@ // Annotate the CommonJS export names for ESM import in node: |
@@ -16,2 +16,8 @@ import { AnyObject, ObjectWrapper } from '@xyo-network/object'; | ||
static hashes<T extends AnyObject>(objs: T[]): Promise<Hash[]>; | ||
/** @function jsonPayload Returns a clone of the payload that is JSON safe */ | ||
static jsonPayload<T extends AnyObject>( | ||
/** @param payload The payload to process */ | ||
payload: T, | ||
/** @param meta Keeps underscore (meta) fields if set to true */ | ||
meta?: boolean): T; | ||
static stringifyHashFields<T extends AnyObject>(obj: T): string; | ||
@@ -21,3 +27,7 @@ static toMap<T extends AnyObject>(objs: T[]): Promise<Record<Hash, T>>; | ||
hashSync(): Hash; | ||
/** @function jsonPayload Returns a clone of the payload that is JSON safe */ | ||
jsonPayload( | ||
/** @param meta Keeps underscore (meta) fields if set to true */ | ||
meta?: boolean): T; | ||
} | ||
//# sourceMappingURL=PayloadHasher.d.ts.map |
@@ -17,5 +17,5 @@ { | ||
"@xylabs/platform": "^2.13.3", | ||
"@xyo-network/object": "~2.77.14", | ||
"@xyo-network/typeof": "~2.77.14", | ||
"@xyo-network/wasm": "~2.77.14", | ||
"@xyo-network/object": "~2.77.15", | ||
"@xyo-network/typeof": "~2.77.15", | ||
"@xyo-network/wasm": "~2.77.15", | ||
"hash-wasm": "^4.10.0", | ||
@@ -70,3 +70,3 @@ "sha.js": "^2.4.11" | ||
"types": "dist/node/index.d.ts", | ||
"version": "2.77.14" | ||
"version": "2.77.15" | ||
} |
@@ -77,2 +77,12 @@ import { base16 } from '@scure/base' | ||
/** @function jsonPayload Returns a clone of the payload that is JSON safe */ | ||
static jsonPayload<T extends AnyObject>( | ||
/** @param payload The payload to process */ | ||
payload: T, | ||
/** @param meta Keeps underscore (meta) fields if set to true */ | ||
meta = false, | ||
): T { | ||
return sortFields(removeEmptyFields(meta ? payload : deepOmitUnderscoreFields(payload))) | ||
} | ||
static stringifyHashFields<T extends AnyObject>(obj: T) { | ||
@@ -95,2 +105,10 @@ return JSON.stringify(this.hashFields(obj)) | ||
} | ||
/** @function jsonPayload Returns a clone of the payload that is JSON safe */ | ||
jsonPayload( | ||
/** @param meta Keeps underscore (meta) fields if set to true */ | ||
meta = false, | ||
): T { | ||
return PayloadHasher.jsonPayload(this.obj, meta) | ||
} | ||
} |
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
149795
878
Updated@xyo-network/object@~2.77.15
Updated@xyo-network/typeof@~2.77.15
Updated@xyo-network/wasm@~2.77.15