Launch Week Day 5: Introducing Reachability for PHP.Learn More
Socket
Book a DemoSign in
Socket

node-object-hash

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-object-hash - npm Package Compare versions

Comparing version
2.3.10
to
3.0.0
+42
-45
dist/hasher.d.ts
/// <reference types="node" />
import objectSorter from './objectSorter';
import { BinaryToTextEncoding } from 'crypto';
declare namespace hasher {
import type { BinaryToTextEncoding } from 'crypto';
import type { SorterOptions } from './objectSorter';
/**
* Object hasher options
*/
export interface HasherOptions extends SorterOptions {
/**
* Object hasher options
* Hash algorithm to use
* @default 'sha256'
*/
interface HasherOptions extends objectSorter.SorterOptions {
/**
* Hash algorithm to use
* @default 'sha256'
*/
alg?: string;
/**
* String encoding for hash
* @default 'hex'
*/
enc?: BinaryToTextEncoding;
}
alg?: string;
/**
* If object implements Hashable interface then value from toHash
* will be used for hash function. It means that the different objects
* with the function toHash that return the same value will have the same hash
* String encoding for hash
* @default 'hex'
*/
interface Hashable {
toHashableString: () => string;
}
interface Hasher {
/**
* Create hash of an object
* @param object source object
* @returns hash string of an object
*/
hash(object: Hashable | any, opts?: hasher.HasherOptions): string;
/**
* Create sorted string from an object
* @param object source object
* @returns sorted string from an object
*/
sort(object: any): string;
/**
* Create sorted string from an object
* @param object source object
* @returns sorted string from an object
* @alias sort
*/
sortObject(object: any): string;
}
enc?: BinaryToTextEncoding;
}
/**
* If object implements Hashable interface then value from toHash
* will be used for hash function. It means that the different objects
* with the function toHash that return the same value will have the same hash
*/
export interface Hashable {
toHashableString: () => string;
}
export interface Hasher<T = unknown> {
/**
* Create hash of an object
* @param object source object
* @returns hash string of an object
*/
hash(object: Hashable | T, opts?: HasherOptions): string;
/**
* Create sorted string from an object
* @param object source object
* @returns sorted string from an object
*/
sort(object: T): string;
/**
* Create sorted string from an object
* @param object source object
* @returns sorted string from an object
* @alias sort
*/
sortObject(object: T): string;
}
/**
* Hasher constructor

@@ -55,4 +53,3 @@ * @param options hasher options

*/
declare function hasher(options?: hasher.HasherOptions): hasher.Hasher;
export = hasher;
export declare const hasher: (options?: HasherOptions) => Hasher;
//# sourceMappingURL=hasher.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"hasher.d.ts","sourceRoot":"","sources":["../src/hasher.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAe,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAYtD,kBAAU,MAAM,CAAC;IACf;;OAEG;IACH,UAAiB,aAAc,SAAQ,YAAY,CAAC,aAAa;QAC/D;;;WAGG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;QACb;;;WAGG;QACH,GAAG,CAAC,EAAE,oBAAoB,CAAC;KAC5B;IAED;;;;OAIG;IACH,UAAiB,QAAQ;QACvB,gBAAgB,EAAE,MAAM,MAAM,CAAC;KAChC;IAED,UAAiB,MAAM;QACrB;;;;WAIG;QACH,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC;QAClE;;;;WAIG;QACH,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAAC;QAC1B;;;;;WAKG;QACH,UAAU,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAAC;KACjC;CACF;AAED;;;;GAIG;AACH,iBAAS,MAAM,CAAC,OAAO,GAAE,MAAM,CAAC,aAAkB,GAAG,MAAM,CAAC,MAAM,CAsBjE;AAED,SAAS,MAAM,CAAC"}
{"version":3,"file":"hasher.d.ts","sourceRoot":"","sources":["../src/hasher.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAGnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAYpD;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,oBAAoB,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,gBAAgB,EAAE,MAAM,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,MAAM,CAAC,CAAC,GAAG,OAAO;IACjC;;;;OAIG;IACH,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;IACzD;;;;OAIG;IACH,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,CAAC;IACxB;;;;;OAKG;IACH,UAAU,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,CAAC;CAC/B;AAED;;;;GAIG;AACH,eAAO,MAAM,MAAM,aAAc,aAAa,KAAG,MAsBhD,CAAC"}
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var objectSorter_1 = __importDefault(require("./objectSorter"));
var crypto_1 = __importDefault(require("crypto"));
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasher = void 0;
const node_crypto_1 = require("node:crypto");
const objectSorter_1 = require("./objectSorter");
/**
* Default hash algorithm
*/
var DEFAULT_ALG = 'sha256';
const DEFAULT_ALG = 'sha256';
/**
* Default hash string enoding
*/
var DEFAULT_ENC = 'hex';
const DEFAULT_ENC = 'hex';
/**

@@ -20,5 +19,4 @@ * Hasher constructor

*/
function hasher(options) {
if (options === void 0) { options = {}; }
var sortObject = (0, objectSorter_1.default)(options);
const hasher = (options) => {
const sortObject = (0, objectSorter_1.objectSorter)(options);
/**

@@ -30,16 +28,15 @@ * Object hash function

*/
function hashObject(obj, opts) {
if (opts === void 0) { opts = {}; }
var alg = opts.alg || options.alg || DEFAULT_ALG;
var enc = opts.enc || options.enc || DEFAULT_ENC;
var sorted = sortObject(obj);
return crypto_1.default.createHash(alg).update(sorted).digest(enc);
}
const hash = (obj, opts) => {
const alg = opts?.alg || options?.alg || DEFAULT_ALG;
const enc = opts?.enc || options?.enc || DEFAULT_ENC;
const sorted = sortObject(obj);
return (0, node_crypto_1.createHash)(alg).update(sorted).digest(enc);
};
return {
hash: hashObject,
hash,
sort: sortObject,
sortObject: sortObject,
sortObject,
};
}
module.exports = hasher;
};
exports.hasher = hasher;
//# sourceMappingURL=hasher.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"hasher.js","sourceRoot":"","sources":["../src/hasher.ts"],"names":[],"mappings":";;;;AAAA,gEAA0C;AAC1C,kDAAsD;AAGtD;;GAEG;AACH,IAAM,WAAW,GAAG,QAAQ,CAAC;AAC7B;;GAEG;AACH,IAAM,WAAW,GAAyB,KAAK,CAAC;AAmDhD;;;;GAIG;AACH,SAAS,MAAM,CAAC,OAAkC;IAAlC,wBAAA,EAAA,YAAkC;IAChD,IAAM,UAAU,GAAG,IAAA,sBAAY,EAAC,OAAO,CAAC,CAAC;IAEzC;;;;;OAKG;IACH,SAAS,UAAU,CAAC,GAAmB,EAAE,IAA+B;QAA/B,qBAAA,EAAA,SAA+B;QACtE,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,IAAI,WAAW,CAAC;QACnD,IAAM,GAAG,GAAyB,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,IAAI,WAAW,CAAC;QACzE,IAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;QAE/B,OAAO,gBAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC3D,CAAC;IAED,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,UAAU;QAChB,UAAU,YAAA;KACX,CAAC;AACJ,CAAC;AAED,iBAAS,MAAM,CAAC"}
{"version":3,"file":"hasher.js","sourceRoot":"","sources":["../src/hasher.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AAGzC,iDAA8C;AAE9C;;GAEG;AACH,MAAM,WAAW,GAAG,QAAQ,CAAC;AAC7B;;GAEG;AACH,MAAM,WAAW,GAAyB,KAAK,CAAC;AAiDhD;;;;GAIG;AACI,MAAM,MAAM,GAAG,CAAC,OAAuB,EAAU,EAAE;IACxD,MAAM,UAAU,GAAG,IAAA,2BAAY,EAAC,OAAO,CAAC,CAAC;IAEzC;;;;;OAKG;IACH,MAAM,IAAI,GAAG,CAAI,GAAiB,EAAE,IAAoB,EAAU,EAAE;QAClE,MAAM,GAAG,GAAG,IAAI,EAAE,GAAG,IAAI,OAAO,EAAE,GAAG,IAAI,WAAW,CAAC;QACrD,MAAM,GAAG,GAAyB,IAAI,EAAE,GAAG,IAAI,OAAO,EAAE,GAAG,IAAI,WAAW,CAAC;QAC3E,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;QAE/B,OAAO,IAAA,wBAAU,EAAC,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC,CAAC;IAEF,OAAO;QACL,IAAI;QACJ,IAAI,EAAE,UAAU;QAChB,UAAU;KACX,CAAC;AACJ,CAAC,CAAC;AAtBW,QAAA,MAAM,UAsBjB"}

@@ -1,182 +0,180 @@

import { Hashable } from './hasher';
declare namespace objectSorter {
import type { Hashable } from './hasher';
/**
* Advanced coerce options
*/
export interface CoerceOptions {
/**
* Advanced coerce options
* If `true` converts booleans to string `1` and `0`
* @example
* // coerce.boolean = true
* true === 1;
* false === '0';
* @example
* // coerce.boolean = true
* true !== 1;
* false !== '0'
* @default true
*/
interface CoerceOptions {
/**
* If `true` converts booleans to string `1` and `0`
* @example
* // coerce.boolean = true
* true === 1;
* false === '0';
* @example
* // coerce.boolean = true
* true !== 1;
* false !== '0'
* @default true
*/
boolean?: boolean;
/**
* If `true` converts numbers to strings
* @example
* // coerce.number = true
* 1 === '1';
* @example
* // coerce.number = false
* 1 !== '1';
* @default true
*/
number?: boolean;
/**
* If `true` converts BigInt to string
* @example
* // coerce.bigint = true
* 1n === '1';
* @example
* // coerce.bigint = false
* 1n !== '1';
* @default true
*/
bigint?: boolean;
/**
* If `true` strings and coerced string will be equal to coerced numbers, booleans, etc
* @example
* // coerce.string = true
* '1' === true
* @example
* // coerce.string = false
* '1' !== 1
* @default true
*/
string?: boolean;
/**
* If `true` undefined will be equal to empty string
* @example
* // coerce.undefined = true
* undefined === ''
* @example
* // coerce.undefined = false
* undefined !== ''
* @default true
*/
undefined?: boolean;
/**
* If `true` null will be equal to empty string
* @example
* // coerce.null = true
* null === ''
* @example
* // coerce.null = false
* null !== ''
* @default true
*/
null?: boolean;
/**
* If `true` all symbols will have eual representation
* @example
* // coerce.symbol = true
* Symbol.for('a') === Symbol.for('b')
* @example
* // coerce.symbol = false
* Symbol.for('a') !== Symbol.for('b')
* @default true
*/
symbol?: boolean;
/**
* If `true` functions may equal the same formatted strings
* @example
* // coerce.function = true
* @example
* // coerce.function = false
* @default true
*/
function?: boolean;
/**
* If `true` dates may equal the same formatted strings
* @example
* // coerce.date = true
* @example
* // coerce.date = false
* @default true
*/
date?: boolean;
/**
* If `true` set will be coerced to array
* @example
* // coerce.set = true
* @example
* // coerce.set = false
* @default true
*/
set?: boolean;
}
boolean?: boolean;
/**
* Advanced sort options
* If `true` converts numbers to strings
* @example
* // coerce.number = true
* 1 === '1';
* @example
* // coerce.number = false
* 1 !== '1';
* @default true
*/
interface SortOptions {
/**
* If `true` sort array entries before hash
*/
array?: boolean;
/**
* If `true` sort TypedArray entries before hash
*/
typedArray?: boolean;
/**
* If `true` sort object entries before hash
*/
object?: boolean;
/**
* If `true` sort set entries before hash
*/
set?: boolean;
/**
* If `true` sort map entries before hash
*/
map?: boolean;
/**
* If `true` sort BigInt entries before hash
*/
bigint?: boolean;
}
number?: boolean;
/**
* Advanced trim options
* If `true` converts BigInt to string
* @example
* // coerce.bigint = true
* 1n === '1';
* @example
* // coerce.bigint = false
* 1n !== '1';
* @default true
*/
interface TrimOptions {
/**
* If `true` replaces multiple space with one and trims whitespaces in strings
*/
string?: boolean;
/**
* If `true` replaces multiple space with one and trims whitespaces in function body
*/
function?: boolean;
}
bigint?: boolean;
/**
* Object sorter options
* If `true` strings and coerced string will be equal to coerced numbers, booleans, etc
* @example
* // coerce.string = true
* '1' === true
* @example
* // coerce.string = false
* '1' !== 1
* @default true
*/
interface SorterOptions {
/**
* If `true` enables type coercion.
* Advanced coerce options could be provided as object
* @default true
*/
coerce?: boolean | CoerceOptions;
/**
* If `true` enables sorting.
* Advanced sorting options could be provided as object
* @default true
*/
sort?: boolean | SortOptions;
/**
* If `true` enables trimming and multiple whitespace replacement.
* Advanced sorting options could be provided as object.
* @default false
*/
trim?: boolean | TrimOptions;
}
type StringifyFn = (obj: Hashable | any) => string;
string?: boolean;
/**
* If `true` undefined will be equal to empty string
* @example
* // coerce.undefined = true
* undefined === ''
* @example
* // coerce.undefined = false
* undefined !== ''
* @default true
*/
undefined?: boolean;
/**
* If `true` null will be equal to empty string
* @example
* // coerce.null = true
* null === ''
* @example
* // coerce.null = false
* null !== ''
* @default true
*/
null?: boolean;
/**
* If `true` all symbols will have eual representation
* @example
* // coerce.symbol = true
* Symbol.for('a') === Symbol.for('b')
* @example
* // coerce.symbol = false
* Symbol.for('a') !== Symbol.for('b')
* @default true
*/
symbol?: boolean;
/**
* If `true` functions may equal the same formatted strings
* @example
* // coerce.function = true
* @example
* // coerce.function = false
* @default true
*/
function?: boolean;
/**
* If `true` dates may equal the same formatted strings
* @example
* // coerce.date = true
* @example
* // coerce.date = false
* @default true
*/
date?: boolean;
/**
* If `true` set will be coerced to array
* @example
* // coerce.set = true
* @example
* // coerce.set = false
* @default true
*/
set?: boolean;
}
/**
* Advanced sort options
*/
export interface SortOptions {
/**
* If `true` sort array entries before hash
*/
array?: boolean;
/**
* If `true` sort TypedArray entries before hash
*/
typedArray?: boolean;
/**
* If `true` sort object entries before hash
*/
object?: boolean;
/**
* If `true` sort set entries before hash
*/
set?: boolean;
/**
* If `true` sort map entries before hash
*/
map?: boolean;
/**
* If `true` sort BigInt entries before hash
*/
bigint?: boolean;
}
/**
* Advanced trim options
*/
export interface TrimOptions {
/**
* If `true` replaces multiple space with one and trims whitespaces in strings
*/
string?: boolean;
/**
* If `true` replaces multiple space with one and trims whitespaces in function body
*/
function?: boolean;
}
/**
* Object sorter options
*/
export interface SorterOptions {
/**
* If `true` enables type coercion.
* Advanced coerce options could be provided as object
* @default true
*/
coerce?: boolean | CoerceOptions | undefined;
/**
* If `true` enables sorting.
* Advanced sorting options could be provided as object
* @default true
*/
sort?: boolean | SortOptions | undefined;
/**
* If `true` enables trimming and multiple whitespace replacement.
* Advanced sorting options could be provided as object.
* @default false
*/
trim?: boolean | TrimOptions | undefined;
}
export type StringifyFn = <T>(obj: Hashable | T) => string;
/**
* Object sorter consturctor

@@ -186,4 +184,3 @@ * @param options object transformation options

*/
declare function objectSorter(options?: objectSorter.SorterOptions): objectSorter.StringifyFn;
export = objectSorter;
export declare const objectSorter: (options?: SorterOptions) => StringifyFn;
//# sourceMappingURL=objectSorter.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"objectSorter.d.ts","sourceRoot":"","sources":["../src/objectSorter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,kBAAU,YAAY,CAAC;IACrB;;OAEG;IACH,UAAiB,aAAa;QAC5B;;;;;;;;;;;WAWG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB;;;;;;;;;WASG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB;;;;;;;;;WASG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB;;;;;;;;;WASG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB;;;;;;;;;WASG;QACH,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB;;;;;;;;;W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;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;IACzC;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;CAC1C;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,KAAK,MAAM,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,YAAY,aAAc,aAAa,KAAG,WAmHtD,CAAC"}
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -32,4 +25,6 @@ if (k2 === undefined) k2 = k;

};
var typeGuess_1 = require("./typeGuess");
var str = __importStar(require("./stringifiers"));
Object.defineProperty(exports, "__esModule", { value: true });
exports.objectSorter = void 0;
const str = __importStar(require("./stringifiers"));
const typeGuess_1 = require("./typeGuess");
/**

@@ -40,40 +35,44 @@ * Object sorter consturctor

*/
function objectSorter(options) {
if (options === void 0) { options = {}; }
var _a = __assign({ sort: true, coerce: true, trim: false }, options), sort = _a.sort, coerce = _a.coerce, trim = _a.trim;
var stringifiers = {
const objectSorter = (options) => {
const { sort, coerce, trim } = {
sort: true,
coerce: true,
trim: false,
...options,
};
const sortOptions = {
array: typeof sort === 'boolean' ? sort : sort?.array ?? false,
typedArray: typeof sort === 'boolean' ? false : sort?.typedArray ?? false,
object: typeof sort === 'boolean' ? sort : sort?.object ?? false,
set: typeof sort === 'boolean' ? sort : sort?.set ?? false,
map: typeof sort === 'boolean' ? sort : sort?.map ?? false,
};
const coerceOptions = {
boolean: typeof coerce === 'boolean' ? coerce : coerce?.boolean ?? false,
number: typeof coerce === 'boolean' ? coerce : coerce?.number ?? false,
bigint: typeof coerce === 'boolean' ? coerce : coerce?.bigint ?? false,
string: typeof coerce === 'boolean' ? coerce : coerce?.string ?? false,
undefined: typeof coerce === 'boolean' ? coerce : coerce?.undefined ?? false,
null: typeof coerce === 'boolean' ? coerce : coerce?.null ?? false,
symbol: typeof coerce === 'boolean' ? coerce : coerce?.symbol ?? false,
function: typeof coerce === 'boolean' ? coerce : coerce?.function ?? false,
date: typeof coerce === 'boolean' ? coerce : coerce?.date ?? false,
set: typeof coerce === 'boolean' ? coerce : coerce?.set ?? false,
};
const trimOptions = {
string: typeof trim === 'boolean' ? trim : trim?.string ?? false,
function: typeof trim === 'boolean' ? trim : trim?.function ?? false,
};
const stringifiers = {
// eslint-disable-next-line @typescript-eslint/ban-types
unknown: function _unknown(obj) {
var _a, _b;
// `unknonw` - is a typo, saved for backward compatibility
var constructorName = (_b = (_a = obj.constructor) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : 'unknonw';
var objectName = typeof obj.toString === 'function' ? obj.toString() : 'unknown';
return "<:" + constructorName + ">:" + objectName;
const constructorName = obj.constructor?.name ?? 'unknonw';
const objectName = typeof obj.toString === 'function' ? obj.toString() : 'unknown';
return `<:${constructorName}>:${objectName}`;
},
};
var sortOptions = {
array: typeof sort === 'boolean' ? sort : sort.array,
typedArray: typeof sort === 'boolean' ? false : sort.typedArray,
object: typeof sort === 'boolean' ? sort : sort.object,
set: typeof sort === 'boolean' ? sort : sort.set,
map: typeof sort === 'boolean' ? sort : sort.map,
};
var coerceOptions = {
boolean: typeof coerce === 'boolean' ? coerce : coerce.boolean,
number: typeof coerce === 'boolean' ? coerce : coerce.number,
bigint: typeof coerce === 'boolean' ? coerce : coerce.bigint,
string: typeof coerce === 'boolean' ? coerce : coerce.string,
undefined: typeof coerce === 'boolean' ? coerce : coerce.undefined,
null: typeof coerce === 'boolean' ? coerce : coerce.null,
symbol: typeof coerce === 'boolean' ? coerce : coerce.symbol,
function: typeof coerce === 'boolean' ? coerce : coerce.function,
date: typeof coerce === 'boolean' ? coerce : coerce.date,
set: typeof coerce === 'boolean' ? coerce : coerce.set,
};
var trimOptions = {
string: typeof trim === 'boolean' ? trim : trim.string,
function: typeof trim === 'boolean' ? trim : trim.function,
};
stringifiers.hashable = str._hashable.bind(stringifiers);
stringifiers['hashable'] = str._hashable.bind(stringifiers);
if (trimOptions.string) {
stringifiers.string = coerceOptions.string
stringifiers['string'] = coerceOptions.string
? str._stringTrimCoerce.bind(stringifiers)

@@ -83,26 +82,26 @@ : str._stringTrim.bind(stringifiers);

else {
stringifiers.string = coerceOptions.string
stringifiers['string'] = coerceOptions.string
? str._stringCoerce.bind(stringifiers)
: str._string.bind(stringifiers);
}
stringifiers.number = coerceOptions.number
stringifiers['number'] = coerceOptions.number
? str._numberCoerce.bind(stringifiers)
: str._number.bind(stringifiers);
stringifiers.bigint = coerceOptions.bigint
stringifiers['bigint'] = coerceOptions.bigint
? str._bigIntCoerce.bind(stringifiers)
: str._bigInt.bind(stringifiers);
stringifiers.boolean = coerceOptions.boolean
stringifiers['boolean'] = coerceOptions.boolean
? str._booleanCoerce.bind(stringifiers)
: str._boolean.bind(stringifiers);
stringifiers.symbol = coerceOptions.symbol
stringifiers['symbol'] = coerceOptions.symbol
? str._symbolCoerce.bind(stringifiers)
: str._symbol.bind(stringifiers);
stringifiers.undefined = coerceOptions.undefined
stringifiers['undefined'] = coerceOptions.undefined
? str._undefinedCoerce.bind(stringifiers)
: str._undefined.bind(stringifiers);
stringifiers.null = coerceOptions.null
stringifiers['null'] = coerceOptions.null
? str._nullCoerce.bind(stringifiers)
: str._null.bind(stringifiers);
if (trimOptions.function) {
stringifiers.function = coerceOptions.function
stringifiers['function'] = coerceOptions.function
? str._functionTrimCoerce.bind(stringifiers)

@@ -112,17 +111,17 @@ : str._functionTrim.bind(stringifiers);

else {
stringifiers.function = coerceOptions.function
stringifiers['function'] = coerceOptions.function
? str._functionCoerce.bind(stringifiers)
: str._function.bind(stringifiers);
}
stringifiers.date = coerceOptions.date
stringifiers['date'] = coerceOptions.date
? str._dateCoerce.bind(stringifiers)
: str._date.bind(stringifiers);
stringifiers.array = sortOptions.array
stringifiers['array'] = sortOptions.array
? str._arraySort.bind(stringifiers)
: str._array.bind(stringifiers);
stringifiers.typedarray = sortOptions.typedArray
stringifiers['typedarray'] = sortOptions.typedArray
? str._typedArraySort.bind(stringifiers)
: str._typedArray.bind(stringifiers);
if (sortOptions.set) {
stringifiers.set = coerceOptions.set
stringifiers['set'] = coerceOptions.set
? str._setSortCoerce.bind(stringifiers)

@@ -132,10 +131,10 @@ : str._setSort.bind(stringifiers);

else {
stringifiers.set = coerceOptions.set
stringifiers['set'] = coerceOptions.set
? str._setCoerce.bind(stringifiers)
: str._set.bind(stringifiers);
}
stringifiers.object = sortOptions.object
stringifiers['object'] = sortOptions.object
? str._objectSort.bind(stringifiers)
: str._object.bind(stringifiers);
stringifiers.map = sortOptions.map
stringifiers['map'] = sortOptions.map
? str._mapSort.bind(stringifiers)

@@ -151,4 +150,4 @@ : str._map.bind(stringifiers);

return objectToString;
}
module.exports = objectSorter;
};
exports.objectSorter = objectSorter;
//# sourceMappingURL=objectSorter.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"objectSorter.js","sourceRoot":"","sources":["../src/objectSorter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAwC;AACxC,kDAAsC;AA2LtC;;;;GAIG;AACH,SAAS,YAAY,CACnB,OAAwC;IAAxC,wBAAA,EAAA,YAAwC;IAElC,IAAA,gBACJ,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,IAAI,EACZ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AC,YAAY,CAAiB;QAClD,CAAC,CAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAiB,CAAC;IAEjD;;;OAGG;IACH,SAAS,cAAc,CAAI,GAAM;QAC/B,OAAO,YAAY,CAAC,IAAA,qBAAS,EAAC,GAAG,CAAC,CAAE,CAAC,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AAnHW,QAAA,YAAY,gBAmHvB"}

@@ -0,1 +1,2 @@

/// <reference types="node" />
/**

@@ -5,4 +6,3 @@ * @private

*/
/// <reference types="node" />
import { Hashable } from './hasher';
import type { Hashable } from './hasher';
import TypedArray = NodeJS.TypedArray;

@@ -12,3 +12,3 @@ /**

*/
export declare type Stringifiers = {
export type Stringifiers = {
[key: string]: (obj: any) => string;

@@ -88,3 +88,3 @@ };

*/
export declare function _bigIntCoerce(obj: BigInt): string;
export declare function _bigIntCoerce(obj: bigint): string;
/**

@@ -96,3 +96,3 @@ * Converts BigInt to string

*/
export declare function _bigInt(obj: BigInt): string;
export declare function _bigInt(obj: bigint): string;
/**

@@ -202,3 +202,3 @@ * Converts boolean to string

*/
export declare function _arraySort(obj: Array<any>): string;
export declare function _arraySort(this: Stringifiers, obj: any[]): string;
/**

@@ -210,3 +210,3 @@ * Converts array to string

*/
export declare function _array(obj: Array<any>): string;
export declare function _array(this: Stringifiers, obj: any[]): string;
/**

@@ -218,3 +218,3 @@ * Converts TypedArray to string

*/
export declare function _typedArraySort(obj: TypedArray): string;
export declare function _typedArraySort(this: Stringifiers, obj: TypedArray): string;
/**

@@ -226,3 +226,3 @@ * Converts TypedArray to string

*/
export declare function _typedArray(obj: TypedArray): string;
export declare function _typedArray(this: Stringifiers, obj: TypedArray): string;
/**

@@ -234,3 +234,3 @@ * Converts set to string

*/
export declare function _setSortCoerce(obj: Set<any>): string;
export declare function _setSortCoerce(this: Stringifiers, obj: Set<any>): string;
/**

@@ -242,3 +242,3 @@ * Converts set to string

*/
export declare function _setSort(obj: Set<any>): string;
export declare function _setSort(this: Stringifiers, obj: Set<any>): string;
/**

@@ -250,3 +250,3 @@ * Converts set to string

*/
export declare function _set(obj: Set<any>): string;
export declare function _set(this: Stringifiers, obj: Set<any>): string;
/**

@@ -258,3 +258,3 @@ * Converts set to string

*/
export declare function _setCoerce(obj: Set<any>): string;
export declare function _setCoerce(this: Stringifiers, obj: Set<any>): string;
/**

@@ -266,3 +266,3 @@ * Converts object to string

*/
export declare function _object(obj: {
export declare function _object(this: Stringifiers, obj: {
[key: string]: any;

@@ -276,3 +276,3 @@ }): string;

*/
export declare function _objectSort(obj: {
export declare function _objectSort(this: Stringifiers, obj: {
[key: string]: any;

@@ -286,3 +286,3 @@ }): string;

*/
export declare function _map(obj: Map<any, any>): string;
export declare function _map(this: Stringifiers, obj: Map<any, any>): string;
/**

@@ -294,3 +294,3 @@ * Converts map to string

*/
export declare function _mapSort(obj: Map<any, any>): string;
export declare function _mapSort(this: Stringifiers, obj: Map<any, any>): string;
//# sourceMappingURL=stringifiers.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"stringifiers.d.ts","sourceRoot":"","sources":["../src/stringifiers.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAEtC;;GAEG;AACH,oBAAY,YAAY,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAA;CAAE,CAAC;AAEnE;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAalB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,CAE/C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjD;AACD;;;;;GAKG;AACH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B,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,MAAM,CASvE"}
"use strict";
/**
* @private
* @inner
*/
/* eslint-disable @typescript-eslint/no-explicit-any */
Object.defineProperty(exports, "__esModule", { value: true });
exports._mapSort = exports._map = exports._objectSort = exports._object = exports._setCoerce = exports._set = exports._setSort = exports._setSortCoerce = exports._typedArray = exports._typedArraySort = exports._array = exports._arraySort = exports._date = exports._dateCoerce = exports._functionTrim = exports._functionTrimCoerce = exports._function = exports._functionCoerce = exports._null = exports._nullCoerce = exports._undefined = exports._undefinedCoerce = exports._symbol = exports._symbolCoerce = exports._boolean = exports._booleanCoerce = exports._bigInt = exports._bigIntCoerce = exports._number = exports._numberCoerce = exports._stringTrim = exports._stringTrimCoerce = exports._string = exports._stringCoerce = exports._hashable = exports.PREFIX = void 0;
var typeGuess_1 = require("./typeGuess");
const typeGuess_1 = require("./typeGuess");
/**

@@ -93,3 +90,3 @@ * Prefixes that used when type coercion is disabled

function _number(obj) {
return exports.PREFIX.number + ":" + obj;
return `${exports.PREFIX.number}:${obj}`;
}

@@ -114,3 +111,3 @@ exports._number = _number;

function _bigInt(obj) {
return exports.PREFIX.bigint + ":" + obj.toString();
return `${exports.PREFIX.bigint}:${obj.toString()}`;
}

@@ -204,2 +201,3 @@ exports._bigInt = _bigInt;

*/
// eslint-disable-next-line @typescript-eslint/ban-types
function _functionCoerce(obj) {

@@ -215,2 +213,3 @@ return obj.name + '=>' + obj.toString();

*/
// eslint-disable-next-line @typescript-eslint/ban-types
function _function(obj) {

@@ -226,2 +225,3 @@ return exports.PREFIX.function + ':' + obj.name + '=>' + obj.toString();

*/
// eslint-disable-next-line @typescript-eslint/ban-types
function _functionTrimCoerce(obj) {

@@ -242,2 +242,3 @@ return (obj.name +

*/
// eslint-disable-next-line @typescript-eslint/ban-types
function _functionTrim(obj) {

@@ -281,6 +282,6 @@ return (exports.PREFIX.function +

function _arraySort(obj) {
var stringifiers = this;
const stringifiers = this;
return ('[' +
obj
.map(function (item) {
.map((item) => {
return stringifiers[(0, typeGuess_1.guessType)(item)](item);

@@ -300,6 +301,6 @@ })

function _array(obj) {
var stringifiers = this;
const stringifiers = this;
return ('[' +
obj
.map(function (item) {
.map((item) => {
return stringifiers[(0, typeGuess_1.guessType)(item)](item);

@@ -318,8 +319,8 @@ })

function _typedArraySort(obj) {
var stringifiers = this;
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
var values = Array.prototype.slice.call(obj);
const stringifiers = this;
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
const values = Array.prototype.slice.call(obj);
return ('[' +
values
.map(function (num) {
.map((num) => {
return stringifiers[(0, typeGuess_1.guessType)(num)](num);

@@ -339,8 +340,7 @@ })

function _typedArray(obj) {
var stringifiers = this;
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
var values = Array.prototype.slice.call(obj);
const stringifiers = this;
const values = Array.prototype.slice.call(obj);
return ('[' +
values
.map(function (num) {
.map((num) => {
return stringifiers[(0, typeGuess_1.guessType)(num)](num);

@@ -369,3 +369,3 @@ })

function _setSort(obj) {
return exports.PREFIX.set + ":" + _arraySort.call(this, Array.from(obj));
return `${exports.PREFIX.set}:${_arraySort.call(this, Array.from(obj))}`;
}

@@ -380,3 +380,3 @@ exports._setSort = _setSort;

function _set(obj) {
return exports.PREFIX.set + ":" + _array.call(this, Array.from(obj));
return `${exports.PREFIX.set}:${_array.call(this, Array.from(obj))}`;
}

@@ -401,9 +401,8 @@ exports._set = _set;

function _object(obj) {
var stringifiers = this;
var keys = Object.keys(obj);
var objArray = [];
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
var key = keys_1[_i];
var val = obj[key];
var valT = (0, typeGuess_1.guessType)(val);
const stringifiers = this;
const keys = Object.keys(obj);
const objArray = [];
for (const key of keys) {
const val = obj[key];
const valT = (0, typeGuess_1.guessType)(val);
objArray.push(key + ':' + stringifiers[valT](val));

@@ -421,9 +420,8 @@ }

function _objectSort(obj) {
var stringifiers = this;
var keys = Object.keys(obj).sort();
var objArray = [];
for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) {
var key = keys_2[_i];
var val = obj[key];
var valT = (0, typeGuess_1.guessType)(val);
const stringifiers = this;
const keys = Object.keys(obj).sort();
const objArray = [];
for (const key of keys) {
const val = obj[key];
const valT = (0, typeGuess_1.guessType)(val);
objArray.push(key + ':' + stringifiers[valT](val));

@@ -441,12 +439,8 @@ }

function _map(obj) {
var stringifiers = this;
var arr = Array.from(obj);
var mapped = [];
for (var _i = 0, arr_1 = arr; _i < arr_1.length; _i++) {
var item = arr_1[_i];
var _a = item, key = _a[0], value = _a[1];
mapped.push([
stringifiers[(0, typeGuess_1.guessType)(key)](key),
stringifiers[(0, typeGuess_1.guessType)(value)](value),
]);
const stringifiers = this;
const arr = Array.from(obj);
const mapped = [];
for (const item of arr) {
const [key, value] = item;
mapped.push([stringifiers[(0, typeGuess_1.guessType)(key)](key), stringifiers[(0, typeGuess_1.guessType)(value)](value)]);
}

@@ -463,12 +457,8 @@ return '[' + mapped.join(';') + ']';

function _mapSort(obj) {
var stringifiers = this;
var arr = Array.from(obj);
var mapped = [];
for (var _i = 0, arr_2 = arr; _i < arr_2.length; _i++) {
var item = arr_2[_i];
var _a = item, key = _a[0], value = _a[1];
mapped.push([
stringifiers[(0, typeGuess_1.guessType)(key)](key),
stringifiers[(0, typeGuess_1.guessType)(value)](value),
]);
const stringifiers = this;
const arr = Array.from(obj);
const mapped = [];
for (const item of arr) {
const [key, value] = item;
mapped.push([stringifiers[(0, typeGuess_1.guessType)(key)](key), stringifiers[(0, typeGuess_1.guessType)(value)](value)]);
}

@@ -475,0 +465,0 @@ return '[' + mapped.sort().join(';') + ']';

@@ -1,1 +0,1 @@

{"version":3,"file":"stringifiers.js","sourceRoot":"","sources":["../src/stringifiers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yCAAwC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AAQ,CAAqB,GAAkB;IAC7D,MAAM,YAAY,GAAiB,IAAI,CAAC;IACxC,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5B,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE;QACtB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,IAAiB,CAAC;QACvC,MAAM,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,IAAA,qBAAS,EAAC,GAAG,CAAC,CAAE,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC,IAAA,qBAAS,EAAC,KAAK,CAAC,CAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KAC3F;IACD,OAAO,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AAC7C,CAAC;AATD,4BASC"}

@@ -0,1 +1,2 @@

import type { Hashable } from './hasher';
/**

@@ -12,3 +13,3 @@ * Type mapping rules.

*/
export declare function guessObjectType(obj: unknown): string;
export declare const guessObjectType: <T>(obj: T) => string;
/**

@@ -19,3 +20,10 @@ * Guess variable type

*/
export declare function guessType(obj: unknown): string;
export declare const guessType: <T>(obj: T) => string;
/**
* Identify if object is instance of Hashable interface
* @param object analyzed variable
* @return true if object has toHashableString property and this property is function
* otherwise return false
*/
export declare const instanceOfHashable: <T>(object: T | Hashable) => boolean;
//# sourceMappingURL=typeGuess.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"typeGuess.d.ts","sourceRoot":"","sources":["../src/typeGuess.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAsB9C,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CASpD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAG9C"}
{"version":3,"file":"typeGuess.d.ts","sourceRoot":"","sources":["../src/typeGuess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAsB9C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,iBAAgB,MAU3C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,iBAAgB,MAGrC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,+BAA8B,OAE5D,CAAC"}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.guessType = exports.guessObjectType = exports.TYPE_MAP = void 0;
exports.instanceOfHashable = exports.guessType = exports.guessObjectType = exports.TYPE_MAP = void 0;
/**

@@ -35,13 +35,12 @@ * Type mapping rules.

*/
function guessObjectType(obj) {
var _a, _b;
const guessObjectType = (obj) => {
if (obj === null) {
return 'null';
}
if (instanceOfHashable(obj)) {
if ((0, exports.instanceOfHashable)(obj)) {
return 'hashable';
}
var type = (_b = (_a = obj.constructor) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : 'unknown';
const type = obj?.constructor?.name ?? 'unknown';
return exports.TYPE_MAP[type] || 'unknown';
}
};
exports.guessObjectType = guessObjectType;

@@ -53,6 +52,6 @@ /**

*/
function guessType(obj) {
var type = typeof obj;
return type !== 'object' ? type : guessObjectType(obj);
}
const guessType = (obj) => {
const type = typeof obj;
return type !== 'object' ? type : (0, exports.guessObjectType)(obj);
};
exports.guessType = guessType;

@@ -65,5 +64,6 @@ /**

*/
function instanceOfHashable(object) {
const instanceOfHashable = (object) => {
return typeof object.toHashableString === 'function';
}
};
exports.instanceOfHashable = instanceOfHashable;
//# sourceMappingURL=typeGuess.js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AC;IACxB,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,uBAAe,EAAC,GAAG,CAAC,CAAC;AACzD,CAAC,CAAC;AAHW,QAAA,SAAS,aAGpB;AAEF;;;;;GAKG;AACI,MAAM,kBAAkB,GAAG,CAAI,MAAoB,EAAW,EAAE;IACrE,OAAO,OAAQ,MAAmB,CAAC,gBAAgB,KAAK,UAAU,CAAC;AACrE,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B"}
{
"name": "node-object-hash",
"version": "2.3.10",
"version": "3.0.0",
"description": "Node.js object hash library with properties/arrays sorting to provide constant hashes",

@@ -19,3 +19,3 @@ "keywords": [

"type": "git",
"url": "https://github.com/SkeLLLa/node-object-hash.git"
"url": "git@github.com:SkeLLLa/node-object-hash.git"
},

@@ -37,57 +37,67 @@ "license": "MIT",

"scripts": {
"prebenchmark": "npm i --no-save hash-object object-hash benchmark",
"benchmark": "node benchmark/bench.js",
"prebenchmark:custom": "npm i --no-save hash-object object-hash benchmark",
"audit": "pnpm audit --prod --audit-level=high",
"benchmark": "pnpm run build && pnpm run benchmark:regular && pnpm run benchmark:custom",
"benchmark:custom": "node --expose-gc benchmark/custom.js",
"build": "npm run build:node",
"build:node": "tsc -p tsconfig.json",
"get-changelog": "conventional-changelog -r 2 -p angular",
"lint": "npm run lint:eslint",
"benchmark:regular": "node benchmark/bench.js",
"build": "pnpm run build:node && pnpm run build:docs",
"build:docs": "typedoc --plugin typedoc-plugin-markdown --plugin typedoc-plugin-mdn-links && pretty-quick",
"build:node": "tsc -p tsconfig.build.json",
"lint": "pnpm run lint:eslint",
"lint:eslint": "eslint . --ext js,jsx,ts,tsx",
"prerelease": "npm run typedoc && git add -A ./docs",
"release": "git add -A && standard-version -a",
"test": "npm audit --production && npm run lint && npm run unit",
"typedoc": "rm -rf ./docs/* && typedoc && pretty-quick",
"unit": "jest --coverage",
"postunit": "codecov || true",
"version:update": "echo v$npm_package_version > VERSION"
"lint:typescript": "tsc",
"release": "semantic-release",
"test": "pnpm run audit && pnpm run lint && pnpm run test:unit",
"test:unit": "jest --coverage"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"devDependencies": {
"@commitlint/cli": "^13.1.0",
"@commitlint/config-conventional": "^13.1.0",
"@jest/globals": "^27.2.0",
"@types/node": "^16.9.1",
"@typescript-eslint/eslint-plugin": "^4.31.1",
"@typescript-eslint/parser": "^4.31.1",
"codecov": "^3.8.3",
"conventional-changelog-cli": "^2.1.1",
"eslint": "^7.32.0",
"@jest/globals": "^29.5.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^8.0.7",
"@semantic-release/npm": "^10.0.3",
"@semantic-release/release-notes-generator": "^10.0.3",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@tsconfig/node-lts": "^18.12.1",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"conventional-changelog-cli": "^2.2.2",
"conventional-changelog-conventionalcommits": "^5.0.0",
"eslint": "^8.38.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jest": "^24.4.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-sort-requires": "^2.1.0",
"faker": "^5.5.3",
"husky": "^7.0.2",
"jest": "^27.2.0",
"prettier": "^2.4.0",
"prettier-plugin-packagejson": "^2.2.12",
"pretty-quick": "^3.1.1",
"replace": "^1.2.1",
"standard-version": "^9.3.1",
"ts-jest": "^27.0.5",
"ts-node": "^10.2.1",
"typedoc": "~0.21.0",
"typedoc-plugin-markdown": "^3.10.4",
"typescript": "~4.4.3"
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-security": "^1.7.1",
"jest": "^29.5.0",
"prettier": "^2.8.7",
"prettier-plugin-packagejson": "^2.4.3",
"prettier-plugin-sh": "^0.12.8",
"prettier-plugin-sort-json": "^1.0.0",
"pretty-quick": "^3.1.3",
"semantic-release": "^21.0.1",
"semantic-release-mirror-version": "^1.1.2",
"ts-jest": "^29.1.0",
"typedoc": "^0.24.1",
"typedoc-plugin-markdown": "^3.15.1",
"typedoc-plugin-mdn-links": "^3.0.3",
"typescript": "^5.0.4"
},
"engines": {
"node": ">=0.10.0"
"node": ">=16",
"pnpm": ">=8"
},
"pnpm": {
"updateConfig": {
"ignoreDependencies": [
"faker"
]
}
}
}

@@ -20,4 +20,2 @@ # node-object-hash

[![Codecov Coverage](https://codecov.io/gh/SkeLLLa/node-object-hash/branch/master/graph/badge.svg?token=wLjMou8TT7)](https://codecov.io/gh/SkeLLLa/node-object-hash)
[![LGTM Alerts](https://img.shields.io/lgtm/alerts/github/SkeLLLa/node-object-hash.svg)](https://lgtm.com/projects/g/SkeLLLa/node-object-hash/)
[![LGTM Grade](https://img.shields.io/lgtm/grade/javascript/github/SkeLLLa/node-object-hash.svg)](https://lgtm.com/projects/g/SkeLLLa/node-object-hash/)

@@ -32,2 +30,3 @@ </div>

- [ToC](#toc)
- [What's new in v3.0.0](#whats-new-in-v300)
- [What's new in v2.0.0](#whats-new-in-v200)

@@ -50,3 +49,3 @@ - [Breaking changes](#breaking-changes)

- [version \>=1.0.0](#version-100)
- [version \>=0.1.0 && <1.0.0](#version-010--100)
- [version \>=0.1.0 \&\& \<1.0.0](#version-010--100)
- [Examples](#examples)

@@ -61,2 +60,13 @@ - [Benchmarks](#benchmarks)

## What's new in v3.0.0
**Disclaimer**: No new features or changes that may break hashes from previous versions. There's no need to update unless you're starting project from scratch.
- Refactor and migration to typescript 5.
- Drop old node support.
- Removed typescript namespaces.
- Updated exported functions and object structure.
- Removed faker and old benchmarks.
- New CI and release automation.
## What's new in v2.0.0

@@ -158,7 +168,8 @@

See [changelog](CHANGELOG.md)
See [changelog](docs/CHANGELOG.md)
For v2 changes see [changelog-v2](docs/CHANGELOG-v2.md)
## Docs
Full API docs could be found in [docs](./docs/README.md).
Full API docs could be found in [docs](./docs/api/README.md).

@@ -170,3 +181,3 @@ ### API overview

```js
require('node-object-hash')([options]);
require('node-object-hash').hasher([options]);
```

@@ -224,3 +235,3 @@

```js
var hasher = require('node-object-hash');
var { hasher } = require('node-object-hash');

@@ -227,0 +238,0 @@ var hashSortCoerce = hasher({ sort: true, coerce: true });

# Changelog
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [2.3.10](https://github.com/SkeLLLa/node-object-hash/compare/v2.3.9...v2.3.10) (2021-09-14)
### Misc
* **deps:** update ([996e344](https://github.com/SkeLLLa/node-object-hash/commit/996e3441a4560c2f909f8e9e0ef674201a0275c2))
### [2.3.9](https://github.com/SkeLLLa/node-object-hash/compare/v2.3.8...v2.3.9) (2021-08-18)
### [2.3.8](https://github.com/SkeLLLa/node-object-hash/compare/v2.3.7...v2.3.8) (2021-07-31)
### [2.3.7](https://github.com/SkeLLLa/node-object-hash/compare/v2.3.6...v2.3.7) (2021-06-17)
### Misc
* update links ([f48c0c9](https://github.com/SkeLLLa/node-object-hash/commit/f48c0c99c7d9f60b7a75109e72a7d373d3913d1b))
### [2.3.6](https://github.com/SkeLLLa/node-object-hash/compare/v2.3.5...v2.3.6) (2021-06-17)
### Tests
* update jest types ([b1a7774](https://github.com/SkeLLLa/node-object-hash/commit/b1a7774e96d640e9cbce95527c629bdb9ba2d07e))
### [2.3.5](https://github.com/SkeLLLa/node-object-hash/compare/v2.3.4...v2.3.5) (2021-06-17)
### Misc
* **deps:** update ([d16d2b2](https://github.com/SkeLLLa/node-object-hash/commit/d16d2b2ecaa36bdbb3a4c0d238be4dae4bf18222))
### Bug fixes
* revert ts to 4.2 ([6423ea7](https://github.com/SkeLLLa/node-object-hash/commit/6423ea701113f92f9570169c63138dde012f20ed))
### [2.3.4](https://github.com/SkeLLLa/node-object-hash/compare/v2.3.3...v2.3.4) (2021-06-14)
### [2.3.3](https://github.com/SkeLLLa/node-object-hash/compare/v2.3.2...v2.3.3) (2021-05-29)
### [2.3.2](https://github.com/SkeLLLa/node-object-hash/compare/v2.3.1...v2.3.2) (2021-05-28)
### [2.3.1](https://github.com/SkeLLLa/node-object-hash/compare/v2.3.0...v2.3.1) (2021-02-28)
### Tests
* add tests for every possible option ([0fc56f0](https://github.com/SkeLLLa/node-object-hash/commit/0fc56f08bb8d7cadcfed1d136eb3b2f5b89fa8ba))
## [2.3.0](https://github.com/SkeLLLa/node-object-hash/compare/v2.2.0...v2.3.0) (2021-02-24)
### Features
* add sorting option for typed arrays ([28d5344](https://github.com/SkeLLLa/node-object-hash/commit/28d53445d1f59213ac32de77890b0311a0dffe7f))
### Bug fixes
* stringification of typed arrays ([bc1e1a6](https://github.com/SkeLLLa/node-object-hash/commit/bc1e1a6654036935769006df4823cd16a67c0a62))
## [2.2.0](https://github.com/SkeLLLa/node-object-hash/compare/v2.1.2...v2.2.0) (2021-02-22)
### Features
* add bigint support ([544d97e](https://github.com/SkeLLLa/node-object-hash/commit/544d97e9712961effae0a6940357bb1f8b9adcc6))
### Bug fixes
* coerce option for bigint ([ca2f87c](https://github.com/SkeLLLa/node-object-hash/commit/ca2f87c7af8270ec5ce89de1bb166257000ffca1))
* typo in doc ([d9d7e24](https://github.com/SkeLLLa/node-object-hash/commit/d9d7e24f2b45e5b14c92a01da648f6ad9daf8427))
* **typos:** fix typos in test and contributing.md ([2ee3ddd](https://github.com/SkeLLLa/node-object-hash/commit/2ee3ddde2cd062844b2d3829f13647bf78b88eb7))
### [2.1.2](https://github.com/SkeLLLa/node-object-hash/compare/v2.1.1...v2.1.2) (2021-01-29)
### [2.1.1](https://github.com/SkeLLLa/node-object-hash/compare/v2.1.0...v2.1.1) (2021-01-29)
## 2.1.0 (2021-01-27)
### Features
- added warnings to eslint errors ([422c893](https://github.com/SkeLLLa/node-object-hash/commit/422c8932e8ad140553259e9e49555f7ddfef4db1))
- fixed eslint errors ([e9245f7](https://github.com/SkeLLLa/node-object-hash/commit/e9245f7aa3aa14238fbb62d97dacdcc414ec0f40))
- fixed npm script issue ([0bf8c17](https://github.com/SkeLLLa/node-object-hash/commit/0bf8c175ae058bbc442628e953ff577be500d865))
- updated typescript, migrated to tslint ([3a40fcc](https://github.com/SkeLLLa/node-object-hash/commit/3a40fccbe03f265b8452b59ac1434cb1b0ceb6a3))
### Bug fixes
- remove unnecessary checks ([1bbad3a](https://github.com/SkeLLLa/node-object-hash/commit/1bbad3a2f6dc1dd28ed48ab2ca065b878b450f53))
- **lint:** fix eslint ([caeac70](https://github.com/SkeLLLa/node-object-hash/commit/caeac700031c7637448e4d76f2d2fe9276df2b01))
- **types:** fix encoding type ([cdc6958](https://github.com/SkeLLLa/node-object-hash/commit/cdc69588b781095764d574b6f14e00b2609ff4e5))
- improve checking of Hashable applicant ([3856207](https://github.com/SkeLLLa/node-object-hash/commit/38562077f9465e1aa871e607fd13de861f10582d))
### Misc
- **deps:** bump deps ([a370ea2](https://github.com/SkeLLLa/node-object-hash/commit/a370ea2bf9b89b94063d5fb3e584da20dd0eb855))
- **pj:** add prettier to docs ([77b6001](https://github.com/SkeLLLa/node-object-hash/commit/77b6001674284fc613e95fd44cddb9aec143aeb5))
- **pj:** update scripts ([dd8c778](https://github.com/SkeLLLa/node-object-hash/commit/dd8c778301899e41dacb73f83426a733bb327dda))
## [2.0.0](https://gitlab.com/m03geek/node-object-hash/compare/v2.0.0-rc.1...v2.0.0) (2019-09-07)
## [2.0.0-rc.1](https://gitlab.com/m03geek/node-object-hash/compare/v2.0.0-rc.0...v2.0.0-rc.1) (2019-09-03)
## [2.0.0-rc.0](https://gitlab.com/m03geek/node-object-hash/compare/v1.4.2...v2.0.0-rc.0) (2019-09-03)
### ⚠ BREAKING CHANGES
- Library rewritten in typescript that could cause some side-effects, but it should not.
- With `coerce=false` `Set`s will no longer generate the same hashes as `Array`s. In order to restore previous behavior set `coerce.set=true`.
- With `coerce=false` `Symbol`s will generate hash based on symbol `.toString` value. That's useful for `Symbol.for('smth')`. If `coerce.symbol=true` all `Symbols`s will have equal hashes.
TLDR; If you use library with `Set`s or `Symbol`s with `coerce=false` in order to keep hashes the same as in `v1.X.X` you should use following constructor:
```
const hasher = require('node-object-hash')({coerce: {set: true, symbol: true}})
```
- Object sorter sources moved to `dist` directory. If you required it directly via `require('node-object-hash/objectSorter')` you should change it to require('node-object-hash/dist/objectSorter').
- Removed old `v0` version from code.
- Changed license to MIT.
### Bug Fixes
- **hasher:** fix options ([05241ca](https://gitlab.com/m03geek/node-object-hash/commit/05241ca))
### Features
- major refactor ([450471e](https://gitlab.com/m03geek/node-object-hash/commit/450471e))
- New granular options. Now you can specify what types need to be sorted or coerced.
- Add new `trim` option. It can be used to remove unncecessary spaces in `string`s or `function` bodies.
- Library rewritten to typescript, so it may have better ts compatibility.
## [1.4.X](https://gitlab.com/m03geek/node-object-hash/compare/v1.3.0...v1.4.2)
### Features
- Add support for objects without constructor #11 [PR @futpib](https://gitlab.com/m03geek/node-object-hash/pull/12)
- Simplify eslint rules, update codestyle
### Fixes
- Fix npm links issues in readme
- Update dev dependencies
## [1.3.X](https://gitlab.com/m03geek/node-object-hash/compare/v1.2.0...v1.3.0)
### Features
- Add definition types to support typescript
- Add >=node-8.0.0 support in tests.
## [1.2.X](https://gitlab.com/m03geek/node-object-hash/compare/v1.1.6...v1.2.0)
### Features
- Added typed arrays support
- Added primitive type constructors support
- Add more docs about type mapping and type coercion
## [1.1.X](https://gitlab.com/m03geek/node-object-hash/compare/v1.0.3..v1.1.6)
### Features
Mainly all changes affected codestyle and documentation to provide better
experience using this library. There are no changes that should affect
functionality.
- Renamed `sortObject` function to `sort` (old one is still present in code
for backward compatibility).
- Performed some refactoring for better codestyle and documentation.
- Old version (`0.X.X`) moved to subfolder (`./v0`).
- Advanced API reference added: [link](API.md).
## [1.0.0](https://gitlab.com/m03geek/node-object-hash/compare/v0.1.0...v1.0.3)
- Sorting mechanism rewritten form ES6 Maps to simple arrays
(add <=node-4.0.0 support)
- Performance optimization (~2 times faster than 0.x.x)
- API changes:
- Now module returns 'constructor' function, where you can set
default parameters: `var objectHash = require('node-object-hash')(options);`
In case if you still need an old 0.x.x version it's available in `hash.js`
file.