Launch Week Day 4: Introducing Data Exports.Learn More
Socket
Book a DemoSign in
Socket

tcompare

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tcompare - npm Package Compare versions

Comparing version
6.0.1-1
to
6.0.1-2
+12
dist/cjs/match-only-strict.d.ts
import { Same } from './same.js';
/**
* this uses the test method from {@link MatchStrict}, but requires that *only*
* the specified fields in the pattern are present in the object.
*
* It does still allow a field to be present in the object and not the pattern
* if the value is set to undefined.
*/
export declare class MatchOnlyStrict extends Same {
test(): boolean | "COMPLEX";
}
//# sourceMappingURL=match-only-strict.d.ts.map
{"version":3,"file":"match-only-strict.d.ts","sourceRoot":"","sources":["../../src/match-only-strict.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;;;;;GAMG;AACH,qBAAa,eAAgB,SAAQ,IAAI;IACvC,IAAI;CAGL"}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MatchOnlyStrict = void 0;
const match_strict_js_1 = require("./match-strict.js");
const same_js_1 = require("./same.js");
/**
* this uses the test method from {@link MatchStrict}, but requires that *only*
* the specified fields in the pattern are present in the object.
*
* It does still allow a field to be present in the object and not the pattern
* if the value is set to undefined.
*/
class MatchOnlyStrict extends same_js_1.Same {
test() {
return match_strict_js_1.MatchStrict.prototype.test.call(this);
}
}
exports.MatchOnlyStrict = MatchOnlyStrict;
//# sourceMappingURL=match-only-strict.js.map
{"version":3,"file":"match-only-strict.js","sourceRoot":"","sources":["../../src/match-only-strict.ts"],"names":[],"mappings":";;;AAAA,uDAA+C;AAC/C,uCAAgC;AAEhC;;;;;;GAMG;AACH,MAAa,eAAgB,SAAQ,cAAI;IACvC,IAAI;QACF,OAAO,6BAAW,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9C,CAAC;CACF;AAJD,0CAIC","sourcesContent":["import { MatchStrict } from './match-strict.js'\nimport { Same } from './same.js'\n\n/**\n * this uses the test method from {@link MatchStrict}, but requires that *only*\n * the specified fields in the pattern are present in the object.\n *\n * It does still allow a field to be present in the object and not the pattern\n * if the value is set to undefined.\n */\nexport class MatchOnlyStrict extends Same {\n test() {\n return MatchStrict.prototype.test.call(this)\n }\n}\n"]}
import { Same } from './same.js';
/**
* this uses the test method from {@link MatchStrict}, but requires that *only*
* the specified fields in the pattern are present in the object.
*
* It does still allow a field to be present in the object and not the pattern
* if the value is set to undefined.
*/
export declare class MatchOnlyStrict extends Same {
test(): boolean | "COMPLEX";
}
//# sourceMappingURL=match-only-strict.d.ts.map
{"version":3,"file":"match-only-strict.d.ts","sourceRoot":"","sources":["../../src/match-only-strict.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;;;;;GAMG;AACH,qBAAa,eAAgB,SAAQ,IAAI;IACvC,IAAI;CAGL"}
import { MatchStrict } from './match-strict.js';
import { Same } from './same.js';
/**
* this uses the test method from {@link MatchStrict}, but requires that *only*
* the specified fields in the pattern are present in the object.
*
* It does still allow a field to be present in the object and not the pattern
* if the value is set to undefined.
*/
export class MatchOnlyStrict extends Same {
test() {
return MatchStrict.prototype.test.call(this);
}
}
//# sourceMappingURL=match-only-strict.js.map
{"version":3,"file":"match-only-strict.js","sourceRoot":"","sources":["../../src/match-only-strict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;;;;;GAMG;AACH,MAAM,OAAO,eAAgB,SAAQ,IAAI;IACvC,IAAI;QACF,OAAO,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9C,CAAC;CACF","sourcesContent":["import { MatchStrict } from './match-strict.js'\nimport { Same } from './same.js'\n\n/**\n * this uses the test method from {@link MatchStrict}, but requires that *only*\n * the specified fields in the pattern are present in the object.\n *\n * It does still allow a field to be present in the object and not the pattern\n * if the value is set to undefined.\n */\nexport class MatchOnlyStrict extends Same {\n test() {\n return MatchStrict.prototype.test.call(this)\n }\n}\n"]}
+56
-3

@@ -1,16 +0,69 @@

/// <reference types="node" />
import type { Style } from './styles.js';
/// <reference types="node" resolution-mode="require"/>
import { Style, StyleType } from './styles.js';
/**
* The base class for all other comparators, and used
* directly by comparators for their "simplePrint" methods.
* It doesn't do comparison, just formatting.
*/
export interface FormatOptions {
/** set when formatting keys and values of collections */
parent?: Format;
/** sort items alphabetically by key */
sort?: boolean;
/**
* test whether an object has been seen, and get a reference to the
* Format handling them, if so.
*
* overridden in child classes when doing simplePrint()
*/
seen?: (obj?: any) => false | Format;
style?: string;
/** how to print this thing */
style?: StyleType;
/**
* optinally override {@link Style#bufferChunkSize }
* */
bufferChunkSize?: number;
/**
* Set when printing child fields
*
* @internal
*/
key?: any;
/**
* used when formatting Map keys
*
* @internal
*/
isKey?: boolean;
/**
* level within the object graph being printed
*
* @internal
*/
level?: number;
/**
* indentation level of this object within the object graph
*
* @internal
*/
indent?: string;
/**
* used when provisionally exploring a path for comparison
*
* @internal
*/
provisional?: boolean;
/**
* Include any and all enumerable properties, including those inherited on
* the prototype chain. By default, only `own` properties are printed.
*/
includeEnumerable?: boolean;
/**
* Include getter properties
*/
includeGetters?: boolean;
/**
* The object being compared against in comparison classes. (Not used
* in {@link Format}.)
*/
expect?: any;

@@ -17,0 +70,0 @@ }

+1
-1

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

{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/format.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAcxC,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAA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IAI1B,eAAe,IAAI,IAAI;IAIvB,eAAe,IAAI,IAAI;IAUvB,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAK5C,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAMhD,eAAe,IAAI,IAAI;IAIvB,UAAU,IAAI,IAAI;IAUlB,YAAY,IAAI,OAAO;IAKvB,eAAe,IAAI,IAAI;IAIvB,cAAc,IAAI,IAAI;IAItB,cAAc,IAAI,IAAI;IAQtB,cAAc,IAAI,IAAI;IAItB,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI;IAMzC,UAAU,IAAI,IAAI;IAUlB,YAAY,IAAI,OAAO;IAIvB,eAAe,IAAI,IAAI;IAIvB,cAAc,IAAI,IAAI;IAItB,cAAc,IAAI,IAAI;IAItB,cAAc,IAAI,IAAI;IAItB,WAAW,CAAC,GAAG,GAAE,GAAiB,GAAG,MAAM,EAAE;IAyB7C,SAAS,IAAI,IAAI;IAUjB,WAAW,CAAC,GAAG,GAAE,GAAiB,GAAG,OAAO;IAI5C,cAAc,IAAI,IAAI;IAItB,aAAa,IAAI,IAAI;IAUrB,aAAa,IAAI,IAAI;IAOrB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;IAazC,aAAa,IAAI,IAAI;IAIrB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI;CAKzC"}
"use strict";
// Format is the base class for all other comparators, and used
// directly by comparators for their "simplePrint" methods.
// It doesn't do comparison, just formatting.
Object.defineProperty(exports, "__esModule", { value: true });

@@ -6,0 +3,0 @@ exports.Format = void 0;

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

{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/format.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,2DAA2D;A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C,CAAA;QAC5C,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,EAAE;YAC5B,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;SAC9B;IACH,CAAC;IAED,cAAc,CAAC,GAAQ;QACrB,MAAM,GAAG,GAAoB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;YACzD,IAAI;gBACF,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;aACnB;YAAC,MAAM;gBACN,OAAO,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;aACtB;QACH,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,CAAC,IAAI;YACd,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;YACpD,CAAC,CAAC,GAAG,CAAA;IACT,CAAC;IAED,aAAa;QACX,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;IACtD,CAAC;IAED,cAAc,CAAC,GAAQ,EAAE,GAAQ;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;QACtC,KAAK,CAAC,KAAK,EAAE,CAAA;QACb,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAA;IACzB,CAAC;CACF;AA9tBD,wBA8tBC","sourcesContent":["// Format is the base class for all other comparators, and used\n// directly by comparators for their \"simplePrint\" methods.\n// It doesn't do comparison, just formatting.\n\nimport type { Style } from './styles.js'\nimport { styles } from './styles.js'\n\nconst arrayFrom = (obj: any) => {\n try {\n return Array.from(obj)\n } catch (_) {\n return null\n }\n}\n\nconst { toString } = Object.prototype\nconst objToString = (obj: any) => toString.call(obj)\n\nexport interface FormatOptions {\n parent?: Format\n sort?: boolean\n // overridden in child classes when doing simplePrint()\n seen?: (obj?: any) => false | Format\n style?: string\n bufferChunkSize?: number\n key?: any\n // used when formatting Map keys\n isKey?: boolean\n level?: number\n indent?: string\n provisional?: boolean\n includeEnumerable?: boolean\n includeGetters?: boolean\n\n // ignored in this class, but used in all children\n expect?: any\n}\n\nexport class Format {\n options: FormatOptions\n parent: Format | null\n memo: null | string\n sort: boolean\n id: null | number\n idCounter: number\n idMap: Map<any, number>\n style: Style\n bufferChunkSize: number\n key: any\n isKey: boolean\n level: number\n indent: string\n match: boolean\n object: any\n expect: any\n\n constructor(obj: any, options: FormatOptions = {}) {\n this.options = options\n this.parent = options.parent || null\n this.memo = null\n this.sort = !!options.sort\n if (typeof options.seen === 'function') {\n this.seen = options.seen\n }\n this.id = null\n this.idCounter = 0\n this.idMap = this.parent ? this.parent.idMap : new Map()\n const style = this.parent\n ? this.parent.style\n : styles[options.style || 'pretty']\n if (!style) {\n throw new TypeError(`unknown style: ${options.style}`)\n }\n this.style = style\n this.bufferChunkSize =\n this.style.bufferChunkSize === Infinity\n ? Infinity\n : options.bufferChunkSize || this.style.bufferChunkSize\n\n // for printing child values of pojos and maps\n this.key = options.key\n\n // for printing Map keys\n this.isKey = !!options.isKey\n if (this.isKey && !(this.parent && this.parent.isMap())) {\n throw new Error('isKey should only be set for Map keys')\n }\n\n this.level = this.parent ? this.parent.level + 1 : 0\n this.indent = this.parent\n ? this.parent.indent\n : typeof options.indent === 'string'\n ? options.indent\n : ' '\n this.match = true\n this.object = obj\n this.expect = obj\n }\n\n incId(): number {\n return this.parent ? this.parent.incId() : (this.idCounter += 1)\n }\n\n getId(): number {\n if (this.id) {\n return this.id\n }\n const fromMap = this.idMap.get(this.object)\n if (fromMap) {\n return (this.id = fromMap)\n }\n const id = this.incId()\n this.idMap.set(this.object, id)\n return (this.id = id)\n }\n\n seen(_?: any): false | Format {\n if (!this.object || typeof this.object !== 'object') {\n return false\n }\n\n for (let p = this.parent; p; p = p.parent) {\n if (p.object === this.object) {\n p.id = p.id || p.getId()\n return p\n }\n }\n return false\n }\n\n child(obj: any, options: FormatOptions, cls?: typeof Format) {\n // This raises an error because ts thinks 'typeof Class' is\n // a normal function, not an instantiable class. Ignore.\n //@ts-expect-error\n return new (cls || this.constructor)(obj, {\n ...this.options,\n isKey: false,\n provisional: false,\n ...options,\n parent: this,\n })\n }\n\n // type testing methods\n isError(): boolean {\n return this.object instanceof Error\n }\n\n isArguments(): boolean {\n return objToString(this.object) === '[object Arguments]'\n }\n\n isArray(): boolean {\n return (\n Array.isArray(this.object) ||\n this.isArguments() ||\n this.isIterable()\n )\n }\n\n // technically this means \"is an iterable we don't have another fit for\"\n // sets, arrays, maps, and streams all handled specially.\n isIterable(): boolean {\n return (\n this.object &&\n typeof this.object === 'object' &&\n !this.isSet() &&\n !this.isMap() &&\n !this.isStream() &&\n typeof this.object[Symbol.iterator] === 'function'\n )\n }\n\n isKeyless(): boolean {\n return (\n !this.parent ||\n this.parent.isSet() ||\n this.parent.isArray() ||\n this.parent.isString() ||\n this.isKey\n )\n }\n\n isStream(): boolean {\n const s = this.object\n return (\n !!s &&\n typeof s === 'object' &&\n (typeof s.pipe === 'function' || // readable\n typeof s.pipeTo === 'function' || // whatwg readable\n (typeof s.write === 'function' &&\n typeof s.end === 'function')) // writable\n )\n }\n\n isMap(): boolean {\n return this.object instanceof Map\n }\n\n isSet(): boolean {\n return this.object instanceof Set\n }\n\n isBuffer(): boolean {\n return Buffer.isBuffer(this.object)\n }\n\n isString(): boolean {\n return typeof this.object === 'string'\n }\n\n // end type checking functions\n\n getClass(): string {\n const ts = objToString(this.object).slice(8, -1)\n return this.object.constructor !== Object &&\n this.object.constructor &&\n this.object.constructor.name &&\n this.object.constructor.name !== ts\n ? this.object.constructor.name\n : !Object.getPrototypeOf(this.object)\n ? 'Null Object'\n : ts\n }\n\n get objectAsArray(): any[] | null {\n // return the object as an actual array, if we can\n const value = Array.isArray(this.object)\n ? this.object\n : this.isArray()\n ? arrayFrom(this.object)\n : null\n\n if (value === null) {\n this.isArray = () => false\n }\n\n Object.defineProperty(this, 'objectAsArray', {\n value,\n configurable: true,\n })\n return value\n }\n\n // printing methods\n\n // Change from v5: ONLY the print() method returns a string\n // everything else mutates this.memo, so that child classes\n // can track both this.memo AND this.expectMemo, and then calculate\n // a diff at the end.\n print(): string {\n if (this.memo !== null) {\n return this.memo\n }\n this.memo = ''\n const seen = this.seen(this.object)\n if (seen) {\n this.printCircular(seen)\n } else {\n this.printValue()\n }\n this.printStart()\n this.printEnd()\n // this should be impossible\n /* c8 ignore start */\n if (typeof this.memo !== 'string') {\n throw new Error('failed to build memo string in print() method')\n }\n /* c8 ignore stop */\n return this.memo\n }\n\n printValue(): void {\n switch (typeof this.object) {\n case 'undefined':\n this.printUndefined()\n break\n\n case 'object':\n if (!this.object) {\n this.printNull()\n } else if (this.object instanceof RegExp) {\n this.printRegExp()\n } else if (this.object instanceof Date) {\n this.printDate()\n } else {\n this.printCollection()\n }\n break\n\n case 'symbol':\n this.printSymbol()\n break\n\n case 'bigint':\n this.printBigInt()\n break\n\n case 'string':\n this.printString()\n break\n\n case 'boolean':\n this.printBoolean()\n break\n\n case 'number':\n this.printNumber()\n break\n\n case 'function':\n this.printFn()\n break\n }\n }\n\n printDate(): void {\n this.memo += this.object.toISOString()\n }\n\n printRegExp(): void {\n this.memo += this.object.toString()\n }\n\n printUndefined(): void {\n this.memo += 'undefined'\n }\n\n printNull(): void {\n this.memo += 'null'\n }\n\n printSymbol(): void {\n this.memo += this.object.toString()\n }\n\n printBigInt(): void {\n this.memo += this.object.toString() + 'n'\n }\n\n printBoolean(): void {\n this.memo += JSON.stringify(this.object)\n }\n\n printNumber(): void {\n this.memo += JSON.stringify(this.object)\n }\n\n printStart(): void {\n if (!this.parent) {\n this.memo = this.nodeId() + this.memo\n return\n }\n const indent = this.isKey ? '' : this.indentLevel()\n const key = this.isKeyless() ? '' : this.getKey()\n const sep = !key\n ? ''\n : this.parent && this.parent.isMap()\n ? this.style.mapKeyValSep()\n : this.style.pojoKeyValSep()\n this.memo =\n this.style.start(indent, key, sep) + this.nodeId() + this.memo\n }\n\n printEnd(): void {\n if (!this.parent) {\n return\n }\n this.memo +=\n this.isKey || !this.parent\n ? ''\n : this.parent.isMap()\n ? this.style.mapEntrySep()\n : this.parent.isBuffer()\n ? ''\n : this.parent.isArray()\n ? this.style.arrayEntrySep()\n : this.parent.isSet()\n ? this.style.setEntrySep()\n : this.parent.isString()\n ? ''\n : this.style.pojoEntrySep()\n }\n\n getKey(): string {\n return this.parent && this.parent.isMap()\n ? this.style.mapKeyStart() +\n this.parent.child(this.key, { isKey: true }, Format).print()\n : JSON.stringify(this.key)\n }\n\n printCircular(seen: Format): void {\n this.memo += this.style.circular(seen)\n }\n\n indentLevel(n = 0): string {\n return this.indent.repeat(this.level + n)\n }\n\n printCollection(): void {\n return this.isError()\n ? this.printError()\n : this.isSet()\n ? this.printSet()\n : this.isMap()\n ? this.printMap()\n : this.isBuffer()\n ? this.printBuffer()\n : this.isArray() && this.objectAsArray\n ? this.printArray()\n : // TODO streams, JSX\n this.printPojo()\n }\n\n nodeId(): string {\n return this.id ? this.style.nodeId(this.id) : ''\n }\n\n printBuffer(): void {\n if (this.parent && this.parent.isBuffer()) {\n this.memo +=\n this.style.bufferKey(this.key) +\n this.style.bufferKeySep() +\n this.style.bufferLine(this.object, this.bufferChunkSize)\n } else if (this.object.length === 0) {\n this.memo += this.style.bufferEmpty()\n } else if (this.bufferIsShort()) {\n this.memo +=\n this.style.bufferStart() +\n this.style.bufferBody(this.object) +\n this.style.bufferEnd(this.object)\n } else {\n this.printBufferHead()\n this.printBufferBody()\n this.printBufferTail()\n }\n }\n\n bufferIsShort(): boolean {\n return this.object.length < this.bufferChunkSize + 5\n }\n\n printBufferHead(): void {\n this.memo += this.style.bufferHead()\n }\n\n printBufferBody(): void {\n const c = this.bufferChunkSize\n let i: number\n for (i = 0; i < this.object.length - c; i += c) {\n this.printBufferLine(i, this.object.slice(i, i + c))\n }\n this.printBufferLastLine(i, this.object.slice(i, i + c))\n }\n\n printBufferLine(key: number, val: Buffer): void {\n this.printBufferLastLine(key, val)\n this.memo += this.style.bufferLineSep()\n }\n\n printBufferLastLine(key: any, val: Buffer): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printBufferTail(): void {\n this.memo += this.style.bufferTail(this.indentLevel())\n }\n\n printSet(): void {\n if (this.setIsEmpty()) {\n this.printSetEmpty()\n } else {\n this.printSetHead()\n this.printSetBody()\n this.printSetTail()\n }\n }\n\n setIsEmpty(): boolean {\n return this.object.size === 0\n }\n\n printSetEmpty(): void {\n this.memo += this.style.setEmpty(this.getClass())\n }\n\n printSetHead(): void {\n this.memo += this.style.setHead(this.getClass())\n }\n\n printSetBody(): void {\n for (const val of this.object) {\n this.printSetEntry(val)\n }\n }\n\n printSetTail(): void {\n this.memo += this.style.setTail(this.indentLevel())\n }\n\n printSetEntry(val: any): void {\n const child = this.child(val, { key: val })\n child.print()\n this.memo += child.memo\n }\n\n printMap(): void {\n if (this.mapIsEmpty()) {\n this.printMapEmpty()\n } else {\n this.printMapHead()\n this.printMapBody()\n this.printMapTail()\n }\n }\n\n mapIsEmpty(): boolean {\n return this.object.size === 0\n }\n\n printMapEmpty(): void {\n this.memo += this.style.mapEmpty(this.getClass())\n }\n\n printMapHead(): void {\n this.memo += this.style.mapHead(this.getClass())\n }\n\n getMapEntries(obj: any = this.object): [string, any][] {\n // can never get here unless obj is already a map\n /* c8 ignore start */\n if (!(obj instanceof Map)) {\n throw new TypeError('cannot get map entries for non-Map object')\n }\n /* c8 ignore stop */\n return [...obj.entries()]\n }\n\n printMapBody(): void {\n for (const [key, val] of this.getMapEntries()) {\n this.printMapEntry(key, val)\n }\n }\n\n printMapTail(): void {\n this.memo += this.style.mapTail(this.indentLevel())\n }\n\n printMapEntry(key: any, val: any): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printFn(): void {\n this.memo += this.style.fn(this.object, this.getClass())\n }\n\n printString(): void {\n if (this.parent && this.parent.isString()) {\n this.memo = this.style.stringLine(this.object)\n } else if (this.stringIsEmpty()) {\n this.printStringEmpty()\n } else if (this.stringIsOneLine()) {\n return this.printStringOneLine()\n } else {\n this.printStringHead()\n this.printStringBody()\n this.printStringTail()\n }\n }\n\n stringIsEmpty(): boolean {\n return this.object.length === 0\n }\n\n printStringEmpty(): void {\n this.memo += this.style.stringEmpty()\n }\n\n stringIsOneLine(): boolean {\n return /^[^\\n]*\\n?$/.test(this.object)\n }\n\n printStringOneLine(): void {\n this.memo += this.style.stringOneLine(this.object)\n }\n\n printStringHead(): void {\n this.memo += this.style.stringHead()\n }\n\n printStringBody(): void {\n const lines: string[] = this.object.split('\\n')\n const lastLine = lines.pop()\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]\n this.printStringLine(i, line + '\\n')\n }\n this.printStringLastLine(lines.length, lastLine + '\\n')\n }\n\n printStringLine(key: any, val: string): void {\n this.printStringLastLine(key, val)\n this.memo += this.style.stringLineSep()\n }\n\n printStringLastLine(key: any, val: string): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printStringTail(): void {\n this.memo += this.style.stringTail(this.indentLevel())\n }\n\n printArray(): void {\n if (this.arrayIsEmpty()) {\n this.printArrayEmpty()\n } else {\n this.printArrayHead()\n this.printArrayBody()\n this.printArrayTail()\n }\n }\n\n arrayIsEmpty(): boolean {\n const a = this.objectAsArray\n return !!a && a.length === 0\n }\n\n printArrayEmpty(): void {\n this.memo += this.style.arrayEmpty(this.getClass())\n }\n\n printArrayHead(): void {\n this.memo += this.style.arrayHead(this.getClass())\n }\n\n printArrayBody(): void {\n if (this.objectAsArray) {\n this.objectAsArray.forEach((val, key) =>\n this.printArrayEntry(key, val)\n )\n }\n }\n\n printArrayTail(): void {\n this.memo += this.style.arrayTail(this.indentLevel())\n }\n\n printArrayEntry(key: any, val: any): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printError(): void {\n if (this.errorIsEmpty()) {\n this.printErrorEmpty()\n } else {\n this.printErrorHead()\n this.printErrorBody()\n this.printErrorTail()\n }\n }\n\n errorIsEmpty(): boolean {\n return this.pojoIsEmpty()\n }\n\n printErrorEmpty(): void {\n this.memo += this.style.errorEmpty(this.object, this.getClass())\n }\n\n printErrorHead(): void {\n this.memo += this.style.errorHead(this.object, this.getClass())\n }\n\n printErrorTail(): void {\n this.memo += this.style.errorTail(this.indentLevel())\n }\n\n printErrorBody(): void {\n this.printPojoBody()\n }\n\n getPojoKeys(obj: any = this.object): string[] {\n if (this.options.includeEnumerable) {\n const keys = []\n for (const i in obj) {\n keys.push(i)\n }\n return keys\n } else if (this.options.includeGetters) {\n const own = new Set(Object.keys(obj))\n const proto = Object.getPrototypeOf(obj)\n if (proto) {\n const desc = Object.getOwnPropertyDescriptors(proto)\n for (const [name, prop] of Object.entries(desc)) {\n if (prop.enumerable && typeof prop.get === 'function') {\n // public wrappers around internal things are worth showing\n own.add(name)\n }\n }\n }\n return Array.from(own)\n } else {\n return Object.keys(obj)\n }\n }\n\n printPojo(): void {\n if (this.pojoIsEmpty()) {\n this.printPojoEmpty()\n } else {\n this.printPojoHead()\n this.printPojoBody()\n this.printPojoTail()\n }\n }\n\n pojoIsEmpty(obj: any = this.object): boolean {\n return this.getPojoKeys(obj).length === 0\n }\n\n printPojoEmpty(): void {\n this.memo += this.style.pojoEmpty(this.getClass())\n }\n\n printPojoHead(): void {\n // impossible\n /* c8 ignore start */\n if (this.memo === null) {\n throw new Error('pojo head while memo is null')\n }\n /* c8 ignore stop */\n this.memo += this.style.pojoHead(this.getClass())\n }\n\n printPojoBody(): void {\n const ent = this.getPojoEntries(this.object)\n for (const [key, val] of ent) {\n this.printPojoEntry(key, val)\n }\n }\n\n getPojoEntries(obj: any): [string, any][] {\n const ent: [string, any][] = this.getPojoKeys(obj).map(k => {\n try {\n return [k, obj[k]]\n } catch {\n return [k, undefined]\n }\n })\n return this.sort\n ? ent.sort((a, b) => a[0].localeCompare(b[0], 'en'))\n : ent\n }\n\n printPojoTail(): void {\n this.memo += this.style.pojoTail(this.indentLevel())\n }\n\n printPojoEntry(key: any, val: any): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n}\n"]}
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/format.ts"],"names":[],"mappings":";;;AACA,2CAAoC;AAEpC,MAAM,SAAS,GAAG,CAAC,GAAQ,EAAE,EAAE;IAC7B,IAAI;QACF,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;KACvB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,IAAI,CAAA;KACZ;AACH,CAAC,CAAA;AAED,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,SAAS,CAAA;AACrC,MAAM,WAAW,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAwEpD,MAAa,MAAM;IACjB,OAAO,CAAe;IACtB,MAAM,CAAe;IACrB,IAAI,CAAe;IACnB,IAAI,CAAS;IACb,EAAE,CAAe;IACjB,SAAS,CAAQ;IACjB,KAAK,CAAkB;IACvB,KAAK,CAAO;IACZ,eAAe,CAAQ;IACvB,GAAG,CAAK;IACR,KAAK,CAAS;IACd,KAAK,CAAQ;IACb,MAAM,CAAQ;IACd,KAAK,CAAS;IACd,MAAM,CAAK;IACX,MAAM,CAAK;IAEX,YAAY,GAAQ,EAAE,UAAyB,EAAE;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,CAAA;QACpC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC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,GAAG,EAAE,CAAC,CAAA;QACtC,KAAK,CAAC,KAAK,EAAE,CAAA;QACb,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAA;IACzB,CAAC;CACF;AA9tBD,wBA8tBC","sourcesContent":["import { Style, StyleType } from './styles.js'\nimport { styles } from './styles.js'\n\nconst arrayFrom = (obj: any) => {\n try {\n return Array.from(obj)\n } catch (_) {\n return null\n }\n}\n\nconst { toString } = Object.prototype\nconst objToString = (obj: any) => toString.call(obj)\n\n/**\n * The base class for all other comparators, and used\n * directly by comparators for their \"simplePrint\" methods.\n * It doesn't do comparison, just formatting.\n */\nexport interface FormatOptions {\n /** set when formatting keys and values of collections */\n parent?: Format\n /** sort items alphabetically by key */\n sort?: boolean\n /**\n * test whether an object has been seen, and get a reference to the\n * Format handling them, if so.\n *\n * overridden in child classes when doing simplePrint()\n */\n seen?: (obj?: any) => false | Format\n /** how to print this thing */\n style?: StyleType\n /**\n * optinally override {@link Style#bufferChunkSize }\n * */\n bufferChunkSize?: number\n /**\n * Set when printing child fields\n *\n * @internal\n */\n key?: any\n /**\n * used when formatting Map keys\n *\n * @internal\n */\n isKey?: boolean\n /**\n * level within the object graph being printed\n *\n * @internal\n */\n level?: number\n /**\n * indentation level of this object within the object graph\n *\n * @internal\n */\n indent?: string\n /**\n * used when provisionally exploring a path for comparison\n *\n * @internal\n */\n provisional?: boolean\n /**\n * Include any and all enumerable properties, including those inherited on\n * the prototype chain. By default, only `own` properties are printed.\n */\n includeEnumerable?: boolean\n /**\n * Include getter properties\n */\n includeGetters?: boolean\n\n /**\n * The object being compared against in comparison classes. (Not used\n * in {@link Format}.)\n */\n expect?: any\n}\n\nexport class Format {\n options: FormatOptions\n parent: Format | null\n memo: null | string\n sort: boolean\n id: null | number\n idCounter: number\n idMap: Map<any, number>\n style: Style\n bufferChunkSize: number\n key: any\n isKey: boolean\n level: number\n indent: string\n match: boolean\n object: any\n expect: any\n\n constructor(obj: any, options: FormatOptions = {}) {\n this.options = options\n this.parent = options.parent || null\n this.memo = null\n this.sort = !!options.sort\n if (typeof options.seen === 'function') {\n this.seen = options.seen\n }\n this.id = null\n this.idCounter = 0\n this.idMap = this.parent ? this.parent.idMap : new Map()\n const style = this.parent\n ? this.parent.style\n : styles[options.style || 'pretty']\n if (!style) {\n throw new TypeError(`unknown style: ${options.style}`)\n }\n this.style = style\n this.bufferChunkSize =\n this.style.bufferChunkSize === Infinity\n ? Infinity\n : options.bufferChunkSize || this.style.bufferChunkSize\n\n // for printing child values of pojos and maps\n this.key = options.key\n\n // for printing Map keys\n this.isKey = !!options.isKey\n if (this.isKey && !(this.parent && this.parent.isMap())) {\n throw new Error('isKey should only be set for Map keys')\n }\n\n this.level = this.parent ? this.parent.level + 1 : 0\n this.indent = this.parent\n ? this.parent.indent\n : typeof options.indent === 'string'\n ? options.indent\n : ' '\n this.match = true\n this.object = obj\n this.expect = obj\n }\n\n incId(): number {\n return this.parent ? this.parent.incId() : (this.idCounter += 1)\n }\n\n getId(): number {\n if (this.id) {\n return this.id\n }\n const fromMap = this.idMap.get(this.object)\n if (fromMap) {\n return (this.id = fromMap)\n }\n const id = this.incId()\n this.idMap.set(this.object, id)\n return (this.id = id)\n }\n\n seen(_?: any): false | Format {\n if (!this.object || typeof this.object !== 'object') {\n return false\n }\n\n for (let p = this.parent; p; p = p.parent) {\n if (p.object === this.object) {\n p.id = p.id || p.getId()\n return p\n }\n }\n return false\n }\n\n child(obj: any, options: FormatOptions, cls?: typeof Format) {\n // This raises an error because ts thinks 'typeof Class' is\n // a normal function, not an instantiable class. Ignore.\n //@ts-expect-error\n return new (cls || this.constructor)(obj, {\n ...this.options,\n isKey: false,\n provisional: false,\n ...options,\n parent: this,\n })\n }\n\n // type testing methods\n isError(): boolean {\n return this.object instanceof Error\n }\n\n isArguments(): boolean {\n return objToString(this.object) === '[object Arguments]'\n }\n\n isArray(): boolean {\n return (\n Array.isArray(this.object) ||\n this.isArguments() ||\n this.isIterable()\n )\n }\n\n // technically this means \"is an iterable we don't have another fit for\"\n // sets, arrays, maps, and streams all handled specially.\n isIterable(): boolean {\n return (\n this.object &&\n typeof this.object === 'object' &&\n !this.isSet() &&\n !this.isMap() &&\n !this.isStream() &&\n typeof this.object[Symbol.iterator] === 'function'\n )\n }\n\n isKeyless(): boolean {\n return (\n !this.parent ||\n this.parent.isSet() ||\n this.parent.isArray() ||\n this.parent.isString() ||\n this.isKey\n )\n }\n\n isStream(): boolean {\n const s = this.object\n return (\n !!s &&\n typeof s === 'object' &&\n (typeof s.pipe === 'function' || // readable\n typeof s.pipeTo === 'function' || // whatwg readable\n (typeof s.write === 'function' &&\n typeof s.end === 'function')) // writable\n )\n }\n\n isMap(): boolean {\n return this.object instanceof Map\n }\n\n isSet(): boolean {\n return this.object instanceof Set\n }\n\n isBuffer(): boolean {\n return Buffer.isBuffer(this.object)\n }\n\n isString(): boolean {\n return typeof this.object === 'string'\n }\n\n // end type checking functions\n\n getClass(): string {\n const ts = objToString(this.object).slice(8, -1)\n return this.object.constructor !== Object &&\n this.object.constructor &&\n this.object.constructor.name &&\n this.object.constructor.name !== ts\n ? this.object.constructor.name\n : !Object.getPrototypeOf(this.object)\n ? 'Null Object'\n : ts\n }\n\n get objectAsArray(): any[] | null {\n // return the object as an actual array, if we can\n const value = Array.isArray(this.object)\n ? this.object\n : this.isArray()\n ? arrayFrom(this.object)\n : null\n\n if (value === null) {\n this.isArray = () => false\n }\n\n Object.defineProperty(this, 'objectAsArray', {\n value,\n configurable: true,\n })\n return value\n }\n\n // printing methods\n\n // Change from v5: ONLY the print() method returns a string\n // everything else mutates this.memo, so that child classes\n // can track both this.memo AND this.expectMemo, and then calculate\n // a diff at the end.\n print(): string {\n if (this.memo !== null) {\n return this.memo\n }\n this.memo = ''\n const seen = this.seen(this.object)\n if (seen) {\n this.printCircular(seen)\n } else {\n this.printValue()\n }\n this.printStart()\n this.printEnd()\n // this should be impossible\n /* c8 ignore start */\n if (typeof this.memo !== 'string') {\n throw new Error('failed to build memo string in print() method')\n }\n /* c8 ignore stop */\n return this.memo\n }\n\n printValue(): void {\n switch (typeof this.object) {\n case 'undefined':\n this.printUndefined()\n break\n\n case 'object':\n if (!this.object) {\n this.printNull()\n } else if (this.object instanceof RegExp) {\n this.printRegExp()\n } else if (this.object instanceof Date) {\n this.printDate()\n } else {\n this.printCollection()\n }\n break\n\n case 'symbol':\n this.printSymbol()\n break\n\n case 'bigint':\n this.printBigInt()\n break\n\n case 'string':\n this.printString()\n break\n\n case 'boolean':\n this.printBoolean()\n break\n\n case 'number':\n this.printNumber()\n break\n\n case 'function':\n this.printFn()\n break\n }\n }\n\n printDate(): void {\n this.memo += this.object.toISOString()\n }\n\n printRegExp(): void {\n this.memo += this.object.toString()\n }\n\n printUndefined(): void {\n this.memo += 'undefined'\n }\n\n printNull(): void {\n this.memo += 'null'\n }\n\n printSymbol(): void {\n this.memo += this.object.toString()\n }\n\n printBigInt(): void {\n this.memo += this.object.toString() + 'n'\n }\n\n printBoolean(): void {\n this.memo += JSON.stringify(this.object)\n }\n\n printNumber(): void {\n this.memo += JSON.stringify(this.object)\n }\n\n printStart(): void {\n if (!this.parent) {\n this.memo = this.nodeId() + this.memo\n return\n }\n const indent = this.isKey ? '' : this.indentLevel()\n const key = this.isKeyless() ? '' : this.getKey()\n const sep = !key\n ? ''\n : this.parent && this.parent.isMap()\n ? this.style.mapKeyValSep()\n : this.style.pojoKeyValSep()\n this.memo =\n this.style.start(indent, key, sep) + this.nodeId() + this.memo\n }\n\n printEnd(): void {\n if (!this.parent) {\n return\n }\n this.memo +=\n this.isKey || !this.parent\n ? ''\n : this.parent.isMap()\n ? this.style.mapEntrySep()\n : this.parent.isBuffer()\n ? ''\n : this.parent.isArray()\n ? this.style.arrayEntrySep()\n : this.parent.isSet()\n ? this.style.setEntrySep()\n : this.parent.isString()\n ? ''\n : this.style.pojoEntrySep()\n }\n\n getKey(): string {\n return this.parent && this.parent.isMap()\n ? this.style.mapKeyStart() +\n this.parent.child(this.key, { isKey: true }, Format).print()\n : JSON.stringify(this.key)\n }\n\n printCircular(seen: Format): void {\n this.memo += this.style.circular(seen)\n }\n\n indentLevel(n = 0): string {\n return this.indent.repeat(this.level + n)\n }\n\n printCollection(): void {\n return this.isError()\n ? this.printError()\n : this.isSet()\n ? this.printSet()\n : this.isMap()\n ? this.printMap()\n : this.isBuffer()\n ? this.printBuffer()\n : this.isArray() && this.objectAsArray\n ? this.printArray()\n : // TODO streams, JSX\n this.printPojo()\n }\n\n nodeId(): string {\n return this.id ? this.style.nodeId(this.id) : ''\n }\n\n printBuffer(): void {\n if (this.parent && this.parent.isBuffer()) {\n this.memo +=\n this.style.bufferKey(this.key) +\n this.style.bufferKeySep() +\n this.style.bufferLine(this.object, this.bufferChunkSize)\n } else if (this.object.length === 0) {\n this.memo += this.style.bufferEmpty()\n } else if (this.bufferIsShort()) {\n this.memo +=\n this.style.bufferStart() +\n this.style.bufferBody(this.object) +\n this.style.bufferEnd(this.object)\n } else {\n this.printBufferHead()\n this.printBufferBody()\n this.printBufferTail()\n }\n }\n\n bufferIsShort(): boolean {\n return this.object.length < this.bufferChunkSize + 5\n }\n\n printBufferHead(): void {\n this.memo += this.style.bufferHead()\n }\n\n printBufferBody(): void {\n const c = this.bufferChunkSize\n let i: number\n for (i = 0; i < this.object.length - c; i += c) {\n this.printBufferLine(i, this.object.slice(i, i + c))\n }\n this.printBufferLastLine(i, this.object.slice(i, i + c))\n }\n\n printBufferLine(key: number, val: Buffer): void {\n this.printBufferLastLine(key, val)\n this.memo += this.style.bufferLineSep()\n }\n\n printBufferLastLine(key: any, val: Buffer): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printBufferTail(): void {\n this.memo += this.style.bufferTail(this.indentLevel())\n }\n\n printSet(): void {\n if (this.setIsEmpty()) {\n this.printSetEmpty()\n } else {\n this.printSetHead()\n this.printSetBody()\n this.printSetTail()\n }\n }\n\n setIsEmpty(): boolean {\n return this.object.size === 0\n }\n\n printSetEmpty(): void {\n this.memo += this.style.setEmpty(this.getClass())\n }\n\n printSetHead(): void {\n this.memo += this.style.setHead(this.getClass())\n }\n\n printSetBody(): void {\n for (const val of this.object) {\n this.printSetEntry(val)\n }\n }\n\n printSetTail(): void {\n this.memo += this.style.setTail(this.indentLevel())\n }\n\n printSetEntry(val: any): void {\n const child = this.child(val, { key: val })\n child.print()\n this.memo += child.memo\n }\n\n printMap(): void {\n if (this.mapIsEmpty()) {\n this.printMapEmpty()\n } else {\n this.printMapHead()\n this.printMapBody()\n this.printMapTail()\n }\n }\n\n mapIsEmpty(): boolean {\n return this.object.size === 0\n }\n\n printMapEmpty(): void {\n this.memo += this.style.mapEmpty(this.getClass())\n }\n\n printMapHead(): void {\n this.memo += this.style.mapHead(this.getClass())\n }\n\n getMapEntries(obj: any = this.object): [string, any][] {\n // can never get here unless obj is already a map\n /* c8 ignore start */\n if (!(obj instanceof Map)) {\n throw new TypeError('cannot get map entries for non-Map object')\n }\n /* c8 ignore stop */\n return [...obj.entries()]\n }\n\n printMapBody(): void {\n for (const [key, val] of this.getMapEntries()) {\n this.printMapEntry(key, val)\n }\n }\n\n printMapTail(): void {\n this.memo += this.style.mapTail(this.indentLevel())\n }\n\n printMapEntry(key: any, val: any): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printFn(): void {\n this.memo += this.style.fn(this.object, this.getClass())\n }\n\n printString(): void {\n if (this.parent && this.parent.isString()) {\n this.memo = this.style.stringLine(this.object)\n } else if (this.stringIsEmpty()) {\n this.printStringEmpty()\n } else if (this.stringIsOneLine()) {\n return this.printStringOneLine()\n } else {\n this.printStringHead()\n this.printStringBody()\n this.printStringTail()\n }\n }\n\n stringIsEmpty(): boolean {\n return this.object.length === 0\n }\n\n printStringEmpty(): void {\n this.memo += this.style.stringEmpty()\n }\n\n stringIsOneLine(): boolean {\n return /^[^\\n]*\\n?$/.test(this.object)\n }\n\n printStringOneLine(): void {\n this.memo += this.style.stringOneLine(this.object)\n }\n\n printStringHead(): void {\n this.memo += this.style.stringHead()\n }\n\n printStringBody(): void {\n const lines: string[] = this.object.split('\\n')\n const lastLine = lines.pop()\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]\n this.printStringLine(i, line + '\\n')\n }\n this.printStringLastLine(lines.length, lastLine + '\\n')\n }\n\n printStringLine(key: any, val: string): void {\n this.printStringLastLine(key, val)\n this.memo += this.style.stringLineSep()\n }\n\n printStringLastLine(key: any, val: string): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printStringTail(): void {\n this.memo += this.style.stringTail(this.indentLevel())\n }\n\n printArray(): void {\n if (this.arrayIsEmpty()) {\n this.printArrayEmpty()\n } else {\n this.printArrayHead()\n this.printArrayBody()\n this.printArrayTail()\n }\n }\n\n arrayIsEmpty(): boolean {\n const a = this.objectAsArray\n return !!a && a.length === 0\n }\n\n printArrayEmpty(): void {\n this.memo += this.style.arrayEmpty(this.getClass())\n }\n\n printArrayHead(): void {\n this.memo += this.style.arrayHead(this.getClass())\n }\n\n printArrayBody(): void {\n if (this.objectAsArray) {\n this.objectAsArray.forEach((val, key) =>\n this.printArrayEntry(key, val)\n )\n }\n }\n\n printArrayTail(): void {\n this.memo += this.style.arrayTail(this.indentLevel())\n }\n\n printArrayEntry(key: any, val: any): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printError(): void {\n if (this.errorIsEmpty()) {\n this.printErrorEmpty()\n } else {\n this.printErrorHead()\n this.printErrorBody()\n this.printErrorTail()\n }\n }\n\n errorIsEmpty(): boolean {\n return this.pojoIsEmpty()\n }\n\n printErrorEmpty(): void {\n this.memo += this.style.errorEmpty(this.object, this.getClass())\n }\n\n printErrorHead(): void {\n this.memo += this.style.errorHead(this.object, this.getClass())\n }\n\n printErrorTail(): void {\n this.memo += this.style.errorTail(this.indentLevel())\n }\n\n printErrorBody(): void {\n this.printPojoBody()\n }\n\n getPojoKeys(obj: any = this.object): string[] {\n if (this.options.includeEnumerable) {\n const keys = []\n for (const i in obj) {\n keys.push(i)\n }\n return keys\n } else if (this.options.includeGetters) {\n const own = new Set(Object.keys(obj))\n const proto = Object.getPrototypeOf(obj)\n if (proto) {\n const desc = Object.getOwnPropertyDescriptors(proto)\n for (const [name, prop] of Object.entries(desc)) {\n if (prop.enumerable && typeof prop.get === 'function') {\n // public wrappers around internal things are worth showing\n own.add(name)\n }\n }\n }\n return Array.from(own)\n } else {\n return Object.keys(obj)\n }\n }\n\n printPojo(): void {\n if (this.pojoIsEmpty()) {\n this.printPojoEmpty()\n } else {\n this.printPojoHead()\n this.printPojoBody()\n this.printPojoTail()\n }\n }\n\n pojoIsEmpty(obj: any = this.object): boolean {\n return this.getPojoKeys(obj).length === 0\n }\n\n printPojoEmpty(): void {\n this.memo += this.style.pojoEmpty(this.getClass())\n }\n\n printPojoHead(): void {\n // impossible\n /* c8 ignore start */\n if (this.memo === null) {\n throw new Error('pojo head while memo is null')\n }\n /* c8 ignore stop */\n this.memo += this.style.pojoHead(this.getClass())\n }\n\n printPojoBody(): void {\n const ent = this.getPojoEntries(this.object)\n for (const [key, val] of ent) {\n this.printPojoEntry(key, val)\n }\n }\n\n getPojoEntries(obj: any): [string, any][] {\n const ent: [string, any][] = this.getPojoKeys(obj).map(k => {\n try {\n return [k, obj[k]]\n } catch {\n return [k, undefined]\n }\n })\n return this.sort\n ? ent.sort((a, b) => a[0].localeCompare(b[0], 'en'))\n : ent\n }\n\n printPojoTail(): void {\n this.memo += this.style.pojoTail(this.indentLevel())\n }\n\n printPojoEntry(key: any, val: any): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n}\n"]}
import { Has } from './has.js';
/**
* The same as {@link Has}, but strictly compare all properties
*/
export declare class HasStrict extends Has {

@@ -3,0 +6,0 @@ test(): boolean | "COMPLEX";

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

{"version":3,"file":"has-strict.d.ts","sourceRoot":"","sources":["../../src/has-strict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,qBAAa,SAAU,SAAQ,GAAG;IAChC,IAAI;CAmBL"}
{"version":3,"file":"has-strict.d.ts","sourceRoot":"","sources":["../../src/has-strict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B;;GAEG;AACH,qBAAa,SAAU,SAAQ,GAAG;IAChC,IAAI;CAmBL"}

@@ -6,2 +6,5 @@ "use strict";

const strict_js_1 = require("./strict.js");
/**
* The same as {@link Has}, but strictly compare all properties
*/
class HasStrict extends has_js_1.Has {

@@ -8,0 +11,0 @@ test() {

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

{"version":3,"file":"has-strict.js","sourceRoot":"","sources":["../../src/has-strict.ts"],"names":[],"mappings":";;;AAAA,qCAA8B;AAC9B,2CAAoC;AACpC,MAAa,SAAU,SAAQ,YAAG;IAChC,IAAI;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;QACrB,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;QACrB,gEAAgE;QAChE,8DAA8D;QAC9D,4DAA4D;QAC5D,gEAAgE;QAChE,IACE,CAAC;YACD,CAAC;YACD,OAAO,CAAC,KAAK,QAAQ;YACrB,OAAO,CAAC,KAAK,QAAQ;YACrB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EACrC;YACA,OAAO,KAAK,CAAC,IAAI,EAAE,CAAA;SACpB;aAAM;YACL,OAAO,kBAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SACxC;IACH,CAAC;CACF;AApBD,8BAoBC","sourcesContent":["import { Has } from './has.js'\nimport { Strict } from './strict.js'\nexport class HasStrict extends Has {\n test() {\n const a = this.object\n const b = this.expect\n // constructor match is relevant to Strict, but HasStrict should\n // not do that, it's inconvenient, since it means you can't do\n // hasStrict(new URL('https://x.com/y'), { pathname: '/y' })\n // So, for objects, we call Same. Everything else, call Strict.\n if (\n a &&\n b &&\n typeof a === 'object' &&\n typeof b === 'object' &&\n Array.isArray(a) === Array.isArray(b)\n ) {\n return super.test()\n } else {\n return Strict.prototype.test.call(this)\n }\n }\n}\n"]}
{"version":3,"file":"has-strict.js","sourceRoot":"","sources":["../../src/has-strict.ts"],"names":[],"mappings":";;;AAAA,qCAA8B;AAC9B,2CAAoC;AACpC;;GAEG;AACH,MAAa,SAAU,SAAQ,YAAG;IAChC,IAAI;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;QACrB,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;QACrB,gEAAgE;QAChE,8DAA8D;QAC9D,4DAA4D;QAC5D,gEAAgE;QAChE,IACE,CAAC;YACD,CAAC;YACD,OAAO,CAAC,KAAK,QAAQ;YACrB,OAAO,CAAC,KAAK,QAAQ;YACrB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EACrC;YACA,OAAO,KAAK,CAAC,IAAI,EAAE,CAAA;SACpB;aAAM;YACL,OAAO,kBAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SACxC;IACH,CAAC;CACF;AApBD,8BAoBC","sourcesContent":["import { Has } from './has.js'\nimport { Strict } from './strict.js'\n/**\n * The same as {@link Has}, but strictly compare all properties\n */\nexport class HasStrict extends Has {\n test() {\n const a = this.object\n const b = this.expect\n // constructor match is relevant to Strict, but HasStrict should\n // not do that, it's inconvenient, since it means you can't do\n // hasStrict(new URL('https://x.com/y'), { pathname: '/y' })\n // So, for objects, we call Same. Everything else, call Strict.\n if (\n a &&\n b &&\n typeof a === 'object' &&\n typeof b === 'object' &&\n Array.isArray(a) === Array.isArray(b)\n ) {\n return super.test()\n } else {\n return Strict.prototype.test.call(this)\n }\n }\n}\n"]}
import { Same } from './same.js';
/**
* The same as {@link Same}, but ignore any fields present in the
* test object and not present in the expect pattern.
*/
export declare class Has extends Same {

@@ -3,0 +7,0 @@ simpleMatch(): void;

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

{"version":3,"file":"has.d.ts","sourceRoot":"","sources":["../../src/has.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,qBAAa,GAAI,SAAQ,IAAI;IAG3B,WAAW;IAOX,OAAO;IAKP,cAAc,CAAC,GAAG,EAAE,GAAG;IAsBvB,uBAAuB,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG;IAK5C,IAAI,aAAa,iBAmBhB;IAGD,cAAc;IAad,YAAY;CA4Cb"}
{"version":3,"file":"has.d.ts","sourceRoot":"","sources":["../../src/has.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC;;;GAGG;AACH,qBAAa,GAAI,SAAQ,IAAI;IAG3B,WAAW;IAOX,OAAO;IAKP,cAAc,CAAC,GAAG,EAAE,GAAG;IAsBvB,uBAAuB,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG;IAK5C,IAAI,aAAa,iBAmBhB;IAGD,cAAc;IAad,YAAY;CA4Cb"}

@@ -6,2 +6,6 @@ "use strict";

const same_js_1 = require("./same.js");
/**
* The same as {@link Same}, but ignore any fields present in the
* test object and not present in the expect pattern.
*/
class Has extends same_js_1.Same {

@@ -8,0 +12,0 @@ // don't care about object shape, only that it has

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

{"version":3,"file":"has.js","sourceRoot":"","sources":["../../src/has.ts"],"names":[],"mappings":";;;AAAA,2CAAoC;AACpC,uCAAgC;AAChC,MAAa,GAAI,SAAQ,cAAI;IAC3B,kDAAkD;IAClD,oCAAoC;IACpC,WAAW;QACT,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;QACzB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,IAAI,CAAC,OAAO,EAAE,CAAA;SACf;IACH,CAAC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C,QAAQ,EAAE;gBACb,IAAI,CAAC,OAAO,EAAE,CAAA;gBACd,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAC1C,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAChD,OAAM;aACP;SACF;IACH,CAAC;CACF;AAzHD,kBAyHC","sourcesContent":["import { Format } from './format.js'\nimport { Same } from './same.js'\nexport class Has extends Same {\n // don't care about object shape, only that it has\n // matching fields of the same type.\n simpleMatch() {\n this.simple = this.test()\n if (!this.simple) {\n this.unmatch()\n }\n }\n\n isArray() {\n return super.isArray() && new Format(this.expect).isArray()\n }\n\n // just return the entries that exist in the expect object\n getPojoEntries(obj: any) {\n if (obj !== this.object) {\n return super.getPojoEntries(obj)\n }\n const expKeys = this.getPojoKeys(this.expect)\n const expSet = new Set(expKeys)\n const objKeys = this.getPojoKeys(obj)\n const objSet = new Set(objKeys)\n for (const k of expKeys) {\n if (!objSet.has(k) && this.expect[k] == undefined) {\n objKeys.push(k)\n }\n }\n const ent: [string, any][] = objKeys\n .filter(k => expSet.has(k))\n .map(k => [k, obj[k]])\n\n return this.sort\n ? ent.sort((a, b) => a[0].localeCompare(b[0], 'en'))\n : ent\n }\n\n printMapEntryUnexpected(_key: any, _val: any) {\n // nothing to do, this is fine\n }\n\n // only test expected array entries within the expect array length\n get objectAsArray() {\n const arr = super.objectAsArray\n if (arr) {\n const exp = super.expectAsArray\n if (exp && exp.length < arr.length) {\n const value = arr.slice(0, exp.length)\n Object.defineProperty(this, 'objectAsArray', {\n value,\n configurable: true,\n })\n return value\n }\n }\n const value = arr\n Object.defineProperty(this, 'objectAsArray', {\n value,\n configurable: true,\n })\n return value\n }\n\n // always include message/name, so you can do t.has(er, { message }) etc.\n printErrorBody() {\n super.printErrorBody()\n const expKeys = new Set(this.getPojoKeys(this.expect))\n if (expKeys.has('name') && this.expect.name) {\n this.printPojoEntry('name', this.object.name)\n }\n if (expKeys.has('message') && this.expect.message) {\n this.printPojoEntry('message', this.object.message)\n }\n }\n\n // this one is a little tricky, because we need to only walk the ones that\n // actually exist in the expect set.\n printSetBody() {\n // if there are MORE items in the expectation, that's always a fail.\n if (this.expect.size > this.object.size) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect += this.simplePrint(this.expect)\n return\n }\n const seen = new Set()\n // skip all identity matches\n for (const val of this.expect) {\n if (this.object.has(val)) {\n seen.add(val)\n continue\n }\n }\n for (const exp of this.expect) {\n if (seen.has(exp)) {\n continue\n }\n let sawMatch = false\n for (const val of this.object) {\n if (seen.has(val)) {\n continue\n }\n const s = this.child(val, {\n expect: exp,\n provisional: true,\n })\n s.print()\n if (s.match) {\n sawMatch = true\n seen.add(val)\n break\n }\n }\n if (!sawMatch) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect += this.simplePrint(this.expect)\n return\n }\n }\n }\n}\n"]}
{"version":3,"file":"has.js","sourceRoot":"","sources":["../../src/has.ts"],"names":[],"mappings":";;;AAAA,2CAAoC;AACpC,uCAAgC;AAChC;;;GAGG;AACH,MAAa,GAAI,SAAQ,cAAI;IAC3B,kDAAkD;IAClD,oCAAoC;IACpC,WAAW;QACT,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;QACzB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,IAAI,CAAC,OAAO,EAAE,CAAA;SACf;IACH,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC,OAAO,EAAE,IAAI,IAAI,kBAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAA;IAC7D,CAAC;IAED,0DAA0D;IAC1D,cAAc,CAAC,GAAQ;QACrB,IAAI,GAAG,KAAK,IAAI,CAAC,MAAM,EAAE;YACvB,OAAO,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAA;SACjC;Q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ent":["import { Format } from './format.js'\nimport { Same } from './same.js'\n/**\n * The same as {@link Same}, but ignore any fields present in the\n * test object and not present in the expect pattern.\n */\nexport class Has extends Same {\n // don't care about object shape, only that it has\n // matching fields of the same type.\n simpleMatch() {\n this.simple = this.test()\n if (!this.simple) {\n this.unmatch()\n }\n }\n\n isArray() {\n return super.isArray() && new Format(this.expect).isArray()\n }\n\n // just return the entries that exist in the expect object\n getPojoEntries(obj: any) {\n if (obj !== this.object) {\n return super.getPojoEntries(obj)\n }\n const expKeys = this.getPojoKeys(this.expect)\n const expSet = new Set(expKeys)\n const objKeys = this.getPojoKeys(obj)\n const objSet = new Set(objKeys)\n for (const k of expKeys) {\n if (!objSet.has(k) && this.expect[k] == undefined) {\n objKeys.push(k)\n }\n }\n const ent: [string, any][] = objKeys\n .filter(k => expSet.has(k))\n .map(k => [k, obj[k]])\n\n return this.sort\n ? ent.sort((a, b) => a[0].localeCompare(b[0], 'en'))\n : ent\n }\n\n printMapEntryUnexpected(_key: any, _val: any) {\n // nothing to do, this is fine\n }\n\n // only test expected array entries within the expect array length\n get objectAsArray() {\n const arr = super.objectAsArray\n if (arr) {\n const exp = super.expectAsArray\n if (exp && exp.length < arr.length) {\n const value = arr.slice(0, exp.length)\n Object.defineProperty(this, 'objectAsArray', {\n value,\n configurable: true,\n })\n return value\n }\n }\n const value = arr\n Object.defineProperty(this, 'objectAsArray', {\n value,\n configurable: true,\n })\n return value\n }\n\n // always include message/name, so you can do t.has(er, { message }) etc.\n printErrorBody() {\n super.printErrorBody()\n const expKeys = new Set(this.getPojoKeys(this.expect))\n if (expKeys.has('name') && this.expect.name) {\n this.printPojoEntry('name', this.object.name)\n }\n if (expKeys.has('message') && this.expect.message) {\n this.printPojoEntry('message', this.object.message)\n }\n }\n\n // this one is a little tricky, because we need to only walk the ones that\n // actually exist in the expect set.\n printSetBody() {\n // if there are MORE items in the expectation, that's always a fail.\n if (this.expect.size > this.object.size) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect += this.simplePrint(this.expect)\n return\n }\n const seen = new Set()\n // skip all identity matches\n for (const val of this.expect) {\n if (this.object.has(val)) {\n seen.add(val)\n continue\n }\n }\n for (const exp of this.expect) {\n if (seen.has(exp)) {\n continue\n }\n let sawMatch = false\n for (const val of this.object) {\n if (seen.has(val)) {\n continue\n }\n const s = this.child(val, {\n expect: exp,\n provisional: true,\n })\n s.print()\n if (s.match) {\n sawMatch = true\n seen.add(val)\n break\n }\n }\n if (!sawMatch) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect += this.simplePrint(this.expect)\n return\n }\n }\n }\n}\n"]}

@@ -0,16 +1,40 @@

/**
* Export all implementation classes, and convenience methods for each
* @module
*/
import { FormatOptions } from './format.js';
import { SameOptions } from './same.js';
/**
* The return value from all comparison functions.
*/
export interface Result {
/**
* Diff of formatted test object and expected pattern. Only shows
* properties which differ, not the entire object.
*/
diff: string;
/**
* whether or not the objects are a satisfying match
*/
match: boolean;
}
export type CompareOptions = FormatOptions & Pick<SameOptions, 'diffContext'>;
/** format a value and return the formatted string */
export declare const format: (obj: any, options?: FormatOptions) => string;
/** convenience method for {@link Same} */
export declare const same: (obj: any, pattern: any, options?: CompareOptions) => Result;
/** convenience method for {@link Strict} */
export declare const strict: (obj: any, pattern: any, options?: CompareOptions) => Result;
/** convenience method for {@link Has} */
export declare const has: (obj: any, pattern: any, options?: CompareOptions) => Result;
/** convenience method for {@link HasStrict} */
export declare const hasStrict: (obj: any, pattern: any, options?: CompareOptions) => Result;
/** convenience method for {@link Match} */
export declare const match: (obj: any, pattern: any, options?: CompareOptions) => Result;
/** convenience method for {@link MatchOnly} */
export declare const matchOnly: (obj: any, pattern: any, options?: CompareOptions) => Result;
/** convenience method for {@link MatchStrict} */
export declare const matchStrict: (obj: any, pattern: any, options?: CompareOptions) => Result;
/** convenience method for {@link MatchOnlyStrict} */
export declare const matchOnlyStrict: (obj: any, pattern: any, options?: CompareOptions) => Result;
export { Format } from './format.js';

@@ -22,2 +46,3 @@ export type { FormatOptions } from './format.js';

export { MatchStrict } from './match-strict.js';
export { MatchOnlyStrict } from './match-only-strict.js';
export { Match } from './match.js';

@@ -24,0 +49,0 @@ export { Same } from './same.js';

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

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,aAAa,EAAE,MAAM,aAAa,CAAA;AAMnD,OAAO,EAAQ,WAAW,EAAE,MAAM,WAAW,CAAA;AAG7C,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,OAAO,CAAA;CACf;AAOD,MAAM,MAAM,cAAc,GAAG,aAAa,GACxC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAA;AAYlC,eAAO,MAAM,MAAM,QACZ,GAAG,YACC,aAAa,KACrB,MAA0C,CAAA;AAE7C,eAAO,MAAM,IAAI,QAdT,GAAG,WAAW,GAAG,YAAW,cAAc,WActB,CAAA;AAC5B,eAAO,MAAM,MAAM,QAfX,GAAG,WAAW,GAAG,YAAW,cAAc,WAelB,CAAA;AAChC,eAAO,MAAM,GAAG,QAhBR,GAAG,WAAW,GAAG,YAAW,cAAc,WAgBxB,CAAA;AAC1B,eAAO,MAAM,SAAS,QAjBd,GAAG,WAAW,GAAG,YAAW,cAAc,WAiBZ,CAAA;AACtC,eAAO,MAAM,KAAK,QAlBV,GAAG,WAAW,GAAG,YAAW,cAAc,WAkBpB,CAAA;AAC9B,eAAO,MAAM,SAAS,QAnBd,GAAG,WAAW,GAAG,YAAW,cAAc,WAmBZ,CAAA;AACtC,eAAO,MAAM,WAAW,QApBhB,GAAG,WAAW,GAAG,YAAW,cAAc,WAoBR,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA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,GAAG,WAAW,GAAG,YAAW,cAAc,WAqBZ,CAAA;AACtC,2CAA2C;AAC3C,eAAO,MAAM,KAAK,QAvBV,GAAG,WAAW,GAAG,YAAW,cAAc,WAuBpB,CAAA;AAC9B,+CAA+C;AAC/C,eAAO,MAAM,SAAS,QAzBd,GAAG,WAAW,GAAG,YAAW,cAAc,WAyBZ,CAAA;AACtC,iDAAiD;AACjD,eAAO,MAAM,WAAW,QA3BhB,GAAG,WAAW,GAAG,YAAW,cAAc,WA2BR,CAAA;AAC1C,qDAAqD;AACrD,eAAO,MAAM,eAAe,QA7BpB,GAAG,WAAW,GAAG,YAAW,cAAc,WA6BA,CAAA;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,YAAY,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA"}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.styles = exports.Strict = exports.Same = exports.Match = exports.MatchStrict = exports.MatchOnly = exports.Has = exports.HasStrict = exports.Format = exports.matchStrict = exports.matchOnly = exports.match = exports.hasStrict = exports.has = exports.strict = exports.same = exports.format = void 0;
exports.styles = exports.Strict = exports.Same = exports.Match = exports.MatchOnlyStrict = exports.MatchStrict = exports.MatchOnly = exports.Has = exports.HasStrict = exports.Format = exports.matchOnlyStrict = exports.matchStrict = exports.matchOnly = exports.match = exports.hasStrict = exports.has = exports.strict = exports.same = exports.format = void 0;
/**
* Export all implementation classes, and convenience methods for each
* @module
*/
const format_js_1 = require("./format.js");

@@ -9,2 +13,3 @@ const has_strict_js_1 = require("./has-strict.js");

const match_strict_js_1 = require("./match-strict.js");
const match_only_strict_js_1 = require("./match-only-strict.js");
const match_js_1 = require("./match.js");

@@ -22,11 +27,21 @@ const same_js_1 = require("./same.js");

}));
/** format a value and return the formatted string */
const format = (obj, options = {}) => new format_js_1.Format(obj, options).print();
exports.format = format;
/** convenience method for {@link Same} */
exports.same = fn(same_js_1.Same);
/** convenience method for {@link Strict} */
exports.strict = fn(strict_js_1.Strict);
/** convenience method for {@link Has} */
exports.has = fn(has_js_1.Has);
/** convenience method for {@link HasStrict} */
exports.hasStrict = fn(has_strict_js_1.HasStrict);
/** convenience method for {@link Match} */
exports.match = fn(match_js_1.Match);
/** convenience method for {@link MatchOnly} */
exports.matchOnly = fn(match_only_js_1.MatchOnly);
/** convenience method for {@link MatchStrict} */
exports.matchStrict = fn(match_strict_js_1.MatchStrict);
/** convenience method for {@link MatchOnlyStrict} */
exports.matchOnlyStrict = fn(match_only_strict_js_1.MatchOnlyStrict);
var format_js_2 = require("./format.js");

@@ -42,2 +57,4 @@ Object.defineProperty(exports, "Format", { enumerable: true, get: function () { return format_js_2.Format; } });

Object.defineProperty(exports, "MatchStrict", { enumerable: true, get: function () { return match_strict_js_2.MatchStrict; } });
var match_only_strict_js_2 = require("./match-only-strict.js");
Object.defineProperty(exports, "MatchOnlyStrict", { enumerable: true, get: function () { return match_only_strict_js_2.MatchOnlyStrict; } });
var match_js_2 = require("./match.js");

@@ -44,0 +61,0 @@ Object.defineProperty(exports, "Match", { enumerable: true, get: function () { return match_js_2.Match; } });

@@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;AAClB,mCAA8B;AAArB,6FAAA,GAAG,OAAA;AACZ,iDAA2C;AAAlC,0GAAA,SAAS,OAAA;AAClB,qDAA+C;AAAtC,8GAAA,WAAW,OAAA;AACpB,uCAAkC;AAAzB,iGAAA,KAAK,OAAA;AACd,qCAAgC;AAAvB,+FAAA,IAAI,OAAA;AAEb,yCAAoC;AAA3B,mGAAA,MAAM,OAAA;AACf,yCAAoC;AAA3B,mGAAA,MAAM,OAAA","sourcesContent":["import { Format, FormatOptions } from './format.js'\nimport { HasStrict } from './has-strict.js'\nimport { Has } from './has.js'\nimport { MatchOnly } from './match-only.js'\nimport { MatchStrict } from './match-strict.js'\nimport { Match } from './match.js'\nimport { Same, SameOptions } from './same.js'\nimport { Strict } from './strict.js'\n\nexport interface Result {\n diff: string\n match: boolean\n}\nconst simple = <T extends Same>(o: T): Result => ({\n diff: o.print(),\n match: o.match,\n})\n\ntype Class<T> = { new (obj: any, options: SameOptions): T }\nexport type CompareOptions = FormatOptions &\n Pick<SameOptions, 'diffContext'>\nconst fn =\n <T extends Same>(Cls: Class<T>) =>\n (obj: any, pattern: any, options: CompareOptions = {}) =>\n simple<T>(\n new Cls(obj, {\n ...options,\n expect: pattern,\n parent: undefined,\n })\n )\n\nexport const format = (\n obj: any,\n options: FormatOptions = {}\n): string => new Format(obj, options).print()\n\nexport const same = fn(Same)\nexport const strict = fn(Strict)\nexport const has = fn(Has)\nexport const hasStrict = fn(HasStrict)\nexport const match = fn(Match)\nexport const matchOnly = fn(MatchOnly)\nexport const matchStrict = fn(MatchStrict)\nexport { Format } from './format.js'\nexport type { FormatOptions } from './format.js'\nexport { HasStrict } from './has-strict.js'\nexport { Has } from './has.js'\nexport { MatchOnly } from './match-only.js'\nexport { MatchStrict } from './match-strict.js'\nexport { Match } from './match.js'\nexport { Same } from './same.js'\nexport type { SameOptions } from './same.js'\nexport { Strict } from './strict.js'\nexport { styles } from './styles.js'\nexport type { Style } from './styles.js'\n"]}
{"version":3,"file":"index.js","sourceRo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AG,EAAE,CAAC,6BAAW,CAAC,CAAA;AAC1C,qDAAqD;AACxC,QAAA,eAAe,GAAG,EAAE,CAAC,sCAAe,CAAC,CAAA;AAElD,yCAAoC;AAA3B,mGAAA,MAAM,OAAA;AAEf,iDAA2C;AAAlC,0GAAA,SAAS,OAAA;AAClB,mCAA8B;AAArB,6FAAA,GAAG,OAAA;AACZ,iDAA2C;AAAlC,0GAAA,SAAS,OAAA;AAClB,qDAA+C;AAAtC,8GAAA,WAAW,OAAA;AACpB,+DAAwD;AAA/C,uHAAA,eAAe,OAAA;AACxB,uCAAkC;AAAzB,iGAAA,KAAK,OAAA;AACd,qCAAgC;AAAvB,+FAAA,IAAI,OAAA;AAEb,yCAAoC;AAA3B,mGAAA,MAAM,OAAA;AACf,yCAAoC;AAA3B,mGAAA,MAAM,OAAA","sourcesContent":["/**\n * Export all implementation classes, and convenience methods for each\n * @module\n */\nimport { Format, FormatOptions } from './format.js'\nimport { HasStrict } from './has-strict.js'\nimport { Has } from './has.js'\nimport { MatchOnly } from './match-only.js'\nimport { MatchStrict } from './match-strict.js'\nimport { MatchOnlyStrict } from './match-only-strict.js'\nimport { Match } from './match.js'\nimport { Same, SameOptions } from './same.js'\nimport { Strict } from './strict.js'\n\n/**\n * The return value from all comparison functions.\n */\nexport interface Result {\n /**\n * Diff of formatted test object and expected pattern. Only shows\n * properties which differ, not the entire object.\n */\n diff: string\n /**\n * whether or not the objects are a satisfying match\n */\n match: boolean\n}\nconst simple = <T extends Same>(o: T): Result => ({\n diff: o.print(),\n match: o.match,\n})\n\ntype Class<T> = { new (obj: any, options: SameOptions): T }\nexport type CompareOptions = FormatOptions &\n Pick<SameOptions, 'diffContext'>\nconst fn =\n <T extends Same>(Cls: Class<T>) =>\n (obj: any, pattern: any, options: CompareOptions = {}) =>\n simple<T>(\n new Cls(obj, {\n ...options,\n expect: pattern,\n parent: undefined,\n })\n )\n\n/** format a value and return the formatted string */\nexport const format = (\n obj: any,\n options: FormatOptions = {}\n): string => new Format(obj, options).print()\n/** convenience method for {@link Same} */\nexport const same = fn(Same)\n/** convenience method for {@link Strict} */\nexport const strict = fn(Strict)\n/** convenience method for {@link Has} */\nexport const has = fn(Has)\n/** convenience method for {@link HasStrict} */\nexport const hasStrict = fn(HasStrict)\n/** convenience method for {@link Match} */\nexport const match = fn(Match)\n/** convenience method for {@link MatchOnly} */\nexport const matchOnly = fn(MatchOnly)\n/** convenience method for {@link MatchStrict} */\nexport const matchStrict = fn(MatchStrict)\n/** convenience method for {@link MatchOnlyStrict} */\nexport const matchOnlyStrict = fn(MatchOnlyStrict)\n\nexport { Format } from './format.js'\nexport type { FormatOptions } from './format.js'\nexport { HasStrict } from './has-strict.js'\nexport { Has } from './has.js'\nexport { MatchOnly } from './match-only.js'\nexport { MatchStrict } from './match-strict.js'\nexport { MatchOnlyStrict } from './match-only-strict.js'\nexport { Match } from './match.js'\nexport { Same } from './same.js'\nexport type { SameOptions } from './same.js'\nexport { Strict } from './strict.js'\nexport { styles } from './styles.js'\nexport type { Style } from './styles.js'\n"]}
import { Same } from './same.js';
/**
* this uses the test method from {@link Match}, but requires that *only* the
* specified fields in the pattern are present in the object.
*
* It does still allow a field to be present in the object and not the pattern
* if the value is set to null or undefined.
*/
export declare class MatchOnly extends Same {

@@ -3,0 +10,0 @@ test(): boolean | "COMPLEX";

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

{"version":3,"file":"match-only.d.ts","sourceRoot":"","sources":["../../src/match-only.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,qBAAa,SAAU,SAAQ,IAAI;IACjC,IAAI;CAGL"}
{"version":3,"file":"match-only.d.ts","sourceRoot":"","sources":["../../src/match-only.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;;;;;GAMG;AACH,qBAAa,SAAU,SAAQ,IAAI;IACjC,IAAI;CAGL"}
"use strict";
// this uses the test method from match, but requires that *only*
// the specified fields in the pattern are present in the object.
//
// Note: it does still allow a field to be present in the object
// and not the pattern if the value is set to null or undefined.
Object.defineProperty(exports, "__esModule", { value: true });

@@ -11,2 +6,9 @@ exports.MatchOnly = void 0;

const same_js_1 = require("./same.js");
/**
* this uses the test method from {@link Match}, but requires that *only* the
* specified fields in the pattern are present in the object.
*
* It does still allow a field to be present in the object and not the pattern
* if the value is set to null or undefined.
*/
class MatchOnly extends same_js_1.Same {

@@ -13,0 +15,0 @@ test() {

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

{"version":3,"file":"match-only.js","sourceRoot":"","sources":["../../src/match-only.ts"],"names":[],"mappings":";AAAA,iEAAiE;AACjE,iEAAiE;AACjE,EAAE;AACF,gEAAgE;AAChE,gEAAgE;;;AAEhE,yCAAkC;AAClC,uCAAgC;AAChC,MAAa,SAAU,SAAQ,cAAI;IACjC,IAAI;QACF,OAAO,gBAAK,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACxC,CAAC;CACF;AAJD,8BAIC","sourcesContent":["// this uses the test method from match, but requires that *only*\n// the specified fields in the pattern are present in the object.\n//\n// Note: it does still allow a field to be present in the object\n// and not the pattern if the value is set to null or undefined.\n\nimport { Match } from './match.js'\nimport { Same } from './same.js'\nexport class MatchOnly extends Same {\n test() {\n return Match.prototype.test.call(this)\n }\n}\n"]}
{"version":3,"file":"match-only.js","sourceRoot":"","sources":["../../src/match-only.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAClC,uCAAgC;AAEhC;;;;;;GAMG;AACH,MAAa,SAAU,SAAQ,cAAI;IACjC,IAAI;QACF,OAAO,gBAAK,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACxC,CAAC;CACF;AAJD,8BAIC","sourcesContent":["import { Match } from './match.js'\nimport { Same } from './same.js'\n\n/**\n * this uses the test method from {@link Match}, but requires that *only* the\n * specified fields in the pattern are present in the object.\n *\n * It does still allow a field to be present in the object and not the pattern\n * if the value is set to null or undefined.\n */\nexport class MatchOnly extends Same {\n test() {\n return Match.prototype.test.call(this)\n }\n}\n"]}
import { Match } from './match.js';
/**
* Identical to {@link Match}, *except* in the case of two simple types.
* If the value loosely equals the expected pattern, but is not strictly
* equal, then the test returns false.
*/
export declare class MatchStrict extends Match {

@@ -3,0 +8,0 @@ test(): boolean | "COMPLEX";

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

{"version":3,"file":"match-strict.d.ts","sourceRoot":"","sources":["../../src/match-strict.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,qBAAa,WAAY,SAAQ,KAAK;IACpC,IAAI;CAOL"}
{"version":3,"file":"match-strict.d.ts","sourceRoot":"","sources":["../../src/match-strict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,IAAI;CAOL"}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MatchStrict = void 0;
// this is a weird one. Basically, it is identical to Match,
// EXCEPT in the case of two simple types. If the object == expect,
// but the object does not === expect, then it returns false.
const match_js_1 = require("./match.js");
/**
* Identical to {@link Match}, *except* in the case of two simple types.
* If the value loosely equals the expected pattern, but is not strictly
* equal, then the test returns false.
*/
class MatchStrict extends match_js_1.Match {

@@ -9,0 +11,0 @@ test() {

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

{"version":3,"file":"match-strict.js","sourceRoot":"","sources":["../../src/match-strict.ts"],"names":[],"mappings":";;;AAAA,6DAA6D;AAC7D,oEAAoE;AACpE,6DAA6D;AAC7D,yCAAkC;AAClC,MAAa,WAAY,SAAQ,gBAAK;IACpC,IAAI;QACF,kDAAkD;QAClD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE;YAC7D,OAAO,KAAK,CAAA;SACb;QACD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC;CACF;AARD,kCAQC","sourcesContent":["// this is a weird one. Basically, it is identical to Match,\n// EXCEPT in the case of two simple types. If the object == expect,\n// but the object does not === expect, then it returns false.\nimport { Match } from './match.js'\nexport class MatchStrict extends Match {\n test() {\n // equal on type coercion, but not equal strictly.\n if (this.expect == this.object && this.expect !== this.object) {\n return false\n }\n return super.test()\n }\n}\n"]}
{"version":3,"file":"match-strict.js","sourceRoot":"","sources":["../../src/match-strict.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAElC;;;;GAIG;AACH,MAAa,WAAY,SAAQ,gBAAK;IACpC,IAAI;QACF,kDAAkD;QAClD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE;YAC7D,OAAO,KAAK,CAAA;SACb;QACD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC;CACF;AARD,kCAQC","sourcesContent":["import { Match } from './match.js'\n\n/**\n * Identical to {@link Match}, *except* in the case of two simple types.\n * If the value loosely equals the expected pattern, but is not strictly\n * equal, then the test returns false.\n */\nexport class MatchStrict extends Match {\n test() {\n // equal on type coercion, but not equal strictly.\n if (this.expect == this.object && this.expect !== this.object) {\n return false\n }\n return super.test()\n }\n}\n"]}
import { Has } from './has.js';
/**
* The loosed and most flexibly magical matching strategy.
*
* - If the objects pass the {@link Has} test, then return true.
* - If the pattern is a regular expression, then test it against the
* string form of the test value.
* - If the pattern is a string, and the test value is a string, then test
* that the pattern appears somewhere in the test value.
* - If the pattern is a string, and the test value is a Date, then test
* parse the pattern as a Date and verify that they have the same value
* - If the pattern is a constructor, then test that the value is an
* instance of the constructor. In the case of scalar constructors, like
* Number, Boolean, etc, also pass if the `typeof` the value matches.
* That is `Match(1, { expect: Number })` passes.
* - If the pattern is the `Array` constructor, then pass for any iterable
* valuef.
*/
export declare class Match extends Has {

@@ -3,0 +20,0 @@ test(): boolean | 'COMPLEX';

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

{"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../src/match.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,qBAAa,KAAM,SAAQ,GAAG;IAC5B,IAAI,IAAI,OAAO,GAAG,SAAS;CAsE5B"}
{"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../src/match.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B;;;;;;;;;;;;;;;;GAgBG;AAEH,qBAAa,KAAM,SAAQ,GAAG;IAC5B,IAAI,IAAI,OAAO,GAAG,SAAS;CAsE5B"}

@@ -6,2 +6,19 @@ "use strict";

const has_js_1 = require("./has.js");
/**
* The loosed and most flexibly magical matching strategy.
*
* - If the objects pass the {@link Has} test, then return true.
* - If the pattern is a regular expression, then test it against the
* string form of the test value.
* - If the pattern is a string, and the test value is a string, then test
* that the pattern appears somewhere in the test value.
* - If the pattern is a string, and the test value is a Date, then test
* parse the pattern as a Date and verify that they have the same value
* - If the pattern is a constructor, then test that the value is an
* instance of the constructor. In the case of scalar constructors, like
* Number, Boolean, etc, also pass if the `typeof` the value matches.
* That is `Match(1, { expect: Number })` passes.
* - If the pattern is the `Array` constructor, then pass for any iterable
* valuef.
*/
class Match extends has_js_1.Has {

@@ -8,0 +25,0 @@ test() {

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

{"version":3,"file":"match.js","sourceRoot":"","sources":["../../src/match.ts"],"names":[],"mappings":";;;AAAA,2CAAoC;AACpC,qCAA8B;AAC9B,MAAa,KAAM,SAAQ,YAAG;IAC5B,IAAI;QACF,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAA;QACvB,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAA;QAE3B,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,IAAI;YAC1B,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,mDAAmD;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IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,OAAO,YAAY,GAAG,CAAC;gHAC3C,CAAC,CAAC,KAAK;gHACP,CAAC,CAAC,OAAO,OAAO,KAAK,UAAU,IAAI,OAAO,GAAG,KAAK,QAAQ;oHAC1D,CAAC,CAAC,GAAG,YAAY,OAAO;oHACxB,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ;wHACxD,CAAC,CAAC,KAAK;wHACP,CAAC,CAAC,SAAS,CAAA;IACf,CAAC;CACF;AAvED,sBAuEC","sourcesContent":["import { Format } from './format.js'\nimport { Has } from './has.js'\nexport class Match extends Has {\n test(): boolean | 'COMPLEX' {\n const obj = this.object\n const pattern = this.expect\n\n return super.test() === true\n ? true\n : // failures that would also fail in the super class\n // but if they didn't pass, then should fail here, too\n pattern == null || obj == null\n ? false\n : pattern instanceof RegExp && obj instanceof RegExp\n ? false\n : Buffer.isBuffer(obj) && Buffer.isBuffer(pattern)\n ? false\n : typeof pattern === 'symbol'\n ? false\n : // ok, Match-specific stuff\n pattern instanceof RegExp\n ? pattern.test('' + obj)\n : typeof obj === 'string' &&\n typeof pattern === 'string' &&\n pattern\n ? obj.indexOf(pattern) !== -1\n : obj instanceof Date && typeof pattern === 'string'\n ? obj.getTime() === new Date(pattern).getTime()\n : pattern === BigInt\n ? typeof obj === 'bigint'\n : pattern === Buffer\n ? Buffer.isBuffer(obj)\n : pattern === Function\n ? typeof obj === 'function'\n : pattern === Number\n ? typeof obj === 'number' && obj === obj && isFinite(obj)\n : pattern === String\n ? typeof obj === 'string'\n : pattern === Symbol\n ? typeof obj === 'symbol'\n : pattern === Boolean\n ? typeof obj === 'boolean'\n : pattern === Map\n ? this.isMap()\n : pattern === Set\n ? this.isSet()\n : pattern === Object\n ? obj && typeof obj === 'object'\n : pattern === Array\n ? new Format(obj).isArray()\n : !this.isError() && pattern instanceof Error\n ? false\n : this.isError() &&\n ((pattern.message &&\n !new Match(obj.message, {\n expect: pattern.message,\n }).test()) ||\n (pattern.name &&\n !new Match(obj.name, {\n expect: pattern.name,\n }).test()))\n ? false\n : // standard deep matching stuff, same as parent, but not simple.\n this.isSet() && !(pattern instanceof Set)\n ? false\n : this.isMap() && !(pattern instanceof Map)\n ? false\n : typeof pattern === 'function' && typeof obj === 'object'\n ? obj instanceof pattern\n : typeof obj !== 'object' || typeof pattern !== 'object'\n ? false\n : 'COMPLEX'\n }\n}\n"]}
{"version":3,"file":"match.js","sourceRoot":"","sources":["../../src/match.ts"],"names":[],"mappings":";;;AAAA,2CAAoC;AACpC,qCAA8B;AAE9B;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAa,KAAM,SAAQ,YAAG;IAC5B,IAAI;QACF,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAA;QACvB,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAA;QAE3B,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,IAAI;YAC1B,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,mDAAmD;gBACrD,sDAAsD;gBACtD,OAAO,IAAI,IAAI,IAAI,GAAG,IAAI,IAAI;oBAC9B,CAAC,CAAC,KAAK;oBACP,CAAC,CAAC,OAAO,YAAY,MAAM,IAAI,GAAG,YAAY,MAAM;wBACpD,CAAC,CAAC,KAAK;wBACP,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;4BAClD,CAAC,CAAC,KAAK;4BACP,CAAC,CAAC,OAAO,OAAO,KAAK,QAAQ;gCAC7B,CAAC,CAAC,KAAK;gCACP,CAAC,CAAC,2BAA2B;oCAC7B,OAAO,YAAY,MAAM;wCACzB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;wCACxB,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ;4CACvB,OAAO,OAAO,KAAK,QAAQ;4CAC3B,OAAO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AO,EAAE;4FAC3B,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,OAAO,YAAY,KAAK;gGAC7C,CAAC,CAAC,KAAK;gGACP,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE;oGACd,CAAC,CAAC,OAAO,CAAC,OAAO;wGACf,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE;4GACtB,MAAM,EAAE,OAAO,CAAC,OAAO;yGACxB,CAAC,CAAC,IAAI,EAAE,CAAC;wGACV,CAAC,OAAO,CAAC,IAAI;4GACX,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE;gHACnB,MAAM,EAAE,OAAO,CAAC,IAAI;6GACrB,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;oGACjB,CAAC,CAAC,KAAK;oGACP,CAAC,CAAC,gEAAgE;wGAClE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,OAAO,YAAY,GAAG,CAAC;4GACzC,CAAC,CAAC,KAAK;4GACP,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,OAAO,YAAY,GAAG,CAAC;gHAC3C,CAAC,CAAC,KAAK;gHACP,CAAC,CAAC,OAAO,OAAO,KAAK,UAAU,IAAI,OAAO,GAAG,KAAK,QAAQ;oHAC1D,CAAC,CAAC,GAAG,YAAY,OAAO;oHACxB,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ;wHACxD,CAAC,CAAC,KAAK;wHACP,CAAC,CAAC,SAAS,CAAA;IACf,CAAC;CACF;AAvED,sBAuEC","sourcesContent":["import { Format } from './format.js'\nimport { Has } from './has.js'\n\n/**\n * The loosed and most flexibly magical matching strategy.\n *\n * - If the objects pass the {@link Has} test, then return true.\n * - If the pattern is a regular expression, then test it against the\n * string form of the test value.\n * - If the pattern is a string, and the test value is a string, then test\n * that the pattern appears somewhere in the test value.\n * - If the pattern is a string, and the test value is a Date, then test\n * parse the pattern as a Date and verify that they have the same value\n * - If the pattern is a constructor, then test that the value is an\n * instance of the constructor. In the case of scalar constructors, like\n * Number, Boolean, etc, also pass if the `typeof` the value matches.\n * That is `Match(1, { expect: Number })` passes.\n * - If the pattern is the `Array` constructor, then pass for any iterable\n * valuef.\n */\n\nexport class Match extends Has {\n test(): boolean | 'COMPLEX' {\n const obj = this.object\n const pattern = this.expect\n\n return super.test() === true\n ? true\n : // failures that would also fail in the super class\n // but if they didn't pass, then should fail here, too\n pattern == null || obj == null\n ? false\n : pattern instanceof RegExp && obj instanceof RegExp\n ? false\n : Buffer.isBuffer(obj) && Buffer.isBuffer(pattern)\n ? false\n : typeof pattern === 'symbol'\n ? false\n : // ok, Match-specific stuff\n pattern instanceof RegExp\n ? pattern.test('' + obj)\n : typeof obj === 'string' &&\n typeof pattern === 'string' &&\n pattern\n ? obj.indexOf(pattern) !== -1\n : obj instanceof Date && typeof pattern === 'string'\n ? obj.getTime() === new Date(pattern).getTime()\n : pattern === BigInt\n ? typeof obj === 'bigint'\n : pattern === Buffer\n ? Buffer.isBuffer(obj)\n : pattern === Function\n ? typeof obj === 'function'\n : pattern === Number\n ? typeof obj === 'number' && obj === obj && isFinite(obj)\n : pattern === String\n ? typeof obj === 'string'\n : pattern === Symbol\n ? typeof obj === 'symbol'\n : pattern === Boolean\n ? typeof obj === 'boolean'\n : pattern === Map\n ? this.isMap()\n : pattern === Set\n ? this.isSet()\n : pattern === Object\n ? obj && typeof obj === 'object'\n : pattern === Array\n ? new Format(obj).isArray()\n : !this.isError() && pattern instanceof Error\n ? false\n : this.isError() &&\n ((pattern.message &&\n !new Match(obj.message, {\n expect: pattern.message,\n }).test()) ||\n (pattern.name &&\n !new Match(obj.name, {\n expect: pattern.name,\n }).test()))\n ? false\n : // standard deep matching stuff, same as parent, but not simple.\n this.isSet() && !(pattern instanceof Set)\n ? false\n : this.isMap() && !(pattern instanceof Map)\n ? false\n : typeof pattern === 'function' && typeof obj === 'object'\n ? obj instanceof pattern\n : typeof obj !== 'object' || typeof pattern !== 'object'\n ? false\n : 'COMPLEX'\n }\n}\n"]}
import { Format, FormatOptions } from './format.js';
/**
* Options for all comparator operations
*/
export interface SameOptions extends FormatOptions {
/** the pattern to test against */
expect: any;

@@ -7,4 +11,27 @@ parent?: Same;

expectKey?: any;
/**
* how many lines of context to print around changes in diffs
* @default 10
*/
diffContext?: number;
}
/**
* Base class for all comparators
*
* We walk through both of the expect and actual objects,
* creating a Same node for each field in common, based on
* their similarity:
* - true (they're a match) omit from the result (the child node is discarded)
* - false (they're simply nonmatching) format both expect and object
* - COMPLEX - walk through child nodes
* - if match: child node is discarded
* - else, child node is retained (along with its non-matching children)
*
* We 'discard' by just having the print method return ''
*
* When walking child nodes, we use the shouldCompare(key) method to determine
* whether to check a given field. In this class, this is always true (because
* we are testing for full deep sameness), but in {@link Has} and subclasses,
* it's more complicated (only test nodes that exist in the expect object).
*/
export declare class Same extends Format {

@@ -11,0 +38,0 @@ provisional: boolean;

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

{"version":3,"file":"same.d.ts","sourceRoot":"","sources":["../../src/same.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAanD,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,MAAM,EAAE,GAAG,CAAA;IACX,MAAM,CAAC,EAAE,IAAI,CAAA;IACb,GAAG,CAAC,EAAE,GAAG,CAAA;IACT,SAAS,CAAC,EAAE,GAAG,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,qBAAa,IAAK,SAAQ,MAAM;IAC9B,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,EAAE,GAAG,CAAA;IACX,MAAM,EAAE,IAAI,GAAG,IAAI,CAAA;IACnB,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAO;IACzC,KAAK,EAAE,OAAO,CAAO;IACrB,WAAW,EAAE,MAAM,CAAK;IACxB,QA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base class for all comparators
//
// We walk through both of the expect and actual objects,
// creating a Same node for each field in common, based on
// their similarity:
// - true (they're a match) omit from the result (the child node is discarded)
// - false (they're simply nonmatching) format both expect and object
// - COMPLEX - walk through child nodes
// - if match: child node is discarded
// - else, child node is retained (along with its non-matching children)
//
// We 'discard' by just having the print method return ''
//
// When walking child nodes, we use the shouldCompare(key) method to determine
// whether to check a given field. In this class, this is always true (because
// we are testing for full deep sameness), but in Has classes, it's more
// complicated (only test nodes that exist in the expect object).
Object.defineProperty(exports, "__esModule", { value: true });

@@ -33,2 +16,21 @@ exports.Same = void 0;

const { defineProperty } = Object;
/**
* Base class for all comparators
*
* We walk through both of the expect and actual objects,
* creating a Same node for each field in common, based on
* their similarity:
* - true (they're a match) omit from the result (the child node is discarded)
* - false (they're simply nonmatching) format both expect and object
* - COMPLEX - walk through child nodes
* - if match: child node is discarded
* - else, child node is retained (along with its non-matching children)
*
* We 'discard' by just having the print method return ''
*
* When walking child nodes, we use the shouldCompare(key) method to determine
* whether to check a given field. In this class, this is always true (because
* we are testing for full deep sameness), but in {@link Has} and subclasses,
* it's more complicated (only test nodes that exist in the expect object).
*/
class Same extends format_js_1.Format {

@@ -35,0 +37,0 @@ provisional;

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

{"version":3,"file":"same.js","sourceRoot":"","sources":["../../src/same.ts"],"names":[],"mappings":";AAAA,6CAA6C;AAC7C,EAAE;AACF,yDAAyD;AACzD,0DAA0D;AAC1D,oBAAoB;AACpB,8EAA8E;AAC9E,qEAAqE;AACrE,uCAAuC;AACvC,wCAAwC;AACxC,0EAA0E;AAC1E,EAAE;AACF,yDAAyD;AACzD,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,wEAAwE;AACxE,iEAAiE;;;AAEjE,+BAA0C;AAE1C,2CAAmD;AAEnD,MAAM,SAAS,GAAG,CAAC,GAAQ,EAAE,EAAE;IAC7B,IAAI;QACF,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;KACvB;IAAC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C,iBAAiB,EAAE,CAAA;gBAC3C,OAAM;aACP;SACF;IACH,CAAC;CACF;AA/mBD,oBA+mBC","sourcesContent":["// Same is the base class for all comparators\n//\n// We walk through both of the expect and actual objects,\n// creating a Same node for each field in common, based on\n// their similarity:\n// - true (they're a match) omit from the result (the child node is discarded)\n// - false (they're simply nonmatching) format both expect and object\n// - COMPLEX - walk through child nodes\n// - if match: child node is discarded\n// - else, child node is retained (along with its non-matching children)\n//\n// We 'discard' by just having the print method return ''\n//\n// When walking child nodes, we use the shouldCompare(key) method to determine\n// whether to check a given field. In this class, this is always true (because\n// we are testing for full deep sameness), but in Has classes, it's more\n// complicated (only test nodes that exist in the expect object).\n\nimport { createTwoFilesPatch } from 'diff'\n\nimport { Format, FormatOptions } from './format.js'\n\nconst arrayFrom = (obj: any) => {\n try {\n return Array.from(obj)\n } catch (_) {\n return null\n }\n}\n\nconst { hasOwnProperty } = Object.prototype\nconst { defineProperty } = Object\n\nexport interface SameOptions extends FormatOptions {\n expect: any\n parent?: Same\n key?: any\n expectKey?: any\n diffContext?: number\n}\n\nexport class Same extends Format {\n provisional: boolean\n expect: any\n parent: Same | null\n simple: boolean | 'COMPLEX' | null = null\n match: boolean = true\n diffContext: number = 10\n memoDiff: string | null = null\n\n memoExpect: string | null = null\n\n constructor(obj: any, options: SameOptions) {\n if (!options || typeof options !== 'object') {\n throw new TypeError('must supply options object')\n }\n if (!('expect' in options)) {\n throw new TypeError('must supply expected value')\n }\n super(obj, options)\n this.parent = options.parent || null\n this.expect = options.expect\n if (!this.style.diffable) {\n throw new Error(\n `\"${options.style}\" style not appropriate for diffs`\n )\n }\n\n if (options.diffContext) {\n this.diffContext = options.diffContext\n }\n this.provisional = !!options.provisional\n this.simpleMatch()\n }\n\n simpleMatch() {\n this.simple = this.test()\n if (this.seen() !== this.seenExpect()) {\n this.simple = false\n }\n if (!this.simple) {\n this.unmatch()\n }\n }\n\n test() {\n const a = this.object\n const b = this.expect\n return typeof a === 'function' && typeof b === 'function'\n ? a === b ||\n (a.name === b.name && a.toString() === b.toString())\n : typeof a === 'symbol' || typeof b === 'symbol'\n ? typeof a === typeof b && a.toString() === b.toString()\n : typeof a !== 'object' && typeof b !== 'object' && a == b\n ? true\n : a === b\n ? true\n : a === null || b === null\n ? a == b\n : a !== a\n ? b !== b\n : typeof a !== 'object' || typeof b !== 'object'\n ? false\n : !this.isError() && b instanceof Error\n ? false\n : this.isError() &&\n ((b.message && b.message !== a.message) ||\n (b.name && b.name !== a.name))\n ? false\n : this.isSet() && !new Format(b).isSet()\n ? false\n : this.isMap() && !new Format(b).isMap()\n ? false\n : this.isArray() && !new Format(b).isArray()\n ? false\n : Buffer.isBuffer(a) && Buffer.isBuffer(b)\n ? a.equals(b)\n : a instanceof Date && b instanceof Date\n ? a.getTime() === b.getTime()\n : a instanceof RegExp && b instanceof RegExp\n ? this.regexpSame(a, b)\n : 'COMPLEX' // might still be a deeper mismatch, of course\n }\n\n regexpSame(a: RegExp, b: RegExp) {\n return (\n a.source === b.source &&\n a.global === b.global &&\n a.multiline === b.multiline &&\n a.lastIndex === b.lastIndex &&\n a.ignoreCase === b.ignoreCase\n )\n }\n\n unmatch() {\n if (this.match) {\n this.match = false\n if (!this.provisional) {\n this.parent && this.parent.unmatch()\n }\n }\n }\n\n // just print the thing as-is\n simplePrint(obj: any, options: FormatOptions = {}) {\n return new Format(obj, {\n ...this.options,\n ...options,\n }).print()\n }\n\n simplePrintExpect() {\n return new Format(this.expect, {\n ...this.options,\n seen: this.seenExpect,\n }).print()\n }\n\n seenExpect() {\n if (!this.expect || typeof this.expect !== 'object') {\n return false\n }\n\n for (let p = this.parent; p; p = p.parent) {\n if (p.expect === this.expect) {\n p.id = p.id || p.getId()\n return p\n }\n }\n return false\n }\n\n // if it's the root, then we do the diff\n // otherwise, we do the dual-walk of both trees,\n // building up the object and expect memos\n // this actually returns '' for any non-root node.\n print(): string {\n if (this.memo === null && this.memoExpect === null) {\n this.memo = ''\n this.memoExpect = ''\n if (!this.simple) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect += this.simplePrintExpect()\n } else {\n const seen = this.seen()\n const seenExpect = this.seenExpect()\n if (this.simple === true && seen === seenExpect) {\n this.memo = ''\n this.memoExpect = ''\n } else {\n if (seen) {\n this.printCircular(this.object)\n } else {\n this.printCollection()\n }\n }\n }\n }\n return this.diff()\n }\n\n printCircular(seen: Format): void {\n this.memo += this.style.circular(seen)\n const seenExpect = this.seenExpect()\n this.memoExpect = this.memoExpect || ''\n if (seenExpect) {\n this.memoExpect += this.style.circular(seenExpect)\n }\n }\n\n diff(): string {\n // impossible\n /* c8 ignore start */\n if (this.memoExpect === null || this.memo === null) {\n throw new TypeError('called diff() prior to print()')\n }\n /* c8 ignore stop */\n\n if (this.parent || this.match || this.memoExpect === this.memo) {\n return (this.memoDiff = '')\n }\n\n if (this.memoDiff !== null) {\n return this.memoDiff\n }\n\n return (this.memoDiff = createTwoFilesPatch(\n 'expected',\n 'actual',\n this.memoExpect + '\\n',\n this.memo + '\\n',\n undefined,\n undefined,\n { context: this.diffContext }\n ).replace(/^\\=+\\n/, ''))\n }\n\n child(\n obj: any,\n options: FormatOptions | SameOptions,\n cls?: typeof Same\n ) {\n const expectKey = hasOwnProperty.call(options, 'expectKey')\n ? (options as SameOptions).expectKey\n : options.key\n return super.child(\n obj,\n {\n expect: this.childExpect(expectKey),\n ...options,\n },\n cls\n )\n }\n\n childExpect(key: any) {\n // if we get here, we know that both expect and actual\n // are collections of the same type. Otherwise they\n // would have gotten the simple printed diff.\n return this.isSet()\n ? key\n : this.isMap()\n ? this.expect.get(key)\n : this.isArray()\n ? (this.expectAsArray as any[])[key]\n : this.expect[key]\n }\n\n get expectAsArray() {\n const value = Array.isArray(this.expect)\n ? this.expect\n : new Format(this.expect).isArray()\n ? arrayFrom(this.expect)\n : /* c8 ignore start */\n null\n /* c8 ignore stop */\n\n defineProperty(this, 'expectAsArray', { value })\n return value\n }\n\n printStart(): void {\n if (!this.parent) {\n this.memo = this.nodeId() + this.memo\n this.memoExpect = this.nodeId() + this.memoExpect\n return\n }\n // we always simple print keys\n /* c8 ignore start */\n const indent = this.isKey ? '' : this.indentLevel()\n /* c8 ignore stop */\n // this will always be keyless, because Array and Set\n // objects are always simple printed. But if that\n // chagnes, this will be relevant.\n /* c8 ignore start */\n const key = this.isKeyless() ? '' : this.getKey()\n /* c8 ignore stop */\n const sep = !key\n ? ''\n : this.parent && this.parent.isMap()\n ? this.style.mapKeyValSep()\n : this.style.pojoKeyValSep()\n const start = this.style.start(indent, key, sep)\n this.memo = start + this.nodeId() + this.memo\n this.memoExpect = start + this.nodeId() + this.memoExpect\n }\n\n printEnd(): void {\n if (!this.parent || this.isKey) {\n return\n }\n const end = this.parent.isMap()\n ? this.style.mapEntrySep()\n : this.parent.isArray()\n ? this.style.arrayEntrySep()\n : // these types are always simple printed\n /* c8 ignore start */\n this.parent.isSet()\n ? this.style.setEntrySep()\n : this.parent.isBuffer()\n ? ''\n : this.parent.isString()\n ? ''\n : /* c8 ignore stop */\n this.style.pojoEntrySep()\n this.memo += end\n this.memoExpect += end\n }\n\n printPojo() {\n // even though it's not a simple mismatch, it's possible that\n // a child entry will cause a mismatch, so we have to print\n // the body *before* doing the head. If we still aren't unmatched\n // after walking the graph, then nothing to do.\n if (this.pojoIsEmpty()) {\n this.memo = this.memo || ''\n this.memo += this.printPojoEmpty()\n } else {\n this.printPojoBody()\n if (!this.match) {\n this.printPojoHead()\n this.printStart()\n this.printPojoTail()\n this.printEnd()\n }\n }\n }\n pojoIsEmpty() {\n return super.pojoIsEmpty() && this.pojoExpectIsEmpty()\n }\n pojoExpectIsEmpty() {\n return super.pojoIsEmpty(this.expect)\n }\n printPojoEmpty() {\n // both are empty and not a simple mismatch, nothing to do\n }\n getPojoKeys(obj: any = this.object): string[] {\n const fromSuper = super.getPojoKeys(obj)\n if (obj === this.expect) {\n return fromSuper\n }\n return fromSuper.concat(\n this.getPojoKeys(this.expect).filter(k => k in obj)\n )\n }\n printPojoHead() {\n const h = this.style.pojoHead(this.getClass())\n\n this.memo = h + this.memo\n this.memoExpect = h + this.memoExpect\n }\n printPojoTail() {\n const t = this.style.pojoTail(this.indentLevel())\n this.memo += t\n this.memoExpect += t\n }\n printPojoBody() {\n const objEnt = new Map(this.getPojoEntries(this.object))\n const expEnt = new Map(this.getPojoEntries(this.expect))\n for (const [key, val] of objEnt.entries()) {\n if (!expEnt.has(key)) {\n this.unmatch()\n }\n this.printPojoEntry(key, val, false)\n }\n for (const key of expEnt.keys()) {\n if (objEnt.has(key)) {\n continue\n }\n this.unmatch()\n this.printPojoEntry(key, undefined, true)\n }\n }\n\n printPojoEntry(key: any, val: any, notFound?: boolean) {\n const child = this.child(val, { key })\n child.print()\n if (!notFound) {\n this.memo += child.memo\n }\n if (notFound || hasOwnProperty.call(this.expect, key)) {\n this.memoExpect += child.memoExpect\n }\n }\n\n // error is just a pojo with some fancy styling\n printError() {\n if (this.errorIsEmpty()) {\n return this.printErrorEmpty()\n } else {\n this.printErrorBody()\n if (!this.match) {\n this.printErrorHead()\n this.printStart()\n this.printErrorTail()\n this.printEnd()\n }\n }\n }\n errorIsEmpty() {\n return super.errorIsEmpty() && this.expectErrorIsEmpty()\n }\n expectErrorIsEmpty() {\n return (\n this.getPojoEntries(this.expect).filter(\n ([k]) => k !== 'name' && k !== 'message'\n ).length === 0\n )\n }\n printErrorEmpty() {\n // nothing to do\n }\n printErrorHead() {\n const headObj = this.style.errorHead(this.object, this.getClass())\n this.memo = headObj + this.memo\n const headExp = this.style.errorHead(this.expect, this.getClass())\n this.memoExpect = headExp + this.memoExpect\n }\n printErrorTail() {\n const t = this.style.errorTail(this.indentLevel())\n this.memo += t\n this.memoExpect += t\n }\n\n // maps are like pojos with fancier keys\n printMap(): void {\n if (this.mapIsEmpty()) {\n this.printMapEmpty()\n } else {\n this.printMapBody()\n if (!this.match) {\n this.printMapHead()\n this.printStart()\n this.printMapTail()\n this.printEnd()\n }\n }\n }\n mapIsEmpty() {\n return super.mapIsEmpty() && this.mapExpectIsEmpty()\n }\n mapExpectIsEmpty() {\n return this.expect.size === 0\n }\n printMapHead() {\n const h = this.style.mapHead(this.getClass())\n this.memo = h + this.memo\n this.memoExpect = h + this.memoExpect\n }\n printMapTail(): void {\n const t = this.style.mapTail(this.indentLevel())\n this.memo += t\n this.memoExpect += t\n }\n printMapBody(): void {\n // new Map([{}:1]) matches another new Map([{}:1])\n // so we can't rely on key identity.\n const seen = new Set()\n // first pass to get any that are key identity matches\n for (const [key, val] of this.object.entries()) {\n if (this.expect.has(key)) {\n seen.add(key)\n this.printMapEntry(key, val)\n continue\n }\n }\n for (const [key, val] of this.object.entries()) {\n if (seen.has(key)) {\n continue\n }\n // try to find a matching key not yet seen\n let sawMatch = false\n for (const expectKey of this.expect.keys()) {\n if (seen.has(expectKey)) {\n continue\n }\n const s = this.child(key, {\n expect: expectKey,\n provisional: true,\n })\n s.print()\n if (s.match) {\n // it's a match! test against this one.\n sawMatch = true\n seen.add(key)\n seen.add(expectKey)\n sawMatch = true\n this.printMapEntry(key, val, expectKey)\n break\n }\n }\n\n if (!sawMatch) {\n this.printMapEntryUnexpected(key, val)\n seen.add(key)\n }\n }\n\n // now loop over all expected values not found in object\n for (const [key, val] of this.expect.entries()) {\n if (seen.has(key)) {\n continue\n }\n this.printMapEntryNotFound(key, val)\n }\n }\n\n printMapEntry(key: any, val: any, expectKey: any = key) {\n const child = this.child(val, { key, expectKey })\n child.print()\n this.memo += child.memo\n this.memoExpect += child.memoExpect\n }\n printMapEntryNotFound(key: any, val: any) {\n this.unmatch()\n this.memoExpect += this.simplePrint(val, {\n parent: this,\n key,\n seen: this.seenExpect,\n })\n }\n printMapEntryUnexpected(key: any, val: any) {\n this.unmatch()\n this.memo += this.simplePrint(val, {\n key,\n parent: this,\n })\n }\n\n // arrays and sets don't have useful keys, so it's really hard to see\n // where the mismatch occurs with only the path context. For example,\n // if you have an array of objects with many keys, that mismatches on\n // only one key in one object, we would get a diff that looks like:\n // [\n // + {key: value},\n // - {key: otherValue},\n // ]\n // which isn't super helpful, since you don't know which index it failed\n // on, or even have the other properties of the object or key path to\n // use to find it.\n // So, if it's not a match, we simplePrint both the expected and object,\n // and let the diff sort it out, since it does a pretty good job of that\n // anyway.\n // This can be somewhat noisy, if you have an array with a single large\n // object, of course. An alternative approach to consider is to do the\n // full simplePrint for Sets, but include the Array index in the array\n // print, so it's at least clear where it deviated.\n printArray(): void {\n if (this.arrayIsEmpty()) {\n this.printArrayEmpty()\n } else {\n this.printArrayBody()\n }\n }\n arrayIsEmpty() {\n return super.arrayIsEmpty() && this.arrayExpectIsEmpty()\n }\n arrayExpectIsEmpty(): boolean {\n const a = this.expectAsArray\n return !!a && a.length === 0\n }\n printArrayEmpty() {\n // nothing to do\n }\n printArrayBody() {\n // we know that they're both arrays if we got this far\n const obj = this.objectAsArray as any[]\n const exp = this.expectAsArray\n // if lengths match, just call printArrayEntry() for each of them\n if (exp && obj.length === exp.length) {\n super.printArrayBody()\n } else {\n this.unmatch()\n }\n if (!this.match) {\n this.memo += this.simplePrint(this.object)\n this.memoExpect = this.memoExpect || ''\n this.memoExpect += this.simplePrintExpect()\n }\n }\n printArrayEntry(key: number, val: any) {\n const child = this.child(val, { key })\n child.print()\n }\n\n printSet() {\n if (this.setIsEmpty()) {\n this.printSetEmpty()\n } else {\n this.printSetBody()\n }\n }\n setExpectIsEmpty() {\n return this.expect.size === 0\n }\n setIsEmpty() {\n return super.setIsEmpty() && this.setExpectIsEmpty()\n }\n printSetBody() {\n if (this.expect.size !== this.object.size) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect = this.memoExpect || ''\n this.memoExpect += this.simplePrintExpect()\n return\n }\n const seen = new Set()\n // skip all identity matches, nothing to do for these\n for (const val of this.object) {\n if (this.expect.has(val)) {\n seen.add(val)\n continue\n }\n }\n for (const val of this.object) {\n if (seen.has(val)) {\n continue\n }\n let sawMatch = false\n for (const exp of this.expect) {\n if (seen.has(exp)) {\n continue\n }\n const s = this.child(val, {\n expect: exp,\n provisional: true,\n })\n s.print()\n if (s.match) {\n sawMatch = true\n seen.add(exp)\n break\n }\n }\n if (!sawMatch) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect = this.memoExpect || ''\n this.memoExpect += this.simplePrintExpect()\n return\n }\n }\n }\n}\n"]}
{"version":3,"file":"same.js","sourceRoot":"","sources":["../../src/same.ts"],"names":[],"mappings":";;;AAAA,+BAA0C;AAE1C,2CAAmD;AAEnD,MAAM,SAAS,GAAG,CAAC,GAAQ,EAAE,EAAE;IAC7B,IAAI;QACF,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;KACvB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,IAAI,CAAA;KACZ;AACH,CAAC,CAAA;AAED,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,SAAS,CAAA;AAC3C,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAA;AAkBjC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,IAAK,SAAQ,kBAAM;IAC9B,WAAW,CAAS;IACpB,MAAM,CAAK;IACX,MAAM,CAAa;IACnB,MAAM,GAA+B,IAAI,CAAA;IACzC,KAAK,GAAY,IAAI,CAAA;IACrB,WAAW,GAAW,EAAE,CAAA;IACxB,QAAQ,GAAkB,IAAI,CAAA;IAE9B,UAAU,GAAkB,IAAI,CAAA;IAEhC,YAAY,GAAQ,EAAE,OAAoB;QACxC,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC3C,MAAM,IAAI,SAAS,CAAC,4BAA4B,CAAC,CAAA;SAClD;QACD,IAAI,CAAC,CAAC,QAAQ,IAAI,OAAO,CAAC,EAAE;YAC1B,MAAM,IAAI,SAAS,CAAC,4BAA4B,CAAC,CAAA;SAClD;QACD,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QACnB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,M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IAAI;iBAClB,CAAC,CAAA;gBACF,CAAC,CAAC,KAAK,EAAE,CAAA;gBACT,IAAI,CAAC,CAAC,KAAK,EAAE;oBACX,QAAQ,GAAG,IAAI,CAAA;oBACf,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;oBACb,MAAK;iBACN;aACF;YACD,IAAI,CAAC,QAAQ,EAAE;gBACb,IAAI,CAAC,OAAO,EAAE,CAAA;gBACd,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,EAAE,CAAA;gBACvC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAA;gBAC3C,OAAM;aACP;SACF;IACH,CAAC;CACF;AA/mBD,oBA+mBC","sourcesContent":["import { createTwoFilesPatch } from 'diff'\n\nimport { Format, FormatOptions } from './format.js'\n\nconst arrayFrom = (obj: any) => {\n try {\n return Array.from(obj)\n } catch (_) {\n return null\n }\n}\n\nconst { hasOwnProperty } = Object.prototype\nconst { defineProperty } = Object\n\n/**\n * Options for all comparator operations\n */\nexport interface SameOptions extends FormatOptions {\n /** the pattern to test against */\n expect: any\n parent?: Same\n key?: any\n expectKey?: any\n /**\n * how many lines of context to print around changes in diffs\n * @default 10\n */\n diffContext?: number\n}\n\n/**\n * Base class for all comparators\n *\n * We walk through both of the expect and actual objects,\n * creating a Same node for each field in common, based on\n * their similarity:\n * - true (they're a match) omit from the result (the child node is discarded)\n * - false (they're simply nonmatching) format both expect and object\n * - COMPLEX - walk through child nodes\n * - if match: child node is discarded\n * - else, child node is retained (along with its non-matching children)\n *\n * We 'discard' by just having the print method return ''\n *\n * When walking child nodes, we use the shouldCompare(key) method to determine\n * whether to check a given field. In this class, this is always true (because\n * we are testing for full deep sameness), but in {@link Has} and subclasses,\n * it's more complicated (only test nodes that exist in the expect object).\n */\nexport class Same extends Format {\n provisional: boolean\n expect: any\n parent: Same | null\n simple: boolean | 'COMPLEX' | null = null\n match: boolean = true\n diffContext: number = 10\n memoDiff: string | null = null\n\n memoExpect: string | null = null\n\n constructor(obj: any, options: SameOptions) {\n if (!options || typeof options !== 'object') {\n throw new TypeError('must supply options object')\n }\n if (!('expect' in options)) {\n throw new TypeError('must supply expected value')\n }\n super(obj, options)\n this.parent = options.parent || null\n this.expect = options.expect\n if (!this.style.diffable) {\n throw new Error(\n `\"${options.style}\" style not appropriate for diffs`\n )\n }\n\n if (options.diffContext) {\n this.diffContext = options.diffContext\n }\n this.provisional = !!options.provisional\n this.simpleMatch()\n }\n\n simpleMatch() {\n this.simple = this.test()\n if (this.seen() !== this.seenExpect()) {\n this.simple = false\n }\n if (!this.simple) {\n this.unmatch()\n }\n }\n\n test() {\n const a = this.object\n const b = this.expect\n return typeof a === 'function' && typeof b === 'function'\n ? a === b ||\n (a.name === b.name && a.toString() === b.toString())\n : typeof a === 'symbol' || typeof b === 'symbol'\n ? typeof a === typeof b && a.toString() === b.toString()\n : typeof a !== 'object' && typeof b !== 'object' && a == b\n ? true\n : a === b\n ? true\n : a === null || b === null\n ? a == b\n : a !== a\n ? b !== b\n : typeof a !== 'object' || typeof b !== 'object'\n ? false\n : !this.isError() && b instanceof Error\n ? false\n : this.isError() &&\n ((b.message && b.message !== a.message) ||\n (b.name && b.name !== a.name))\n ? false\n : this.isSet() && !new Format(b).isSet()\n ? false\n : this.isMap() && !new Format(b).isMap()\n ? false\n : this.isArray() && !new Format(b).isArray()\n ? false\n : Buffer.isBuffer(a) && Buffer.isBuffer(b)\n ? a.equals(b)\n : a instanceof Date && b instanceof Date\n ? a.getTime() === b.getTime()\n : a instanceof RegExp && b instanceof RegExp\n ? this.regexpSame(a, b)\n : 'COMPLEX' // might still be a deeper mismatch, of course\n }\n\n regexpSame(a: RegExp, b: RegExp) {\n return (\n a.source === b.source &&\n a.global === b.global &&\n a.multiline === b.multiline &&\n a.lastIndex === b.lastIndex &&\n a.ignoreCase === b.ignoreCase\n )\n }\n\n unmatch() {\n if (this.match) {\n this.match = false\n if (!this.provisional) {\n this.parent && this.parent.unmatch()\n }\n }\n }\n\n // just print the thing as-is\n simplePrint(obj: any, options: FormatOptions = {}) {\n return new Format(obj, {\n ...this.options,\n ...options,\n }).print()\n }\n\n simplePrintExpect() {\n return new Format(this.expect, {\n ...this.options,\n seen: this.seenExpect,\n }).print()\n }\n\n seenExpect() {\n if (!this.expect || typeof this.expect !== 'object') {\n return false\n }\n\n for (let p = this.parent; p; p = p.parent) {\n if (p.expect === this.expect) {\n p.id = p.id || p.getId()\n return p\n }\n }\n return false\n }\n\n // if it's the root, then we do the diff\n // otherwise, we do the dual-walk of both trees,\n // building up the object and expect memos\n // this actually returns '' for any non-root node.\n print(): string {\n if (this.memo === null && this.memoExpect === null) {\n this.memo = ''\n this.memoExpect = ''\n if (!this.simple) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect += this.simplePrintExpect()\n } else {\n const seen = this.seen()\n const seenExpect = this.seenExpect()\n if (this.simple === true && seen === seenExpect) {\n this.memo = ''\n this.memoExpect = ''\n } else {\n if (seen) {\n this.printCircular(this.object)\n } else {\n this.printCollection()\n }\n }\n }\n }\n return this.diff()\n }\n\n printCircular(seen: Format): void {\n this.memo += this.style.circular(seen)\n const seenExpect = this.seenExpect()\n this.memoExpect = this.memoExpect || ''\n if (seenExpect) {\n this.memoExpect += this.style.circular(seenExpect)\n }\n }\n\n diff(): string {\n // impossible\n /* c8 ignore start */\n if (this.memoExpect === null || this.memo === null) {\n throw new TypeError('called diff() prior to print()')\n }\n /* c8 ignore stop */\n\n if (this.parent || this.match || this.memoExpect === this.memo) {\n return (this.memoDiff = '')\n }\n\n if (this.memoDiff !== null) {\n return this.memoDiff\n }\n\n return (this.memoDiff = createTwoFilesPatch(\n 'expected',\n 'actual',\n this.memoExpect + '\\n',\n this.memo + '\\n',\n undefined,\n undefined,\n { context: this.diffContext }\n ).replace(/^\\=+\\n/, ''))\n }\n\n child(\n obj: any,\n options: FormatOptions | SameOptions,\n cls?: typeof Same\n ) {\n const expectKey = hasOwnProperty.call(options, 'expectKey')\n ? (options as SameOptions).expectKey\n : options.key\n return super.child(\n obj,\n {\n expect: this.childExpect(expectKey),\n ...options,\n },\n cls\n )\n }\n\n childExpect(key: any) {\n // if we get here, we know that both expect and actual\n // are collections of the same type. Otherwise they\n // would have gotten the simple printed diff.\n return this.isSet()\n ? key\n : this.isMap()\n ? this.expect.get(key)\n : this.isArray()\n ? (this.expectAsArray as any[])[key]\n : this.expect[key]\n }\n\n get expectAsArray() {\n const value = Array.isArray(this.expect)\n ? this.expect\n : new Format(this.expect).isArray()\n ? arrayFrom(this.expect)\n : /* c8 ignore start */\n null\n /* c8 ignore stop */\n\n defineProperty(this, 'expectAsArray', { value })\n return value\n }\n\n printStart(): void {\n if (!this.parent) {\n this.memo = this.nodeId() + this.memo\n this.memoExpect = this.nodeId() + this.memoExpect\n return\n }\n // we always simple print keys\n /* c8 ignore start */\n const indent = this.isKey ? '' : this.indentLevel()\n /* c8 ignore stop */\n // this will always be keyless, because Array and Set\n // objects are always simple printed. But if that\n // chagnes, this will be relevant.\n /* c8 ignore start */\n const key = this.isKeyless() ? '' : this.getKey()\n /* c8 ignore stop */\n const sep = !key\n ? ''\n : this.parent && this.parent.isMap()\n ? this.style.mapKeyValSep()\n : this.style.pojoKeyValSep()\n const start = this.style.start(indent, key, sep)\n this.memo = start + this.nodeId() + this.memo\n this.memoExpect = start + this.nodeId() + this.memoExpect\n }\n\n printEnd(): void {\n if (!this.parent || this.isKey) {\n return\n }\n const end = this.parent.isMap()\n ? this.style.mapEntrySep()\n : this.parent.isArray()\n ? this.style.arrayEntrySep()\n : // these types are always simple printed\n /* c8 ignore start */\n this.parent.isSet()\n ? this.style.setEntrySep()\n : this.parent.isBuffer()\n ? ''\n : this.parent.isString()\n ? ''\n : /* c8 ignore stop */\n this.style.pojoEntrySep()\n this.memo += end\n this.memoExpect += end\n }\n\n printPojo() {\n // even though it's not a simple mismatch, it's possible that\n // a child entry will cause a mismatch, so we have to print\n // the body *before* doing the head. If we still aren't unmatched\n // after walking the graph, then nothing to do.\n if (this.pojoIsEmpty()) {\n this.memo = this.memo || ''\n this.memo += this.printPojoEmpty()\n } else {\n this.printPojoBody()\n if (!this.match) {\n this.printPojoHead()\n this.printStart()\n this.printPojoTail()\n this.printEnd()\n }\n }\n }\n pojoIsEmpty() {\n return super.pojoIsEmpty() && this.pojoExpectIsEmpty()\n }\n pojoExpectIsEmpty() {\n return super.pojoIsEmpty(this.expect)\n }\n printPojoEmpty() {\n // both are empty and not a simple mismatch, nothing to do\n }\n getPojoKeys(obj: any = this.object): string[] {\n const fromSuper = super.getPojoKeys(obj)\n if (obj === this.expect) {\n return fromSuper\n }\n return fromSuper.concat(\n this.getPojoKeys(this.expect).filter(k => k in obj)\n )\n }\n printPojoHead() {\n const h = this.style.pojoHead(this.getClass())\n\n this.memo = h + this.memo\n this.memoExpect = h + this.memoExpect\n }\n printPojoTail() {\n const t = this.style.pojoTail(this.indentLevel())\n this.memo += t\n this.memoExpect += t\n }\n printPojoBody() {\n const objEnt = new Map(this.getPojoEntries(this.object))\n const expEnt = new Map(this.getPojoEntries(this.expect))\n for (const [key, val] of objEnt.entries()) {\n if (!expEnt.has(key)) {\n this.unmatch()\n }\n this.printPojoEntry(key, val, false)\n }\n for (const key of expEnt.keys()) {\n if (objEnt.has(key)) {\n continue\n }\n this.unmatch()\n this.printPojoEntry(key, undefined, true)\n }\n }\n\n printPojoEntry(key: any, val: any, notFound?: boolean) {\n const child = this.child(val, { key })\n child.print()\n if (!notFound) {\n this.memo += child.memo\n }\n if (notFound || hasOwnProperty.call(this.expect, key)) {\n this.memoExpect += child.memoExpect\n }\n }\n\n // error is just a pojo with some fancy styling\n printError() {\n if (this.errorIsEmpty()) {\n return this.printErrorEmpty()\n } else {\n this.printErrorBody()\n if (!this.match) {\n this.printErrorHead()\n this.printStart()\n this.printErrorTail()\n this.printEnd()\n }\n }\n }\n errorIsEmpty() {\n return super.errorIsEmpty() && this.expectErrorIsEmpty()\n }\n expectErrorIsEmpty() {\n return (\n this.getPojoEntries(this.expect).filter(\n ([k]) => k !== 'name' && k !== 'message'\n ).length === 0\n )\n }\n printErrorEmpty() {\n // nothing to do\n }\n printErrorHead() {\n const headObj = this.style.errorHead(this.object, this.getClass())\n this.memo = headObj + this.memo\n const headExp = this.style.errorHead(this.expect, this.getClass())\n this.memoExpect = headExp + this.memoExpect\n }\n printErrorTail() {\n const t = this.style.errorTail(this.indentLevel())\n this.memo += t\n this.memoExpect += t\n }\n\n // maps are like pojos with fancier keys\n printMap(): void {\n if (this.mapIsEmpty()) {\n this.printMapEmpty()\n } else {\n this.printMapBody()\n if (!this.match) {\n this.printMapHead()\n this.printStart()\n this.printMapTail()\n this.printEnd()\n }\n }\n }\n mapIsEmpty() {\n return super.mapIsEmpty() && this.mapExpectIsEmpty()\n }\n mapExpectIsEmpty() {\n return this.expect.size === 0\n }\n printMapHead() {\n const h = this.style.mapHead(this.getClass())\n this.memo = h + this.memo\n this.memoExpect = h + this.memoExpect\n }\n printMapTail(): void {\n const t = this.style.mapTail(this.indentLevel())\n this.memo += t\n this.memoExpect += t\n }\n printMapBody(): void {\n // new Map([{}:1]) matches another new Map([{}:1])\n // so we can't rely on key identity.\n const seen = new Set()\n // first pass to get any that are key identity matches\n for (const [key, val] of this.object.entries()) {\n if (this.expect.has(key)) {\n seen.add(key)\n this.printMapEntry(key, val)\n continue\n }\n }\n for (const [key, val] of this.object.entries()) {\n if (seen.has(key)) {\n continue\n }\n // try to find a matching key not yet seen\n let sawMatch = false\n for (const expectKey of this.expect.keys()) {\n if (seen.has(expectKey)) {\n continue\n }\n const s = this.child(key, {\n expect: expectKey,\n provisional: true,\n })\n s.print()\n if (s.match) {\n // it's a match! test against this one.\n sawMatch = true\n seen.add(key)\n seen.add(expectKey)\n sawMatch = true\n this.printMapEntry(key, val, expectKey)\n break\n }\n }\n\n if (!sawMatch) {\n this.printMapEntryUnexpected(key, val)\n seen.add(key)\n }\n }\n\n // now loop over all expected values not found in object\n for (const [key, val] of this.expect.entries()) {\n if (seen.has(key)) {\n continue\n }\n this.printMapEntryNotFound(key, val)\n }\n }\n\n printMapEntry(key: any, val: any, expectKey: any = key) {\n const child = this.child(val, { key, expectKey })\n child.print()\n this.memo += child.memo\n this.memoExpect += child.memoExpect\n }\n printMapEntryNotFound(key: any, val: any) {\n this.unmatch()\n this.memoExpect += this.simplePrint(val, {\n parent: this,\n key,\n seen: this.seenExpect,\n })\n }\n printMapEntryUnexpected(key: any, val: any) {\n this.unmatch()\n this.memo += this.simplePrint(val, {\n key,\n parent: this,\n })\n }\n\n // arrays and sets don't have useful keys, so it's really hard to see\n // where the mismatch occurs with only the path context. For example,\n // if you have an array of objects with many keys, that mismatches on\n // only one key in one object, we would get a diff that looks like:\n // [\n // + {key: value},\n // - {key: otherValue},\n // ]\n // which isn't super helpful, since you don't know which index it failed\n // on, or even have the other properties of the object or key path to\n // use to find it.\n // So, if it's not a match, we simplePrint both the expected and object,\n // and let the diff sort it out, since it does a pretty good job of that\n // anyway.\n // This can be somewhat noisy, if you have an array with a single large\n // object, of course. An alternative approach to consider is to do the\n // full simplePrint for Sets, but include the Array index in the array\n // print, so it's at least clear where it deviated.\n printArray(): void {\n if (this.arrayIsEmpty()) {\n this.printArrayEmpty()\n } else {\n this.printArrayBody()\n }\n }\n arrayIsEmpty() {\n return super.arrayIsEmpty() && this.arrayExpectIsEmpty()\n }\n arrayExpectIsEmpty(): boolean {\n const a = this.expectAsArray\n return !!a && a.length === 0\n }\n printArrayEmpty() {\n // nothing to do\n }\n printArrayBody() {\n // we know that they're both arrays if we got this far\n const obj = this.objectAsArray as any[]\n const exp = this.expectAsArray\n // if lengths match, just call printArrayEntry() for each of them\n if (exp && obj.length === exp.length) {\n super.printArrayBody()\n } else {\n this.unmatch()\n }\n if (!this.match) {\n this.memo += this.simplePrint(this.object)\n this.memoExpect = this.memoExpect || ''\n this.memoExpect += this.simplePrintExpect()\n }\n }\n printArrayEntry(key: number, val: any) {\n const child = this.child(val, { key })\n child.print()\n }\n\n printSet() {\n if (this.setIsEmpty()) {\n this.printSetEmpty()\n } else {\n this.printSetBody()\n }\n }\n setExpectIsEmpty() {\n return this.expect.size === 0\n }\n setIsEmpty() {\n return super.setIsEmpty() && this.setExpectIsEmpty()\n }\n printSetBody() {\n if (this.expect.size !== this.object.size) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect = this.memoExpect || ''\n this.memoExpect += this.simplePrintExpect()\n return\n }\n const seen = new Set()\n // skip all identity matches, nothing to do for these\n for (const val of this.object) {\n if (this.expect.has(val)) {\n seen.add(val)\n continue\n }\n }\n for (const val of this.object) {\n if (seen.has(val)) {\n continue\n }\n let sawMatch = false\n for (const exp of this.expect) {\n if (seen.has(exp)) {\n continue\n }\n const s = this.child(val, {\n expect: exp,\n provisional: true,\n })\n s.print()\n if (s.match) {\n sawMatch = true\n seen.add(exp)\n break\n }\n }\n if (!sawMatch) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect = this.memoExpect || ''\n this.memoExpect += this.simplePrintExpect()\n return\n }\n }\n }\n}\n"]}
import { Same } from './same.js';
/**
* The same as {@link Same}, but without type coercion
*/
export declare class Strict extends Same {

@@ -3,0 +6,0 @@ test(): boolean | "COMPLEX";

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

{"version":3,"file":"strict.d.ts","sourceRoot":"","sources":["../../src/strict.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,qBAAa,MAAO,SAAQ,IAAI;IAC9B,IAAI;CA6BL"}
{"version":3,"file":"strict.d.ts","sourceRoot":"","sources":["../../src/strict.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC;;GAEG;AACH,qBAAa,MAAO,SAAQ,IAAI;IAC9B,IAAI;CA6BL"}

@@ -6,2 +6,5 @@ "use strict";

const same_js_1 = require("./same.js");
/**
* The same as {@link Same}, but without type coercion
*/
class Strict extends same_js_1.Same {

@@ -8,0 +11,0 @@ test() {

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

{"version":3,"file":"strict.js","sourceRoot":"","sources":["../../src/strict.ts"],"names":[],"mappings":";;;AAAA,2CAAoC;AACpC,uCAAgC;AAChC,MAAa,MAAO,SAAQ,cAAI;IAC9B,IAAI;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;QACrB,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;QACrB,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;QACvB,OAAO,EAAE,KAAK,KAAK;YACjB,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,CAAC,KAAK,CAAC;gBACT,CAAC,CAAC,IAAI;gBACN,CAAC,CAAC,CAAC,KAAK,CAAC;oBACT,CAAC,CAAC,CAAC,KAAK,CAAC;oBACT,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ;wBAChD,CAAC,CAAC,KAAK;wBACP,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;4BAC1C,CAAC,CAAC,EAAE;4BACJ,CAAC,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,IAAI;gCACxC,CAAC,CAAC,EAAE;gCACJ,CAAC,CAAC,CAAC,YAAY,MAAM,IAAI,CAAC,YAAY,MAAM;oCAC5C,CAAC,CAAC,EAAE;oCACJ,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,kBAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;wCACpD,CAAC,CAAC,KAAK;wCACP,CAAC,CAAC,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW;4CAC/B,CAAC,CACC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gDAChB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gDAChB,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,CAAC,IAAI,CAC1C;4CACH,CAAC,CAAC,KAAK;4CACP,CAAC,CAAC,SAAS,CAAA;IACf,CAAC;CACF;AA9BD,wBA8BC","sourcesContent":["import { Format } from './format.js'\nimport { Same } from './same.js'\nexport class Strict extends Same {\n test() {\n const a = this.object\n const b = this.expect\n const st = super.test()\n return st === false\n ? false\n : a === b\n ? true\n : a !== a\n ? b !== b\n : typeof a !== 'object' || typeof b !== 'object'\n ? false\n : Buffer.isBuffer(a) && Buffer.isBuffer(b)\n ? st\n : a instanceof Date && b instanceof Date\n ? st\n : a instanceof RegExp && b instanceof RegExp\n ? st\n : this.isArguments() && !new Format(b).isArguments()\n ? false\n : a.constructor !== b.constructor &&\n !(\n Array.isArray(b) &&\n Array.isArray(b) &&\n a.constructor.name === b.constructor.name\n )\n ? false\n : 'COMPLEX'\n }\n}\n"]}
{"version":3,"file":"strict.js","sourceRoot":"","sources":["../../src/strict.ts"],"names":[],"mappings":";;;AAAA,2CAAoC;AACpC,uCAAgC;AAChC;;GAEG;AACH,MAAa,MAAO,SAAQ,cAAI;IAC9B,IAAI;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;QACrB,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;QACrB,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;QACvB,OAAO,EAAE,KAAK,KAAK;YACjB,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,CAAC,KAAK,CAAC;gBACT,CAAC,CAAC,IAAI;gBACN,CAAC,CAAC,CAAC,KAAK,CAAC;oBACT,CAAC,CAAC,CAAC,KAAK,CAAC;oBACT,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ;wBAChD,CAAC,CAAC,KAAK;wBACP,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;4BAC1C,CAAC,CAAC,EAAE;4BACJ,CAAC,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,IAAI;gCACxC,CAAC,CAAC,EAAE;gCACJ,CAAC,CAAC,CAAC,YAAY,MAAM,IAAI,CAAC,YAAY,MAAM;oCAC5C,CAAC,CAAC,EAAE;oCACJ,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,kBAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;wCACpD,CAAC,CAAC,KAAK;wCACP,CAAC,CAAC,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW;4CAC/B,CAAC,CACC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gDAChB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gDAChB,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,CAAC,IAAI,CAC1C;4CACH,CAAC,CAAC,KAAK;4CACP,CAAC,CAAC,SAAS,CAAA;IACf,CAAC;CACF;AA9BD,wBA8BC","sourcesContent":["import { Format } from './format.js'\nimport { Same } from './same.js'\n/**\n * The same as {@link Same}, but without type coercion\n */\nexport class Strict extends Same {\n test() {\n const a = this.object\n const b = this.expect\n const st = super.test()\n return st === false\n ? false\n : a === b\n ? true\n : a !== a\n ? b !== b\n : typeof a !== 'object' || typeof b !== 'object'\n ? false\n : Buffer.isBuffer(a) && Buffer.isBuffer(b)\n ? st\n : a instanceof Date && b instanceof Date\n ? st\n : a instanceof RegExp && b instanceof RegExp\n ? st\n : this.isArguments() && !new Format(b).isArguments()\n ? false\n : a.constructor !== b.constructor &&\n !(\n Array.isArray(b) &&\n Array.isArray(b) &&\n a.constructor.name === b.constructor.name\n )\n ? false\n : 'COMPLEX'\n }\n}\n"]}

@@ -1,18 +0,38 @@

/// <reference types="node" />
/// <reference types="node" resolution-mode="require"/>
import type { Format } from './format.js';
export type StyleType = 'pretty' | 'js' | 'tight';
/**
* A set of functions defining how various sorts of things get converted
* into strings.
*/
export interface Style {
/** a function, optionally with a class name */
fn: (fn: Function, cls: string) => string;
/** an empty `Set` */
setEmpty: (cls: string) => string;
/** start of a `Set` */
setHead: (cls: string) => string;
/** end of a `Set` */
setTail: (indent: string) => string;
/** separator between entries in a `Set` */
setEntrySep: () => string;
/** an empty `Map` */
mapEmpty: (cls: string) => string;
/** start of a `Map` */
mapHead: (cls: string) => string;
/** end of a `Map` */
mapTail: (indent: string) => string;
/** start of a key in a `Map` */
mapKeyStart: () => string;
/** separator between key and value in a `Map` */
mapKeyValSep: () => string;
/** separator between entries in a `Map` */
mapEntrySep: () => string;
/** what to print when we encounter a circular reference */
circular: (node: Format) => string;
/** how to print node identifiers for circular references */
nodeId: (id: number) => string;
/** an empty `Error` object */
errorEmpty: (er: Error, cls: string) => string;
/** start of an `Error` object */
errorHead: (er: (Error | {

@@ -24,35 +44,67 @@ name?: string;

}, cls: string) => string;
/** end of an `Error` object */
errorTail: (indent: string) => string;
/** empty JavaScript object */
pojoEmpty: (cls: string) => string;
/** start of a JavaScript object */
pojoHead: (cls: string) => string;
/** end of a JavaScript object */
pojoTail: (indent: string) => string;
/** separator between key and value in a JavaScript object */
pojoKeyValSep: () => string;
/** separator between entries in a JavaScript object */
pojoEntrySep: () => string;
/** an empty `Array` */
arrayEmpty: (cls: string) => string;
/** start of an `Array` */
arrayHead: (cls: string) => string;
/** end of an `Array` */
arrayTail: (indent: string) => string;
/** separator between entries in an `Array` */
arrayEntrySep: () => string;
/**
* how many bytes of a `Buffer` to show per line. can be overridden by
* the Format constructor options.
* */
bufferChunkSize: number;
/** an empty `Buffer` */
bufferEmpty: () => string;
/** start of a short `Buffer` */
bufferStart: () => string;
/** contents of a short `Buffer` */
bufferBody: (buf: Buffer) => string;
/** end of a short `Buffer` */
bufferEnd: (buf: Buffer) => string;
/** start of a long `Buffer` */
bufferHead: () => string;
/** line numbers to print for lines in a long `Buffer` */
bufferKey: (i: number) => string;
/** line of bytes in a long `Buffer` */
bufferLine: (buf: Buffer, chunkSize: number) => string;
/** separator between lines in a long `Buffer` */
bufferLineSep: () => string;
/** end of a long `Buffer` */
bufferTail: (indent: string) => string;
/** separator between line number and contents of a long `Buffer` */
bufferKeySep: () => string;
/** an empty string */
stringEmpty: () => string;
/** a string that fits on one line */
stringOneLine: (str: string) => string;
/** start of a long string */
stringHead: () => string;
/** separator between lines of a long string */
stringLineSep: () => string;
/** each line of a long string */
stringLine: (str: string) => string;
/** end of a long string */
stringTail: (indent: string) => string;
/** indicator as to whether this style is suitable for use in diffs */
diffable: boolean;
/** beginning of a thing being printed */
start: (indent: string, key: string, sep: string) => string;
}
export declare const styles: {
[style: string]: Style;
[style in StyleType]: Style;
};
//# sourceMappingURL=styles.d.ts.map

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

{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/styles.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAQzC,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACzC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACjC,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IAChC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;IACnC,WAAW,EAAE,MAAM,MAAM,CAAA;IACzB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACjC,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IAChC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;IACnC,WAAW,EAAE,MAAM,MAAM,CAAA;IAC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,oEAAoE;IACpE,YAAY,EAAE,MAAM,MAAM,CAAA;IAE1B,sBAAsB;IACtB,WAAW,EAAE,MAAM,MAAM,CAAA;IACzB,qCAAqC;IACrC,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACtC,6BAA6B;IAC7B,UAAU,EAAE,MAAM,MAAM,CAAA;IACxB,+CAA+C;IAC/C,aAAa,EAAE,MAAM,MAAM,CAAA;IAC3B,iCAAiC;IACjC,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACnC,2BAA2B;IAC3B,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;IAEtC,sEAAsE;IACtE,QAAQ,EAAE,OAAO,CAAA;IACjB,yCAAyC;IACzC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;CAC5D;AAsOD,eAAO,MAAM,MAAM,EAAE;KAAG,KAAK,IAAI,SAAS,GAAG,KAAK;CAIjD,CAAA"}

@@ -8,4 +8,7 @@ "use strict";

.toString();
exports.styles = {};
exports.styles.pretty = {
/**
* The default style, suitable for diffs, and optimized for human
* readability.
*/
const pretty = {
fn: (fn, cls) => {

@@ -95,3 +98,11 @@ const name = fn.name;

};
exports.styles.js = {
/**
* A style that can (mostly) be copy-pasted into a JS program
* and used as-is.
*
* Of course, object and function identities won't really work,
* and if there are circular references, then the results won't
* be valid JavaScript.
*/
const js = {
fn: (fn, _) => fn.toString(),

@@ -146,5 +157,8 @@ setEmpty: cls => `new ${cls}()`,

};
// this one won't work for diffs
// same as the js style, but no indentation or \n
exports.styles.tight = {
/**
* same as the {@link js} style, but no indentation or \n
*
* Not suitable for diffs, as everything is printed on one line.
*/
const tight = {
fn: (fn, _) => fn.toString(),

@@ -188,11 +202,16 @@ setEmpty: cls => `new ${cls}()`,

stringTail: _ => '',
bufferHead: exports.styles.js.bufferHead,
bufferKey: exports.styles.js.bufferKey,
bufferLine: exports.styles.js.bufferLine,
bufferLineSep: exports.styles.js.bufferLineSep,
bufferTail: exports.styles.js.bufferTail,
bufferKeySep: exports.styles.js.bufferKeySep,
bufferHead: js.bufferHead,
bufferKey: js.bufferKey,
bufferLine: js.bufferLine,
bufferLineSep: js.bufferLineSep,
bufferTail: js.bufferTail,
bufferKeySep: js.bufferKeySep,
diffable: false,
start: (_indent, key, sep) => `${key}${sep}`,
};
exports.styles = {
pretty,
js,
tight,
};
//# sourceMappingURL=styles.js.map

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

{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/styles.ts"],"names":[],"mappings":";;;AAEA,kEAAkE;AAClE,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE,CACjC,GAAG;KACA,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC1D,QAAQ,EAAE,CAAA;AA8DF,QAAA,MAAM,GAA+B,EAAE,CAAA;AAEpD,cAAM,CAAC,MAAM,GAAG;IACd,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE;QACd,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAA;QACpB,MAAM,IAAI,GAAG,EAAE;aACZ,QAAQ,EAAE;aACV,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;aACb,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACd,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;aAC3B,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;aAC1B,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;aACtB,KAAK,CAAC,GAAG,CAAC;aACV,IAAI,CAAC,IAAI,CAAC;aACV,IAAI,EAAE,CAAA;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AAa,EAAE,GAAG,EAAE,CAAC,GAAG;IACxB,UAAU,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;IACtC,aAAa,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;IACzC,UAAU,EAAE,GAAG,EAAE,CAAC,EAAE;IACpB,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;IACnB,UAAU,EAAE,cAAM,CAAC,EAAE,CAAC,UAAU;IAChC,SAAS,EAAE,cAAM,CAAC,EAAE,CAAC,SAAS;IAC9B,UAAU,EAAE,cAAM,CAAC,EAAE,CAAC,UAAU;IAChC,aAAa,EAAE,cAAM,CAAC,EAAE,CAAC,aAAa;IACtC,UAAU,EAAE,cAAM,CAAC,EAAE,CAAC,UAAU;IAChC,YAAY,EAAE,cAAM,CAAC,EAAE,CAAC,YAAY;IACpC,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,GAAG,EAAE;CAC7C,CAAA","sourcesContent":["import type { Format } from './format.js'\n\n// can't use buf.toString('ascii') because that unmasks high bytes\nconst bufToAscii = (buf: Buffer) =>\n buf\n .map(c => (c <= 0x20 || c >= 0x7f ? '.'.charCodeAt(0) : c))\n .toString()\n\nexport interface Style {\n fn: (fn: Function, cls: string) => string\n setEmpty: (cls: string) => string\n setHead: (cls: string) => string\n setTail: (indent: string) => string\n setEntrySep: () => string\n mapEmpty: (cls: string) => string\n mapHead: (cls: string) => string\n mapTail: (indent: string) => string\n mapKeyStart: () => string\n mapKeyValSep: () => string\n mapEntrySep: () => string\n circular: (node: Format) => string\n nodeId: (id: number) => string\n errorEmpty: (er: Error, cls: string) => string\n errorHead: (\n er: (Error | { name?: string; message?: string }) & {\n generatedMessage?: string\n },\n cls: string\n ) => string\n errorTail: (indent: string) => string\n pojoEmpty: (cls: string) => string\n pojoHead: (cls: string) => string\n pojoTail: (indent: string) => string\n pojoKeyValSep: () => string\n pojoEntrySep: () => string\n arrayEmpty: (cls: string) => string\n arrayHead: (cls: string) => string\n arrayTail: (indent: string) => string\n arrayEntrySep: () => string\n\n bufferChunkSize: number\n bufferEmpty: () => string\n bufferStart: () => string\n bufferBody: (buf: Buffer) => string\n bufferEnd: (buf: Buffer) => string\n\n bufferHead: () => string\n\n // show line numbers as offset 0x0000 through 0xffff as zero-padded hex\n // this will wrap around if you have more than 64kb buffer, but that's\n // (a) highly unusual for the use cases tcompare works in, and (b) fine.\n bufferKey: (i: number) => string\n bufferLine: (buf: Buffer, chunkSize: number) => string\n bufferLineSep: () => string\n bufferTail: (indent: string) => string\n bufferKeySep: () => string\n\n stringEmpty: () => string\n stringOneLine: (str: string) => string\n stringHead: () => string\n stringLineSep: () => string\n stringLine: (str: string) => string\n stringTail: (indent: string) => string\n\n diffable: boolean\n start: (indent: string, key: string, sep: string) => string\n}\n\nexport const styles: { [style: string]: Style } = {}\n\nstyles.pretty = {\n fn: (fn, cls) => {\n const name = fn.name\n const args = fn\n .toString()\n .split('{')[0]\n .split('=>')[0]\n .replace(/[\\n\\r\\s\\t]+/g, '')\n .replace(/^[^\\(]*\\( */, '')\n .replace(/ *\\).*/g, '')\n .split(',')\n .join(', ')\n .trim()\n return `${cls} ${name || ''}(${args})`\n },\n setEmpty: cls => `${cls} \\{\\}`,\n setHead: cls => `${cls} \\{\\n`,\n setTail: indent => `${indent}}`,\n setEntrySep: () => ',\\n',\n mapEmpty: cls => `${cls} \\{\\}`,\n mapHead: cls => `${cls} \\{\\n`,\n mapTail: indent => `${indent}}`,\n mapKeyStart: () => '',\n mapKeyValSep: () => ' => ',\n mapEntrySep: () => ',\\n',\n circular: node => `<*ref_${node.id}>`,\n nodeId: id => `&ref_${id} `,\n errorEmpty: er =>\n !(er instanceof Error)\n ? `${(er as Error).name || '(no name)'}: ${\n (er as Error).message || '(no message)'\n }`\n : `${er.toString()}`,\n errorHead: (er, cls) => {\n // assertion errors sometimes generate WACKY stuff\n return cls === 'AssertionError' && er.generatedMessage\n ? er.name + ' {\\n'\n : !(er instanceof Error)\n ? `${(er as Error).name || '(no name)'}: ${\n (er as Error).message || '(no message)'\n } \\{\\n`\n : `${er.toString()} \\{\\n`\n },\n errorTail: indent => `${indent}}`,\n pojoEmpty: cls => `${cls} \\{\\}`,\n pojoHead: cls => `${cls} \\{\\n`,\n pojoTail: indent => `${indent}}`,\n pojoKeyValSep: () => ': ',\n pojoEntrySep: () => ',\\n',\n arrayEmpty: cls => `${cls} []`,\n arrayHead: cls => `${cls} [\\n`,\n arrayTail: indent => `${indent}]`,\n arrayEntrySep: () => ',\\n',\n\n bufferChunkSize: 32,\n bufferEmpty: () => 'Buffer <>',\n bufferStart: () => 'Buffer <',\n bufferBody: buf =>\n buf\n .toString('hex')\n .replace(/(....)/g, '$1 ')\n .trim(),\n bufferEnd: buf => ' ' + bufToAscii(buf) + '>',\n\n bufferHead: () => 'Buffer <\\n',\n\n // show line numbers as offset 0x0000 through 0xffff as zero-padded hex\n // this will wrap around if you have more than 64kb buffer, but that's\n // (a) highly unusual for the use cases tcompare works in, and (b) fine.\n bufferKey: i => (i + 0x10000).toString(16).slice(-4),\n bufferLine: (buf, chunkSize) => {\n const hex = buf\n .toString('hex')\n .replace(/(....)/g, '$1 ')\n .trim()\n // double for hex, then add 25% for the spaces between every 4 hexits\n const l = Math.ceil(chunkSize * 2 * 1.25)\n const pad = ' '.repeat(l - hex.length + 1)\n return hex + pad + bufToAscii(buf)\n },\n bufferLineSep: () => '\\n',\n bufferTail: indent => `\\n${indent}>`,\n bufferKeySep: () => ': ',\n\n stringEmpty: () => '\"\"',\n stringOneLine: str => JSON.stringify(str),\n stringHead: () => 'String(\\n',\n stringLineSep: () => '\\n',\n stringLine: str =>\n JSON.stringify(str.replace(/\\n$/, ''))\n .slice(1, -1)\n .replace(/\\\\\"/g, '\"'),\n stringTail: indent => `\\n${indent})`,\n diffable: true,\n start: (indent, key, sep) => `${indent}${key}${sep}`,\n}\n\nstyles.js = {\n fn: (fn, _) => fn.toString(),\n setEmpty: cls => `new ${cls}()`,\n setHead: cls => `new ${cls}([\\n`,\n setTail: indent => `${indent}])`,\n setEntrySep: () => ',\\n',\n mapEmpty: cls => `new ${cls}()`,\n mapHead: cls => `new ${cls}([\\n`,\n mapTail: indent => `${indent}])`,\n mapKeyStart: () => '[',\n mapKeyValSep: () => ', ',\n mapEntrySep: () => '],\\n',\n circular: node => `*ref_${node.id}`,\n nodeId: id => `&ref_${id} `,\n errorEmpty: (er, cls) =>\n `new ${cls}(${er.message ? JSON.stringify(er.message) : ''})`,\n errorHead: (er, cls) =>\n `Object.assign(new ${cls}(${\n er.message ? JSON.stringify(er.message) : ''\n }), {\\n`,\n errorTail: indent => `${indent}})`,\n pojoEmpty: _ => '{}',\n pojoHead: _ => `\\{\\n`,\n pojoTail: indent => `${indent}}`,\n pojoKeyValSep: () => ': ',\n pojoEntrySep: () => ',\\n',\n arrayEmpty: _ => `[]`,\n arrayHead: _ => `[\\n`,\n arrayTail: indent => `${indent}]`,\n arrayEntrySep: () => ',\\n',\n\n bufferChunkSize: 32,\n bufferEmpty: () => 'Buffer.alloc(0)',\n bufferStart: () => 'Buffer.from(\"',\n bufferBody: buf => buf.toString('hex'),\n bufferEnd: buf => '\", \"hex\") /* ' + bufToAscii(buf) + ' */',\n\n bufferHead: () => 'Buffer.from(\\n',\n bufferKey: () => '',\n bufferLine: (buf, chunkSize) =>\n JSON.stringify(buf.toString('hex')) +\n ' '.repeat((chunkSize + 1) * 2 - buf.length * 2) +\n '/* ' +\n bufToAscii(buf) +\n ' */',\n bufferTail: indent => `\\n${indent}, \"hex\")`,\n bufferLineSep: () => ' +\\n',\n bufferKeySep: () => '',\n\n stringEmpty: () => '\"\"',\n stringLineSep: () => ' +\\n',\n stringLine: str => JSON.stringify(str),\n stringOneLine: str => JSON.stringify(str),\n stringHead: () => 'String(\\n',\n stringTail: indent => `\\n${indent})`,\n diffable: true,\n start: (indent, key, sep) => `${indent}${key}${sep}`,\n}\n\n// this one won't work for diffs\n// same as the js style, but no indentation or \\n\nstyles.tight = {\n fn: (fn, _) => fn.toString(),\n setEmpty: cls => `new ${cls}()`,\n setHead: cls => `new ${cls}([`,\n setTail: _ => '])',\n setEntrySep: () => ',',\n mapEmpty: cls => `new ${cls}()`,\n mapHead: cls => `new ${cls}([`,\n mapTail: _ => '])',\n mapKeyStart: () => '[',\n mapKeyValSep: () => ',',\n mapEntrySep: () => '],',\n circular: node => `*${node.id}`,\n nodeId: id => `&${id} `,\n errorEmpty: (er, cls) =>\n `new ${cls}(${JSON.stringify(er.message)})`,\n errorHead: (er, cls) =>\n `Object.assign(new ${cls}(${\n er.message ? JSON.stringify(er.message) : ''\n }), {`,\n errorTail: _ => '})',\n pojoEmpty: _ => '{}',\n pojoHead: _ => `\\{`,\n pojoTail: _ => '}',\n pojoKeyValSep: () => ':',\n pojoEntrySep: () => ',',\n arrayEmpty: _ => `[]`,\n arrayHead: _ => `[`,\n arrayTail: () => ']',\n arrayEntrySep: () => ',',\n\n // tight style doesn't need buffer head/tail/body, because it's\n // always printed as one base64 line.\n bufferChunkSize: Infinity,\n bufferEmpty: () => 'Buffer.alloc(0)',\n bufferStart: () => 'Buffer.from(\"',\n bufferBody: buf => buf.toString('base64'),\n bufferEnd: () => '\",\"base64\")',\n\n stringEmpty: () => '\"\"',\n stringLineSep: () => '+',\n stringLine: str => JSON.stringify(str),\n stringOneLine: str => JSON.stringify(str),\n stringHead: () => '',\n stringTail: _ => '',\n bufferHead: styles.js.bufferHead,\n bufferKey: styles.js.bufferKey,\n bufferLine: styles.js.bufferLine,\n bufferLineSep: styles.js.bufferLineSep,\n bufferTail: styles.js.bufferTail,\n bufferKeySep: styles.js.bufferKeySep,\n diffable: false,\n start: (_indent, key, sep) => `${key}${sep}`,\n}\n"]}
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/styles.ts"],"names":[],"mappings":";;;AA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,YAAY,EAAE,EAAE,CAAC,YAAY;IAC7B,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,GAAG,EAAE;CAC7C,CAAA;AAEY,QAAA,MAAM,GAAoC;IACrD,MAAM;IACN,EAAE;IACF,KAAK;CACN,CAAA","sourcesContent":["import type { Format } from './format.js'\n\n// can't use buf.toString('ascii') because that unmasks high bytes\nconst bufToAscii = (buf: Buffer) =>\n buf\n .map(c => (c <= 0x20 || c >= 0x7f ? '.'.charCodeAt(0) : c))\n .toString()\n\nexport type StyleType = 'pretty' | 'js' | 'tight'\n\n/**\n * A set of functions defining how various sorts of things get converted\n * into strings.\n */\nexport interface Style {\n /** a function, optionally with a class name */\n fn: (fn: Function, cls: string) => string\n /** an empty `Set` */\n setEmpty: (cls: string) => string\n /** start of a `Set` */\n setHead: (cls: string) => string\n /** end of a `Set` */\n setTail: (indent: string) => string\n /** separator between entries in a `Set` */\n setEntrySep: () => string\n /** an empty `Map` */\n mapEmpty: (cls: string) => string\n /** start of a `Map` */\n mapHead: (cls: string) => string\n /** end of a `Map` */\n mapTail: (indent: string) => string\n /** start of a key in a `Map` */\n mapKeyStart: () => string\n /** separator between key and value in a `Map` */\n mapKeyValSep: () => string\n /** separator between entries in a `Map` */\n mapEntrySep: () => string\n /** what to print when we encounter a circular reference */\n circular: (node: Format) => string\n /** how to print node identifiers for circular references */\n nodeId: (id: number) => string\n /** an empty `Error` object */\n errorEmpty: (er: Error, cls: string) => string\n /** start of an `Error` object */\n errorHead: (\n er: (Error | { name?: string; message?: string }) & {\n generatedMessage?: string\n },\n cls: string\n ) => string\n /** end of an `Error` object */\n errorTail: (indent: string) => string\n /** empty JavaScript object */\n pojoEmpty: (cls: string) => string\n /** start of a JavaScript object */\n pojoHead: (cls: string) => string\n /** end of a JavaScript object */\n pojoTail: (indent: string) => string\n /** separator between key and value in a JavaScript object */\n pojoKeyValSep: () => string\n /** separator between entries in a JavaScript object */\n pojoEntrySep: () => string\n /** an empty `Array` */\n arrayEmpty: (cls: string) => string\n /** start of an `Array` */\n arrayHead: (cls: string) => string\n /** end of an `Array` */\n arrayTail: (indent: string) => string\n /** separator between entries in an `Array` */\n arrayEntrySep: () => string\n\n /**\n * how many bytes of a `Buffer` to show per line. can be overridden by\n * the Format constructor options.\n * */\n bufferChunkSize: number\n /** an empty `Buffer` */\n bufferEmpty: () => string\n /** start of a short `Buffer` */\n bufferStart: () => string\n /** contents of a short `Buffer` */\n bufferBody: (buf: Buffer) => string\n /** end of a short `Buffer` */\n bufferEnd: (buf: Buffer) => string\n\n /** start of a long `Buffer` */\n bufferHead: () => string\n\n // show line numbers as offset 0x0000 through 0xffff as zero-padded hex\n // this will wrap around if you have more than 64kb buffer, but that's\n // (a) highly unusual for the use cases tcompare works in, and (b) fine.\n /** line numbers to print for lines in a long `Buffer` */\n bufferKey: (i: number) => string\n /** line of bytes in a long `Buffer` */\n bufferLine: (buf: Buffer, chunkSize: number) => string\n /** separator between lines in a long `Buffer` */\n bufferLineSep: () => string\n /** end of a long `Buffer` */\n bufferTail: (indent: string) => string\n /** separator between line number and contents of a long `Buffer` */\n bufferKeySep: () => string\n\n /** an empty string */\n stringEmpty: () => string\n /** a string that fits on one line */\n stringOneLine: (str: string) => string\n /** start of a long string */\n stringHead: () => string\n /** separator between lines of a long string */\n stringLineSep: () => string\n /** each line of a long string */\n stringLine: (str: string) => string\n /** end of a long string */\n stringTail: (indent: string) => string\n\n /** indicator as to whether this style is suitable for use in diffs */\n diffable: boolean\n /** beginning of a thing being printed */\n start: (indent: string, key: string, sep: string) => string\n}\n\n/**\n * The default style, suitable for diffs, and optimized for human\n * readability.\n */\nconst pretty: Style = {\n fn: (fn, cls) => {\n const name = fn.name\n const args = fn\n .toString()\n .split('{')[0]\n .split('=>')[0]\n .replace(/[\\n\\r\\s\\t]+/g, '')\n .replace(/^[^\\(]*\\( */, '')\n .replace(/ *\\).*/g, '')\n .split(',')\n .join(', ')\n .trim()\n return `${cls} ${name || ''}(${args})`\n },\n setEmpty: cls => `${cls} \\{\\}`,\n setHead: cls => `${cls} \\{\\n`,\n setTail: indent => `${indent}}`,\n setEntrySep: () => ',\\n',\n mapEmpty: cls => `${cls} \\{\\}`,\n mapHead: cls => `${cls} \\{\\n`,\n mapTail: indent => `${indent}}`,\n mapKeyStart: () => '',\n mapKeyValSep: () => ' => ',\n mapEntrySep: () => ',\\n',\n circular: node => `<*ref_${node.id}>`,\n nodeId: id => `&ref_${id} `,\n errorEmpty: er =>\n !(er instanceof Error)\n ? `${(er as Error).name || '(no name)'}: ${\n (er as Error).message || '(no message)'\n }`\n : `${er.toString()}`,\n errorHead: (er, cls) => {\n // assertion errors sometimes generate WACKY stuff\n return cls === 'AssertionError' && er.generatedMessage\n ? er.name + ' {\\n'\n : !(er instanceof Error)\n ? `${(er as Error).name || '(no name)'}: ${\n (er as Error).message || '(no message)'\n } \\{\\n`\n : `${er.toString()} \\{\\n`\n },\n errorTail: indent => `${indent}}`,\n pojoEmpty: cls => `${cls} \\{\\}`,\n pojoHead: cls => `${cls} \\{\\n`,\n pojoTail: indent => `${indent}}`,\n pojoKeyValSep: () => ': ',\n pojoEntrySep: () => ',\\n',\n arrayEmpty: cls => `${cls} []`,\n arrayHead: cls => `${cls} [\\n`,\n arrayTail: indent => `${indent}]`,\n arrayEntrySep: () => ',\\n',\n\n bufferChunkSize: 32,\n bufferEmpty: () => 'Buffer <>',\n bufferStart: () => 'Buffer <',\n bufferBody: buf =>\n buf\n .toString('hex')\n .replace(/(....)/g, '$1 ')\n .trim(),\n bufferEnd: buf => ' ' + bufToAscii(buf) + '>',\n\n bufferHead: () => 'Buffer <\\n',\n\n // show line numbers as offset 0x0000 through 0xffff as zero-padded hex\n // this will wrap around if you have more than 64kb buffer, but that's\n // (a) highly unusual for the use cases tcompare works in, and (b) fine.\n bufferKey: i => (i + 0x10000).toString(16).slice(-4),\n bufferLine: (buf, chunkSize) => {\n const hex = buf\n .toString('hex')\n .replace(/(....)/g, '$1 ')\n .trim()\n // double for hex, then add 25% for the spaces between every 4 hexits\n const l = Math.ceil(chunkSize * 2 * 1.25)\n const pad = ' '.repeat(l - hex.length + 1)\n return hex + pad + bufToAscii(buf)\n },\n bufferLineSep: () => '\\n',\n bufferTail: indent => `\\n${indent}>`,\n bufferKeySep: () => ': ',\n\n stringEmpty: () => '\"\"',\n stringOneLine: str => JSON.stringify(str),\n stringHead: () => 'String(\\n',\n stringLineSep: () => '\\n',\n stringLine: str =>\n JSON.stringify(str.replace(/\\n$/, ''))\n .slice(1, -1)\n .replace(/\\\\\"/g, '\"'),\n stringTail: indent => `\\n${indent})`,\n diffable: true,\n start: (indent, key, sep) => `${indent}${key}${sep}`,\n}\n\n/**\n * A style that can (mostly) be copy-pasted into a JS program\n * and used as-is.\n *\n * Of course, object and function identities won't really work,\n * and if there are circular references, then the results won't\n * be valid JavaScript.\n */\nconst js: Style = {\n fn: (fn, _) => fn.toString(),\n setEmpty: cls => `new ${cls}()`,\n setHead: cls => `new ${cls}([\\n`,\n setTail: indent => `${indent}])`,\n setEntrySep: () => ',\\n',\n mapEmpty: cls => `new ${cls}()`,\n mapHead: cls => `new ${cls}([\\n`,\n mapTail: indent => `${indent}])`,\n mapKeyStart: () => '[',\n mapKeyValSep: () => ', ',\n mapEntrySep: () => '],\\n',\n circular: node => `*ref_${node.id}`,\n nodeId: id => `&ref_${id} `,\n errorEmpty: (er, cls) =>\n `new ${cls}(${er.message ? JSON.stringify(er.message) : ''})`,\n errorHead: (er, cls) =>\n `Object.assign(new ${cls}(${\n er.message ? JSON.stringify(er.message) : ''\n }), {\\n`,\n errorTail: indent => `${indent}})`,\n pojoEmpty: _ => '{}',\n pojoHead: _ => `\\{\\n`,\n pojoTail: indent => `${indent}}`,\n pojoKeyValSep: () => ': ',\n pojoEntrySep: () => ',\\n',\n arrayEmpty: _ => `[]`,\n arrayHead: _ => `[\\n`,\n arrayTail: indent => `${indent}]`,\n arrayEntrySep: () => ',\\n',\n\n bufferChunkSize: 32,\n bufferEmpty: () => 'Buffer.alloc(0)',\n bufferStart: () => 'Buffer.from(\"',\n bufferBody: buf => buf.toString('hex'),\n bufferEnd: buf => '\", \"hex\") /* ' + bufToAscii(buf) + ' */',\n\n bufferHead: () => 'Buffer.from(\\n',\n bufferKey: () => '',\n bufferLine: (buf, chunkSize) =>\n JSON.stringify(buf.toString('hex')) +\n ' '.repeat((chunkSize + 1) * 2 - buf.length * 2) +\n '/* ' +\n bufToAscii(buf) +\n ' */',\n bufferTail: indent => `\\n${indent}, \"hex\")`,\n bufferLineSep: () => ' +\\n',\n bufferKeySep: () => '',\n\n stringEmpty: () => '\"\"',\n stringLineSep: () => ' +\\n',\n stringLine: str => JSON.stringify(str),\n stringOneLine: str => JSON.stringify(str),\n stringHead: () => 'String(\\n',\n stringTail: indent => `\\n${indent})`,\n diffable: true,\n start: (indent, key, sep) => `${indent}${key}${sep}`,\n}\n\n/**\n * same as the {@link js} style, but no indentation or \\n\n *\n * Not suitable for diffs, as everything is printed on one line.\n */\nconst tight: Style = {\n fn: (fn, _) => fn.toString(),\n setEmpty: cls => `new ${cls}()`,\n setHead: cls => `new ${cls}([`,\n setTail: _ => '])',\n setEntrySep: () => ',',\n mapEmpty: cls => `new ${cls}()`,\n mapHead: cls => `new ${cls}([`,\n mapTail: _ => '])',\n mapKeyStart: () => '[',\n mapKeyValSep: () => ',',\n mapEntrySep: () => '],',\n circular: node => `*${node.id}`,\n nodeId: id => `&${id} `,\n errorEmpty: (er, cls) =>\n `new ${cls}(${JSON.stringify(er.message)})`,\n errorHead: (er, cls) =>\n `Object.assign(new ${cls}(${\n er.message ? JSON.stringify(er.message) : ''\n }), {`,\n errorTail: _ => '})',\n pojoEmpty: _ => '{}',\n pojoHead: _ => `\\{`,\n pojoTail: _ => '}',\n pojoKeyValSep: () => ':',\n pojoEntrySep: () => ',',\n arrayEmpty: _ => `[]`,\n arrayHead: _ => `[`,\n arrayTail: () => ']',\n arrayEntrySep: () => ',',\n\n // tight style doesn't need buffer head/tail/body, because it's\n // always printed as one base64 line.\n bufferChunkSize: Infinity,\n bufferEmpty: () => 'Buffer.alloc(0)',\n bufferStart: () => 'Buffer.from(\"',\n bufferBody: buf => buf.toString('base64'),\n bufferEnd: () => '\",\"base64\")',\n\n stringEmpty: () => '\"\"',\n stringLineSep: () => '+',\n stringLine: str => JSON.stringify(str),\n stringOneLine: str => JSON.stringify(str),\n stringHead: () => '',\n stringTail: _ => '',\n bufferHead: js.bufferHead,\n bufferKey: js.bufferKey,\n bufferLine: js.bufferLine,\n bufferLineSep: js.bufferLineSep,\n bufferTail: js.bufferTail,\n bufferKeySep: js.bufferKeySep,\n diffable: false,\n start: (_indent, key, sep) => `${key}${sep}`,\n}\n\nexport const styles: { [style in StyleType]: Style } = {\n pretty,\n js,\n tight,\n}\n"]}

@@ -1,16 +0,69 @@

/// <reference types="node" />
import type { Style } from './styles.js';
/// <reference types="node" resolution-mode="require"/>
import { Style, StyleType } from './styles.js';
/**
* The base class for all other comparators, and used
* directly by comparators for their "simplePrint" methods.
* It doesn't do comparison, just formatting.
*/
export interface FormatOptions {
/** set when formatting keys and values of collections */
parent?: Format;
/** sort items alphabetically by key */
sort?: boolean;
/**
* test whether an object has been seen, and get a reference to the
* Format handling them, if so.
*
* overridden in child classes when doing simplePrint()
*/
seen?: (obj?: any) => false | Format;
style?: string;
/** how to print this thing */
style?: StyleType;
/**
* optinally override {@link Style#bufferChunkSize }
* */
bufferChunkSize?: number;
/**
* Set when printing child fields
*
* @internal
*/
key?: any;
/**
* used when formatting Map keys
*
* @internal
*/
isKey?: boolean;
/**
* level within the object graph being printed
*
* @internal
*/
level?: number;
/**
* indentation level of this object within the object graph
*
* @internal
*/
indent?: string;
/**
* used when provisionally exploring a path for comparison
*
* @internal
*/
provisional?: boolean;
/**
* Include any and all enumerable properties, including those inherited on
* the prototype chain. By default, only `own` properties are printed.
*/
includeEnumerable?: boolean;
/**
* Include getter properties
*/
includeGetters?: boolean;
/**
* The object being compared against in comparison classes. (Not used
* in {@link Format}.)
*/
expect?: any;

@@ -17,0 +70,0 @@ }

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

{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/format.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAcxC,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,KAAK,GAAG,MAAM,CAAA;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,GAAG,CAAC,EAAE,GAAG,CAAA;IAET,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAA;IAGxB,MAAM,CAAC,EAAE,GAAG,CAAA;CACb;AAED,qBAAa,MAAM;IACjB,OAAO,EAAE,aAAa,CAAA;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,IAAI,EAAE,IAAI,GAAG,MAAM,CAAA;IACnB,IAAI,EAAE,OAAO,CAAA;IACb,EAAE,EAAE,IAAI,GAAG,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IACvB,KAAK,EAAE,KAAK,CAAA;IACZ,eAAe,EAAE,MAAM,CAAA;IACvB,GAAG,EAAE,GAAG,CAAA;IACR,KAAK,EAAE,OAAO,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,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AE,GAAG,CAAC,EAAE;IAazC,aAAa,IAAI,IAAI;IAIrB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI;CAKzC"}

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

// Format is the base class for all other comparators, and used
// directly by comparators for their "simplePrint" methods.
// It doesn't do comparison, just formatting.
import { styles } from './styles.js';

@@ -5,0 +2,0 @@ const arrayFrom = (obj) => {

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

{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/format.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,2DAA2D;AAC3D,6CAA6C;AAG7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,MAAM,SAAS,GAAG,CAAC,GAAQ,EAAE,EAAE;IAC7B,IAAI;QACF,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;KACvB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,IAAI,CAAA;KACZ;AACH,CAAC,CAAA;AAED,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,SAAS,CAAA;AACrC,MAAM,WAAW,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAsBpD,MAAM,OAAO,MAAM;IACjB,OAAO,CAAe;IACtB,MAAM,CAAe;IACrB,IAAI,CAAe;IACnB,IAAI,CAAS;IACb,EAAE,CAAe;IACjB,SAAS,CAAQ;IACjB,KAAK,CAAkB;IACvB,KAAK,CAAO;IACZ,eAAe,CAAQ;IACvB,GAAG,CAAK;IACR,KAAK,CAAS;IACd,KAAK,CAAQ;IACb,MAAM,CAAQ;IACd,KAAK,CAAS;IACd,MAAM,CAAK;IACX,MAAM,CAAK;IAEX,YAAY,GAAQ,EAAE,UAAyB,EAAE;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,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,cAAc,CAAC,GAAQ,EAAE,GAAQ;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;QACtC,KAAK,CAAC,KAAK,EAAE,CAAA;QACb,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAA;IACzB,CAAC;CACF","sourcesContent":["// Format is the base class for all other comparators, and used\n// directly by comparators for their \"simplePrint\" methods.\n// It doesn't do comparison, just formatting.\n\nimport type { Style } from './styles.js'\nimport { styles } from './styles.js'\n\nconst arrayFrom = (obj: any) => {\n try {\n return Array.from(obj)\n } catch (_) {\n return null\n }\n}\n\nconst { toString } = Object.prototype\nconst objToString = (obj: any) => toString.call(obj)\n\nexport interface FormatOptions {\n parent?: Format\n sort?: boolean\n // overridden in child classes when doing simplePrint()\n seen?: (obj?: any) => false | Format\n style?: string\n bufferChunkSize?: number\n key?: any\n // used when formatting Map keys\n isKey?: boolean\n level?: number\n indent?: string\n provisional?: boolean\n includeEnumerable?: boolean\n includeGetters?: boolean\n\n // ignored in this class, but used in all children\n expect?: any\n}\n\nexport class Format {\n options: FormatOptions\n parent: Format | null\n memo: null | string\n sort: boolean\n id: null | number\n idCounter: number\n idMap: Map<any, number>\n style: Style\n bufferChunkSize: number\n key: any\n isKey: boolean\n level: number\n indent: string\n match: boolean\n object: any\n expect: any\n\n constructor(obj: any, options: FormatOptions = {}) {\n this.options = options\n this.parent = options.parent || null\n this.memo = null\n this.sort = !!options.sort\n if (typeof options.seen === 'function') {\n this.seen = options.seen\n }\n this.id = null\n this.idCounter = 0\n this.idMap = this.parent ? this.parent.idMap : new Map()\n const style = this.parent\n ? this.parent.style\n : styles[options.style || 'pretty']\n if (!style) {\n throw new TypeError(`unknown style: ${options.style}`)\n }\n this.style = style\n this.bufferChunkSize =\n this.style.bufferChunkSize === Infinity\n ? Infinity\n : options.bufferChunkSize || this.style.bufferChunkSize\n\n // for printing child values of pojos and maps\n this.key = options.key\n\n // for printing Map keys\n this.isKey = !!options.isKey\n if (this.isKey && !(this.parent && this.parent.isMap())) {\n throw new Error('isKey should only be set for Map keys')\n }\n\n this.level = this.parent ? this.parent.level + 1 : 0\n this.indent = this.parent\n ? this.parent.indent\n : typeof options.indent === 'string'\n ? options.indent\n : ' '\n this.match = true\n this.object = obj\n this.expect = obj\n }\n\n incId(): number {\n return this.parent ? this.parent.incId() : (this.idCounter += 1)\n }\n\n getId(): number {\n if (this.id) {\n return this.id\n }\n const fromMap = this.idMap.get(this.object)\n if (fromMap) {\n return (this.id = fromMap)\n }\n const id = this.incId()\n this.idMap.set(this.object, id)\n return (this.id = id)\n }\n\n seen(_?: any): false | Format {\n if (!this.object || typeof this.object !== 'object') {\n return false\n }\n\n for (let p = this.parent; p; p = p.parent) {\n if (p.object === this.object) {\n p.id = p.id || p.getId()\n return p\n }\n }\n return false\n }\n\n child(obj: any, options: FormatOptions, cls?: typeof Format) {\n // This raises an error because ts thinks 'typeof Class' is\n // a normal function, not an instantiable class. Ignore.\n //@ts-expect-error\n return new (cls || this.constructor)(obj, {\n ...this.options,\n isKey: false,\n provisional: false,\n ...options,\n parent: this,\n })\n }\n\n // type testing methods\n isError(): boolean {\n return this.object instanceof Error\n }\n\n isArguments(): boolean {\n return objToString(this.object) === '[object Arguments]'\n }\n\n isArray(): boolean {\n return (\n Array.isArray(this.object) ||\n this.isArguments() ||\n this.isIterable()\n )\n }\n\n // technically this means \"is an iterable we don't have another fit for\"\n // sets, arrays, maps, and streams all handled specially.\n isIterable(): boolean {\n return (\n this.object &&\n typeof this.object === 'object' &&\n !this.isSet() &&\n !this.isMap() &&\n !this.isStream() &&\n typeof this.object[Symbol.iterator] === 'function'\n )\n }\n\n isKeyless(): boolean {\n return (\n !this.parent ||\n this.parent.isSet() ||\n this.parent.isArray() ||\n this.parent.isString() ||\n this.isKey\n )\n }\n\n isStream(): boolean {\n const s = this.object\n return (\n !!s &&\n typeof s === 'object' &&\n (typeof s.pipe === 'function' || // readable\n typeof s.pipeTo === 'function' || // whatwg readable\n (typeof s.write === 'function' &&\n typeof s.end === 'function')) // writable\n )\n }\n\n isMap(): boolean {\n return this.object instanceof Map\n }\n\n isSet(): boolean {\n return this.object instanceof Set\n }\n\n isBuffer(): boolean {\n return Buffer.isBuffer(this.object)\n }\n\n isString(): boolean {\n return typeof this.object === 'string'\n }\n\n // end type checking functions\n\n getClass(): string {\n const ts = objToString(this.object).slice(8, -1)\n return this.object.constructor !== Object &&\n this.object.constructor &&\n this.object.constructor.name &&\n this.object.constructor.name !== ts\n ? this.object.constructor.name\n : !Object.getPrototypeOf(this.object)\n ? 'Null Object'\n : ts\n }\n\n get objectAsArray(): any[] | null {\n // return the object as an actual array, if we can\n const value = Array.isArray(this.object)\n ? this.object\n : this.isArray()\n ? arrayFrom(this.object)\n : null\n\n if (value === null) {\n this.isArray = () => false\n }\n\n Object.defineProperty(this, 'objectAsArray', {\n value,\n configurable: true,\n })\n return value\n }\n\n // printing methods\n\n // Change from v5: ONLY the print() method returns a string\n // everything else mutates this.memo, so that child classes\n // can track both this.memo AND this.expectMemo, and then calculate\n // a diff at the end.\n print(): string {\n if (this.memo !== null) {\n return this.memo\n }\n this.memo = ''\n const seen = this.seen(this.object)\n if (seen) {\n this.printCircular(seen)\n } else {\n this.printValue()\n }\n this.printStart()\n this.printEnd()\n // this should be impossible\n /* c8 ignore start */\n if (typeof this.memo !== 'string') {\n throw new Error('failed to build memo string in print() method')\n }\n /* c8 ignore stop */\n return this.memo\n }\n\n printValue(): void {\n switch (typeof this.object) {\n case 'undefined':\n this.printUndefined()\n break\n\n case 'object':\n if (!this.object) {\n this.printNull()\n } else if (this.object instanceof RegExp) {\n this.printRegExp()\n } else if (this.object instanceof Date) {\n this.printDate()\n } else {\n this.printCollection()\n }\n break\n\n case 'symbol':\n this.printSymbol()\n break\n\n case 'bigint':\n this.printBigInt()\n break\n\n case 'string':\n this.printString()\n break\n\n case 'boolean':\n this.printBoolean()\n break\n\n case 'number':\n this.printNumber()\n break\n\n case 'function':\n this.printFn()\n break\n }\n }\n\n printDate(): void {\n this.memo += this.object.toISOString()\n }\n\n printRegExp(): void {\n this.memo += this.object.toString()\n }\n\n printUndefined(): void {\n this.memo += 'undefined'\n }\n\n printNull(): void {\n this.memo += 'null'\n }\n\n printSymbol(): void {\n this.memo += this.object.toString()\n }\n\n printBigInt(): void {\n this.memo += this.object.toString() + 'n'\n }\n\n printBoolean(): void {\n this.memo += JSON.stringify(this.object)\n }\n\n printNumber(): void {\n this.memo += JSON.stringify(this.object)\n }\n\n printStart(): void {\n if (!this.parent) {\n this.memo = this.nodeId() + this.memo\n return\n }\n const indent = this.isKey ? '' : this.indentLevel()\n const key = this.isKeyless() ? '' : this.getKey()\n const sep = !key\n ? ''\n : this.parent && this.parent.isMap()\n ? this.style.mapKeyValSep()\n : this.style.pojoKeyValSep()\n this.memo =\n this.style.start(indent, key, sep) + this.nodeId() + this.memo\n }\n\n printEnd(): void {\n if (!this.parent) {\n return\n }\n this.memo +=\n this.isKey || !this.parent\n ? ''\n : this.parent.isMap()\n ? this.style.mapEntrySep()\n : this.parent.isBuffer()\n ? ''\n : this.parent.isArray()\n ? this.style.arrayEntrySep()\n : this.parent.isSet()\n ? this.style.setEntrySep()\n : this.parent.isString()\n ? ''\n : this.style.pojoEntrySep()\n }\n\n getKey(): string {\n return this.parent && this.parent.isMap()\n ? this.style.mapKeyStart() +\n this.parent.child(this.key, { isKey: true }, Format).print()\n : JSON.stringify(this.key)\n }\n\n printCircular(seen: Format): void {\n this.memo += this.style.circular(seen)\n }\n\n indentLevel(n = 0): string {\n return this.indent.repeat(this.level + n)\n }\n\n printCollection(): void {\n return this.isError()\n ? this.printError()\n : this.isSet()\n ? this.printSet()\n : this.isMap()\n ? this.printMap()\n : this.isBuffer()\n ? this.printBuffer()\n : this.isArray() && this.objectAsArray\n ? this.printArray()\n : // TODO streams, JSX\n this.printPojo()\n }\n\n nodeId(): string {\n return this.id ? this.style.nodeId(this.id) : ''\n }\n\n printBuffer(): void {\n if (this.parent && this.parent.isBuffer()) {\n this.memo +=\n this.style.bufferKey(this.key) +\n this.style.bufferKeySep() +\n this.style.bufferLine(this.object, this.bufferChunkSize)\n } else if (this.object.length === 0) {\n this.memo += this.style.bufferEmpty()\n } else if (this.bufferIsShort()) {\n this.memo +=\n this.style.bufferStart() +\n this.style.bufferBody(this.object) +\n this.style.bufferEnd(this.object)\n } else {\n this.printBufferHead()\n this.printBufferBody()\n this.printBufferTail()\n }\n }\n\n bufferIsShort(): boolean {\n return this.object.length < this.bufferChunkSize + 5\n }\n\n printBufferHead(): void {\n this.memo += this.style.bufferHead()\n }\n\n printBufferBody(): void {\n const c = this.bufferChunkSize\n let i: number\n for (i = 0; i < this.object.length - c; i += c) {\n this.printBufferLine(i, this.object.slice(i, i + c))\n }\n this.printBufferLastLine(i, this.object.slice(i, i + c))\n }\n\n printBufferLine(key: number, val: Buffer): void {\n this.printBufferLastLine(key, val)\n this.memo += this.style.bufferLineSep()\n }\n\n printBufferLastLine(key: any, val: Buffer): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printBufferTail(): void {\n this.memo += this.style.bufferTail(this.indentLevel())\n }\n\n printSet(): void {\n if (this.setIsEmpty()) {\n this.printSetEmpty()\n } else {\n this.printSetHead()\n this.printSetBody()\n this.printSetTail()\n }\n }\n\n setIsEmpty(): boolean {\n return this.object.size === 0\n }\n\n printSetEmpty(): void {\n this.memo += this.style.setEmpty(this.getClass())\n }\n\n printSetHead(): void {\n this.memo += this.style.setHead(this.getClass())\n }\n\n printSetBody(): void {\n for (const val of this.object) {\n this.printSetEntry(val)\n }\n }\n\n printSetTail(): void {\n this.memo += this.style.setTail(this.indentLevel())\n }\n\n printSetEntry(val: any): void {\n const child = this.child(val, { key: val })\n child.print()\n this.memo += child.memo\n }\n\n printMap(): void {\n if (this.mapIsEmpty()) {\n this.printMapEmpty()\n } else {\n this.printMapHead()\n this.printMapBody()\n this.printMapTail()\n }\n }\n\n mapIsEmpty(): boolean {\n return this.object.size === 0\n }\n\n printMapEmpty(): void {\n this.memo += this.style.mapEmpty(this.getClass())\n }\n\n printMapHead(): void {\n this.memo += this.style.mapHead(this.getClass())\n }\n\n getMapEntries(obj: any = this.object): [string, any][] {\n // can never get here unless obj is already a map\n /* c8 ignore start */\n if (!(obj instanceof Map)) {\n throw new TypeError('cannot get map entries for non-Map object')\n }\n /* c8 ignore stop */\n return [...obj.entries()]\n }\n\n printMapBody(): void {\n for (const [key, val] of this.getMapEntries()) {\n this.printMapEntry(key, val)\n }\n }\n\n printMapTail(): void {\n this.memo += this.style.mapTail(this.indentLevel())\n }\n\n printMapEntry(key: any, val: any): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printFn(): void {\n this.memo += this.style.fn(this.object, this.getClass())\n }\n\n printString(): void {\n if (this.parent && this.parent.isString()) {\n this.memo = this.style.stringLine(this.object)\n } else if (this.stringIsEmpty()) {\n this.printStringEmpty()\n } else if (this.stringIsOneLine()) {\n return this.printStringOneLine()\n } else {\n this.printStringHead()\n this.printStringBody()\n this.printStringTail()\n }\n }\n\n stringIsEmpty(): boolean {\n return this.object.length === 0\n }\n\n printStringEmpty(): void {\n this.memo += this.style.stringEmpty()\n }\n\n stringIsOneLine(): boolean {\n return /^[^\\n]*\\n?$/.test(this.object)\n }\n\n printStringOneLine(): void {\n this.memo += this.style.stringOneLine(this.object)\n }\n\n printStringHead(): void {\n this.memo += this.style.stringHead()\n }\n\n printStringBody(): void {\n const lines: string[] = this.object.split('\\n')\n const lastLine = lines.pop()\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]\n this.printStringLine(i, line + '\\n')\n }\n this.printStringLastLine(lines.length, lastLine + '\\n')\n }\n\n printStringLine(key: any, val: string): void {\n this.printStringLastLine(key, val)\n this.memo += this.style.stringLineSep()\n }\n\n printStringLastLine(key: any, val: string): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printStringTail(): void {\n this.memo += this.style.stringTail(this.indentLevel())\n }\n\n printArray(): void {\n if (this.arrayIsEmpty()) {\n this.printArrayEmpty()\n } else {\n this.printArrayHead()\n this.printArrayBody()\n this.printArrayTail()\n }\n }\n\n arrayIsEmpty(): boolean {\n const a = this.objectAsArray\n return !!a && a.length === 0\n }\n\n printArrayEmpty(): void {\n this.memo += this.style.arrayEmpty(this.getClass())\n }\n\n printArrayHead(): void {\n this.memo += this.style.arrayHead(this.getClass())\n }\n\n printArrayBody(): void {\n if (this.objectAsArray) {\n this.objectAsArray.forEach((val, key) =>\n this.printArrayEntry(key, val)\n )\n }\n }\n\n printArrayTail(): void {\n this.memo += this.style.arrayTail(this.indentLevel())\n }\n\n printArrayEntry(key: any, val: any): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printError(): void {\n if (this.errorIsEmpty()) {\n this.printErrorEmpty()\n } else {\n this.printErrorHead()\n this.printErrorBody()\n this.printErrorTail()\n }\n }\n\n errorIsEmpty(): boolean {\n return this.pojoIsEmpty()\n }\n\n printErrorEmpty(): void {\n this.memo += this.style.errorEmpty(this.object, this.getClass())\n }\n\n printErrorHead(): void {\n this.memo += this.style.errorHead(this.object, this.getClass())\n }\n\n printErrorTail(): void {\n this.memo += this.style.errorTail(this.indentLevel())\n }\n\n printErrorBody(): void {\n this.printPojoBody()\n }\n\n getPojoKeys(obj: any = this.object): string[] {\n if (this.options.includeEnumerable) {\n const keys = []\n for (const i in obj) {\n keys.push(i)\n }\n return keys\n } else if (this.options.includeGetters) {\n const own = new Set(Object.keys(obj))\n const proto = Object.getPrototypeOf(obj)\n if (proto) {\n const desc = Object.getOwnPropertyDescriptors(proto)\n for (const [name, prop] of Object.entries(desc)) {\n if (prop.enumerable && typeof prop.get === 'function') {\n // public wrappers around internal things are worth showing\n own.add(name)\n }\n }\n }\n return Array.from(own)\n } else {\n return Object.keys(obj)\n }\n }\n\n printPojo(): void {\n if (this.pojoIsEmpty()) {\n this.printPojoEmpty()\n } else {\n this.printPojoHead()\n this.printPojoBody()\n this.printPojoTail()\n }\n }\n\n pojoIsEmpty(obj: any = this.object): boolean {\n return this.getPojoKeys(obj).length === 0\n }\n\n printPojoEmpty(): void {\n this.memo += this.style.pojoEmpty(this.getClass())\n }\n\n printPojoHead(): void {\n // impossible\n /* c8 ignore start */\n if (this.memo === null) {\n throw new Error('pojo head while memo is null')\n }\n /* c8 ignore stop */\n this.memo += this.style.pojoHead(this.getClass())\n }\n\n printPojoBody(): void {\n const ent = this.getPojoEntries(this.object)\n for (const [key, val] of ent) {\n this.printPojoEntry(key, val)\n }\n }\n\n getPojoEntries(obj: any): [string, any][] {\n const ent: [string, any][] = this.getPojoKeys(obj).map(k => {\n try {\n return [k, obj[k]]\n } catch {\n return [k, undefined]\n }\n })\n return this.sort\n ? ent.sort((a, b) => a[0].localeCompare(b[0], 'en'))\n : ent\n }\n\n printPojoTail(): void {\n this.memo += this.style.pojoTail(this.indentLevel())\n }\n\n printPojoEntry(key: any, val: any): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n}\n"]}
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/format.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,MAAM,SAAS,GAAG,CAAC,GAAQ,EAAE,EAAE;IAC7B,IAAI;QACF,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;KACvB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,IAAI,CAAA;KACZ;AACH,CAAC,CAAA;AAED,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,SAAS,CAAA;AACrC,MAAM,WAAW,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAwEpD,MAAM,OAAO,MAAM;IACjB,OAAO,CAAe;IACtB,MAAM,CAAe;IACrB,IAAI,CAAe;IACnB,IAAI,CAAS;IACb,EAAE,CAAe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C,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;YACpD,CAAC,CAAC,GAAG,CAAA;IACT,CAAC;IAED,aAAa;QACX,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;IACtD,CAAC;IAED,cAAc,CAAC,GAAQ,EAAE,GAAQ;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;QACtC,KAAK,CAAC,KAAK,EAAE,CAAA;QACb,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAA;IACzB,CAAC;CACF","sourcesContent":["import { Style, StyleType } from './styles.js'\nimport { styles } from './styles.js'\n\nconst arrayFrom = (obj: any) => {\n try {\n return Array.from(obj)\n } catch (_) {\n return null\n }\n}\n\nconst { toString } = Object.prototype\nconst objToString = (obj: any) => toString.call(obj)\n\n/**\n * The base class for all other comparators, and used\n * directly by comparators for their \"simplePrint\" methods.\n * It doesn't do comparison, just formatting.\n */\nexport interface FormatOptions {\n /** set when formatting keys and values of collections */\n parent?: Format\n /** sort items alphabetically by key */\n sort?: boolean\n /**\n * test whether an object has been seen, and get a reference to the\n * Format handling them, if so.\n *\n * overridden in child classes when doing simplePrint()\n */\n seen?: (obj?: any) => false | Format\n /** how to print this thing */\n style?: StyleType\n /**\n * optinally override {@link Style#bufferChunkSize }\n * */\n bufferChunkSize?: number\n /**\n * Set when printing child fields\n *\n * @internal\n */\n key?: any\n /**\n * used when formatting Map keys\n *\n * @internal\n */\n isKey?: boolean\n /**\n * level within the object graph being printed\n *\n * @internal\n */\n level?: number\n /**\n * indentation level of this object within the object graph\n *\n * @internal\n */\n indent?: string\n /**\n * used when provisionally exploring a path for comparison\n *\n * @internal\n */\n provisional?: boolean\n /**\n * Include any and all enumerable properties, including those inherited on\n * the prototype chain. By default, only `own` properties are printed.\n */\n includeEnumerable?: boolean\n /**\n * Include getter properties\n */\n includeGetters?: boolean\n\n /**\n * The object being compared against in comparison classes. (Not used\n * in {@link Format}.)\n */\n expect?: any\n}\n\nexport class Format {\n options: FormatOptions\n parent: Format | null\n memo: null | string\n sort: boolean\n id: null | number\n idCounter: number\n idMap: Map<any, number>\n style: Style\n bufferChunkSize: number\n key: any\n isKey: boolean\n level: number\n indent: string\n match: boolean\n object: any\n expect: any\n\n constructor(obj: any, options: FormatOptions = {}) {\n this.options = options\n this.parent = options.parent || null\n this.memo = null\n this.sort = !!options.sort\n if (typeof options.seen === 'function') {\n this.seen = options.seen\n }\n this.id = null\n this.idCounter = 0\n this.idMap = this.parent ? this.parent.idMap : new Map()\n const style = this.parent\n ? this.parent.style\n : styles[options.style || 'pretty']\n if (!style) {\n throw new TypeError(`unknown style: ${options.style}`)\n }\n this.style = style\n this.bufferChunkSize =\n this.style.bufferChunkSize === Infinity\n ? Infinity\n : options.bufferChunkSize || this.style.bufferChunkSize\n\n // for printing child values of pojos and maps\n this.key = options.key\n\n // for printing Map keys\n this.isKey = !!options.isKey\n if (this.isKey && !(this.parent && this.parent.isMap())) {\n throw new Error('isKey should only be set for Map keys')\n }\n\n this.level = this.parent ? this.parent.level + 1 : 0\n this.indent = this.parent\n ? this.parent.indent\n : typeof options.indent === 'string'\n ? options.indent\n : ' '\n this.match = true\n this.object = obj\n this.expect = obj\n }\n\n incId(): number {\n return this.parent ? this.parent.incId() : (this.idCounter += 1)\n }\n\n getId(): number {\n if (this.id) {\n return this.id\n }\n const fromMap = this.idMap.get(this.object)\n if (fromMap) {\n return (this.id = fromMap)\n }\n const id = this.incId()\n this.idMap.set(this.object, id)\n return (this.id = id)\n }\n\n seen(_?: any): false | Format {\n if (!this.object || typeof this.object !== 'object') {\n return false\n }\n\n for (let p = this.parent; p; p = p.parent) {\n if (p.object === this.object) {\n p.id = p.id || p.getId()\n return p\n }\n }\n return false\n }\n\n child(obj: any, options: FormatOptions, cls?: typeof Format) {\n // This raises an error because ts thinks 'typeof Class' is\n // a normal function, not an instantiable class. Ignore.\n //@ts-expect-error\n return new (cls || this.constructor)(obj, {\n ...this.options,\n isKey: false,\n provisional: false,\n ...options,\n parent: this,\n })\n }\n\n // type testing methods\n isError(): boolean {\n return this.object instanceof Error\n }\n\n isArguments(): boolean {\n return objToString(this.object) === '[object Arguments]'\n }\n\n isArray(): boolean {\n return (\n Array.isArray(this.object) ||\n this.isArguments() ||\n this.isIterable()\n )\n }\n\n // technically this means \"is an iterable we don't have another fit for\"\n // sets, arrays, maps, and streams all handled specially.\n isIterable(): boolean {\n return (\n this.object &&\n typeof this.object === 'object' &&\n !this.isSet() &&\n !this.isMap() &&\n !this.isStream() &&\n typeof this.object[Symbol.iterator] === 'function'\n )\n }\n\n isKeyless(): boolean {\n return (\n !this.parent ||\n this.parent.isSet() ||\n this.parent.isArray() ||\n this.parent.isString() ||\n this.isKey\n )\n }\n\n isStream(): boolean {\n const s = this.object\n return (\n !!s &&\n typeof s === 'object' &&\n (typeof s.pipe === 'function' || // readable\n typeof s.pipeTo === 'function' || // whatwg readable\n (typeof s.write === 'function' &&\n typeof s.end === 'function')) // writable\n )\n }\n\n isMap(): boolean {\n return this.object instanceof Map\n }\n\n isSet(): boolean {\n return this.object instanceof Set\n }\n\n isBuffer(): boolean {\n return Buffer.isBuffer(this.object)\n }\n\n isString(): boolean {\n return typeof this.object === 'string'\n }\n\n // end type checking functions\n\n getClass(): string {\n const ts = objToString(this.object).slice(8, -1)\n return this.object.constructor !== Object &&\n this.object.constructor &&\n this.object.constructor.name &&\n this.object.constructor.name !== ts\n ? this.object.constructor.name\n : !Object.getPrototypeOf(this.object)\n ? 'Null Object'\n : ts\n }\n\n get objectAsArray(): any[] | null {\n // return the object as an actual array, if we can\n const value = Array.isArray(this.object)\n ? this.object\n : this.isArray()\n ? arrayFrom(this.object)\n : null\n\n if (value === null) {\n this.isArray = () => false\n }\n\n Object.defineProperty(this, 'objectAsArray', {\n value,\n configurable: true,\n })\n return value\n }\n\n // printing methods\n\n // Change from v5: ONLY the print() method returns a string\n // everything else mutates this.memo, so that child classes\n // can track both this.memo AND this.expectMemo, and then calculate\n // a diff at the end.\n print(): string {\n if (this.memo !== null) {\n return this.memo\n }\n this.memo = ''\n const seen = this.seen(this.object)\n if (seen) {\n this.printCircular(seen)\n } else {\n this.printValue()\n }\n this.printStart()\n this.printEnd()\n // this should be impossible\n /* c8 ignore start */\n if (typeof this.memo !== 'string') {\n throw new Error('failed to build memo string in print() method')\n }\n /* c8 ignore stop */\n return this.memo\n }\n\n printValue(): void {\n switch (typeof this.object) {\n case 'undefined':\n this.printUndefined()\n break\n\n case 'object':\n if (!this.object) {\n this.printNull()\n } else if (this.object instanceof RegExp) {\n this.printRegExp()\n } else if (this.object instanceof Date) {\n this.printDate()\n } else {\n this.printCollection()\n }\n break\n\n case 'symbol':\n this.printSymbol()\n break\n\n case 'bigint':\n this.printBigInt()\n break\n\n case 'string':\n this.printString()\n break\n\n case 'boolean':\n this.printBoolean()\n break\n\n case 'number':\n this.printNumber()\n break\n\n case 'function':\n this.printFn()\n break\n }\n }\n\n printDate(): void {\n this.memo += this.object.toISOString()\n }\n\n printRegExp(): void {\n this.memo += this.object.toString()\n }\n\n printUndefined(): void {\n this.memo += 'undefined'\n }\n\n printNull(): void {\n this.memo += 'null'\n }\n\n printSymbol(): void {\n this.memo += this.object.toString()\n }\n\n printBigInt(): void {\n this.memo += this.object.toString() + 'n'\n }\n\n printBoolean(): void {\n this.memo += JSON.stringify(this.object)\n }\n\n printNumber(): void {\n this.memo += JSON.stringify(this.object)\n }\n\n printStart(): void {\n if (!this.parent) {\n this.memo = this.nodeId() + this.memo\n return\n }\n const indent = this.isKey ? '' : this.indentLevel()\n const key = this.isKeyless() ? '' : this.getKey()\n const sep = !key\n ? ''\n : this.parent && this.parent.isMap()\n ? this.style.mapKeyValSep()\n : this.style.pojoKeyValSep()\n this.memo =\n this.style.start(indent, key, sep) + this.nodeId() + this.memo\n }\n\n printEnd(): void {\n if (!this.parent) {\n return\n }\n this.memo +=\n this.isKey || !this.parent\n ? ''\n : this.parent.isMap()\n ? this.style.mapEntrySep()\n : this.parent.isBuffer()\n ? ''\n : this.parent.isArray()\n ? this.style.arrayEntrySep()\n : this.parent.isSet()\n ? this.style.setEntrySep()\n : this.parent.isString()\n ? ''\n : this.style.pojoEntrySep()\n }\n\n getKey(): string {\n return this.parent && this.parent.isMap()\n ? this.style.mapKeyStart() +\n this.parent.child(this.key, { isKey: true }, Format).print()\n : JSON.stringify(this.key)\n }\n\n printCircular(seen: Format): void {\n this.memo += this.style.circular(seen)\n }\n\n indentLevel(n = 0): string {\n return this.indent.repeat(this.level + n)\n }\n\n printCollection(): void {\n return this.isError()\n ? this.printError()\n : this.isSet()\n ? this.printSet()\n : this.isMap()\n ? this.printMap()\n : this.isBuffer()\n ? this.printBuffer()\n : this.isArray() && this.objectAsArray\n ? this.printArray()\n : // TODO streams, JSX\n this.printPojo()\n }\n\n nodeId(): string {\n return this.id ? this.style.nodeId(this.id) : ''\n }\n\n printBuffer(): void {\n if (this.parent && this.parent.isBuffer()) {\n this.memo +=\n this.style.bufferKey(this.key) +\n this.style.bufferKeySep() +\n this.style.bufferLine(this.object, this.bufferChunkSize)\n } else if (this.object.length === 0) {\n this.memo += this.style.bufferEmpty()\n } else if (this.bufferIsShort()) {\n this.memo +=\n this.style.bufferStart() +\n this.style.bufferBody(this.object) +\n this.style.bufferEnd(this.object)\n } else {\n this.printBufferHead()\n this.printBufferBody()\n this.printBufferTail()\n }\n }\n\n bufferIsShort(): boolean {\n return this.object.length < this.bufferChunkSize + 5\n }\n\n printBufferHead(): void {\n this.memo += this.style.bufferHead()\n }\n\n printBufferBody(): void {\n const c = this.bufferChunkSize\n let i: number\n for (i = 0; i < this.object.length - c; i += c) {\n this.printBufferLine(i, this.object.slice(i, i + c))\n }\n this.printBufferLastLine(i, this.object.slice(i, i + c))\n }\n\n printBufferLine(key: number, val: Buffer): void {\n this.printBufferLastLine(key, val)\n this.memo += this.style.bufferLineSep()\n }\n\n printBufferLastLine(key: any, val: Buffer): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printBufferTail(): void {\n this.memo += this.style.bufferTail(this.indentLevel())\n }\n\n printSet(): void {\n if (this.setIsEmpty()) {\n this.printSetEmpty()\n } else {\n this.printSetHead()\n this.printSetBody()\n this.printSetTail()\n }\n }\n\n setIsEmpty(): boolean {\n return this.object.size === 0\n }\n\n printSetEmpty(): void {\n this.memo += this.style.setEmpty(this.getClass())\n }\n\n printSetHead(): void {\n this.memo += this.style.setHead(this.getClass())\n }\n\n printSetBody(): void {\n for (const val of this.object) {\n this.printSetEntry(val)\n }\n }\n\n printSetTail(): void {\n this.memo += this.style.setTail(this.indentLevel())\n }\n\n printSetEntry(val: any): void {\n const child = this.child(val, { key: val })\n child.print()\n this.memo += child.memo\n }\n\n printMap(): void {\n if (this.mapIsEmpty()) {\n this.printMapEmpty()\n } else {\n this.printMapHead()\n this.printMapBody()\n this.printMapTail()\n }\n }\n\n mapIsEmpty(): boolean {\n return this.object.size === 0\n }\n\n printMapEmpty(): void {\n this.memo += this.style.mapEmpty(this.getClass())\n }\n\n printMapHead(): void {\n this.memo += this.style.mapHead(this.getClass())\n }\n\n getMapEntries(obj: any = this.object): [string, any][] {\n // can never get here unless obj is already a map\n /* c8 ignore start */\n if (!(obj instanceof Map)) {\n throw new TypeError('cannot get map entries for non-Map object')\n }\n /* c8 ignore stop */\n return [...obj.entries()]\n }\n\n printMapBody(): void {\n for (const [key, val] of this.getMapEntries()) {\n this.printMapEntry(key, val)\n }\n }\n\n printMapTail(): void {\n this.memo += this.style.mapTail(this.indentLevel())\n }\n\n printMapEntry(key: any, val: any): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printFn(): void {\n this.memo += this.style.fn(this.object, this.getClass())\n }\n\n printString(): void {\n if (this.parent && this.parent.isString()) {\n this.memo = this.style.stringLine(this.object)\n } else if (this.stringIsEmpty()) {\n this.printStringEmpty()\n } else if (this.stringIsOneLine()) {\n return this.printStringOneLine()\n } else {\n this.printStringHead()\n this.printStringBody()\n this.printStringTail()\n }\n }\n\n stringIsEmpty(): boolean {\n return this.object.length === 0\n }\n\n printStringEmpty(): void {\n this.memo += this.style.stringEmpty()\n }\n\n stringIsOneLine(): boolean {\n return /^[^\\n]*\\n?$/.test(this.object)\n }\n\n printStringOneLine(): void {\n this.memo += this.style.stringOneLine(this.object)\n }\n\n printStringHead(): void {\n this.memo += this.style.stringHead()\n }\n\n printStringBody(): void {\n const lines: string[] = this.object.split('\\n')\n const lastLine = lines.pop()\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]\n this.printStringLine(i, line + '\\n')\n }\n this.printStringLastLine(lines.length, lastLine + '\\n')\n }\n\n printStringLine(key: any, val: string): void {\n this.printStringLastLine(key, val)\n this.memo += this.style.stringLineSep()\n }\n\n printStringLastLine(key: any, val: string): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printStringTail(): void {\n this.memo += this.style.stringTail(this.indentLevel())\n }\n\n printArray(): void {\n if (this.arrayIsEmpty()) {\n this.printArrayEmpty()\n } else {\n this.printArrayHead()\n this.printArrayBody()\n this.printArrayTail()\n }\n }\n\n arrayIsEmpty(): boolean {\n const a = this.objectAsArray\n return !!a && a.length === 0\n }\n\n printArrayEmpty(): void {\n this.memo += this.style.arrayEmpty(this.getClass())\n }\n\n printArrayHead(): void {\n this.memo += this.style.arrayHead(this.getClass())\n }\n\n printArrayBody(): void {\n if (this.objectAsArray) {\n this.objectAsArray.forEach((val, key) =>\n this.printArrayEntry(key, val)\n )\n }\n }\n\n printArrayTail(): void {\n this.memo += this.style.arrayTail(this.indentLevel())\n }\n\n printArrayEntry(key: any, val: any): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n\n printError(): void {\n if (this.errorIsEmpty()) {\n this.printErrorEmpty()\n } else {\n this.printErrorHead()\n this.printErrorBody()\n this.printErrorTail()\n }\n }\n\n errorIsEmpty(): boolean {\n return this.pojoIsEmpty()\n }\n\n printErrorEmpty(): void {\n this.memo += this.style.errorEmpty(this.object, this.getClass())\n }\n\n printErrorHead(): void {\n this.memo += this.style.errorHead(this.object, this.getClass())\n }\n\n printErrorTail(): void {\n this.memo += this.style.errorTail(this.indentLevel())\n }\n\n printErrorBody(): void {\n this.printPojoBody()\n }\n\n getPojoKeys(obj: any = this.object): string[] {\n if (this.options.includeEnumerable) {\n const keys = []\n for (const i in obj) {\n keys.push(i)\n }\n return keys\n } else if (this.options.includeGetters) {\n const own = new Set(Object.keys(obj))\n const proto = Object.getPrototypeOf(obj)\n if (proto) {\n const desc = Object.getOwnPropertyDescriptors(proto)\n for (const [name, prop] of Object.entries(desc)) {\n if (prop.enumerable && typeof prop.get === 'function') {\n // public wrappers around internal things are worth showing\n own.add(name)\n }\n }\n }\n return Array.from(own)\n } else {\n return Object.keys(obj)\n }\n }\n\n printPojo(): void {\n if (this.pojoIsEmpty()) {\n this.printPojoEmpty()\n } else {\n this.printPojoHead()\n this.printPojoBody()\n this.printPojoTail()\n }\n }\n\n pojoIsEmpty(obj: any = this.object): boolean {\n return this.getPojoKeys(obj).length === 0\n }\n\n printPojoEmpty(): void {\n this.memo += this.style.pojoEmpty(this.getClass())\n }\n\n printPojoHead(): void {\n // impossible\n /* c8 ignore start */\n if (this.memo === null) {\n throw new Error('pojo head while memo is null')\n }\n /* c8 ignore stop */\n this.memo += this.style.pojoHead(this.getClass())\n }\n\n printPojoBody(): void {\n const ent = this.getPojoEntries(this.object)\n for (const [key, val] of ent) {\n this.printPojoEntry(key, val)\n }\n }\n\n getPojoEntries(obj: any): [string, any][] {\n const ent: [string, any][] = this.getPojoKeys(obj).map(k => {\n try {\n return [k, obj[k]]\n } catch {\n return [k, undefined]\n }\n })\n return this.sort\n ? ent.sort((a, b) => a[0].localeCompare(b[0], 'en'))\n : ent\n }\n\n printPojoTail(): void {\n this.memo += this.style.pojoTail(this.indentLevel())\n }\n\n printPojoEntry(key: any, val: any): void {\n const child = this.child(val, { key })\n child.print()\n this.memo += child.memo\n }\n}\n"]}
import { Has } from './has.js';
/**
* The same as {@link Has}, but strictly compare all properties
*/
export declare class HasStrict extends Has {

@@ -3,0 +6,0 @@ test(): boolean | "COMPLEX";

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

{"version":3,"file":"has-strict.d.ts","sourceRoot":"","sources":["../../src/has-strict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,qBAAa,SAAU,SAAQ,GAAG;IAChC,IAAI;CAmBL"}
{"version":3,"file":"has-strict.d.ts","sourceRoot":"","sources":["../../src/has-strict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B;;GAEG;AACH,qBAAa,SAAU,SAAQ,GAAG;IAChC,IAAI;CAmBL"}
import { Has } from './has.js';
import { Strict } from './strict.js';
/**
* The same as {@link Has}, but strictly compare all properties
*/
export class HasStrict extends Has {

@@ -4,0 +7,0 @@ test() {

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

{"version":3,"file":"has-strict.js","sourceRoot":"","sources":["../../src/has-strict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,MAAM,OAAO,SAAU,SAAQ,GAAG;IAChC,IAAI;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;QACrB,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;QACrB,gEAAgE;QAChE,8DAA8D;QAC9D,4DAA4D;QAC5D,gEAAgE;QAChE,IACE,CAAC;YACD,CAAC;YACD,OAAO,CAAC,KAAK,QAAQ;YACrB,OAAO,CAAC,KAAK,QAAQ;YACrB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EACrC;YACA,OAAO,KAAK,CAAC,IAAI,EAAE,CAAA;SACpB;aAAM;YACL,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SACxC;IACH,CAAC;CACF","sourcesContent":["import { Has } from './has.js'\nimport { Strict } from './strict.js'\nexport class HasStrict extends Has {\n test() {\n const a = this.object\n const b = this.expect\n // constructor match is relevant to Strict, but HasStrict should\n // not do that, it's inconvenient, since it means you can't do\n // hasStrict(new URL('https://x.com/y'), { pathname: '/y' })\n // So, for objects, we call Same. Everything else, call Strict.\n if (\n a &&\n b &&\n typeof a === 'object' &&\n typeof b === 'object' &&\n Array.isArray(a) === Array.isArray(b)\n ) {\n return super.test()\n } else {\n return Strict.prototype.test.call(this)\n }\n }\n}\n"]}
{"version":3,"file":"has-strict.js","sourceRoot":"","sources":["../../src/has-strict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,GAAG;IAChC,IAAI;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;QACrB,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;QACrB,gEAAgE;QAChE,8DAA8D;QAC9D,4DAA4D;QAC5D,gEAAgE;QAChE,IACE,CAAC;YACD,CAAC;YACD,OAAO,CAAC,KAAK,QAAQ;YACrB,OAAO,CAAC,KAAK,QAAQ;YACrB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EACrC;YACA,OAAO,KAAK,CAAC,IAAI,EAAE,CAAA;SACpB;aAAM;YACL,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SACxC;IACH,CAAC;CACF","sourcesContent":["import { Has } from './has.js'\nimport { Strict } from './strict.js'\n/**\n * The same as {@link Has}, but strictly compare all properties\n */\nexport class HasStrict extends Has {\n test() {\n const a = this.object\n const b = this.expect\n // constructor match is relevant to Strict, but HasStrict should\n // not do that, it's inconvenient, since it means you can't do\n // hasStrict(new URL('https://x.com/y'), { pathname: '/y' })\n // So, for objects, we call Same. Everything else, call Strict.\n if (\n a &&\n b &&\n typeof a === 'object' &&\n typeof b === 'object' &&\n Array.isArray(a) === Array.isArray(b)\n ) {\n return super.test()\n } else {\n return Strict.prototype.test.call(this)\n }\n }\n}\n"]}
import { Same } from './same.js';
/**
* The same as {@link Same}, but ignore any fields present in the
* test object and not present in the expect pattern.
*/
export declare class Has extends Same {

@@ -3,0 +7,0 @@ simpleMatch(): void;

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

{"version":3,"file":"has.d.ts","sourceRoot":"","sources":["../../src/has.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,qBAAa,GAAI,SAAQ,IAAI;IAG3B,WAAW;IAOX,OAAO;IAKP,cAAc,CAAC,GAAG,EAAE,GAAG;IAsBvB,uBAAuB,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG;IAK5C,IAAI,aAAa,iBAmBhB;IAGD,cAAc;IAad,YAAY;CA4Cb"}
{"version":3,"file":"has.d.ts","sourceRoot":"","sources":["../../src/has.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC;;;GAGG;AACH,qBAAa,GAAI,SAAQ,IAAI;IAG3B,WAAW;IAOX,OAAO;IAKP,cAAc,CAAC,GAAG,EAAE,GAAG;IAsBvB,uBAAuB,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG;IAK5C,IAAI,aAAa,iBAmBhB;IAGD,cAAc;IAad,YAAY;CA4Cb"}
import { Format } from './format.js';
import { Same } from './same.js';
/**
* The same as {@link Same}, but ignore any fields present in the
* test object and not present in the expect pattern.
*/
export class Has extends Same {

@@ -4,0 +8,0 @@ // don't care about object shape, only that it has

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

{"version":3,"file":"has.js","sourceRoot":"","sources":["../../src/has.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,MAAM,OAAO,GAAI,SAAQ,IAAI;IAC3B,kDAAkD;IAClD,oCAAoC;IACpC,WAAW;QACT,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;QACzB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,IAAI,CAAC,OAAO,EAAE,CAAA;SACf;IACH,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC,OAAO,EAAE,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAA;IAC7D,CAAC;IAED,0DAA0D;IAC1D,cAAc,CAAC,GAAQ;QACrB,IAAI,GAAG,KAAK,IAAI,CAAC,MAAM,EAAE;YACvB,OAAO,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAA;SACjC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC7C,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAA;QAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;QACrC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAA;QAC/B,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;YACvB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,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AAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBACjB,SAAQ;aACT;YACD,IAAI,QAAQ,GAAG,KAAK,CAAA;YACpB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE;gBAC7B,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;oBACjB,SAAQ;iBACT;gBACD,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;oBACxB,MAAM,EAAE,GAAG;oBACX,WAAW,EAAE,IAAI;iBAClB,CAAC,CAAA;gBACF,CAAC,CAAC,KAAK,EAAE,CAAA;gBACT,IAAI,CAAC,CAAC,KAAK,EAAE;oBACX,QAAQ,GAAG,IAAI,CAAA;oBACf,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;oBACb,MAAK;iBACN;aACF;YACD,IAAI,CAAC,QAAQ,EAAE;gBACb,IAAI,CAAC,OAAO,EAAE,CAAA;gBACd,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAC1C,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAChD,OAAM;aACP;SACF;IACH,CAAC;CACF","sourcesContent":["import { Format } from './format.js'\nimport { Same } from './same.js'\nexport class Has extends Same {\n // don't care about object shape, only that it has\n // matching fields of the same type.\n simpleMatch() {\n this.simple = this.test()\n if (!this.simple) {\n this.unmatch()\n }\n }\n\n isArray() {\n return super.isArray() && new Format(this.expect).isArray()\n }\n\n // just return the entries that exist in the expect object\n getPojoEntries(obj: any) {\n if (obj !== this.object) {\n return super.getPojoEntries(obj)\n }\n const expKeys = this.getPojoKeys(this.expect)\n const expSet = new Set(expKeys)\n const objKeys = this.getPojoKeys(obj)\n const objSet = new Set(objKeys)\n for (const k of expKeys) {\n if (!objSet.has(k) && this.expect[k] == undefined) {\n objKeys.push(k)\n }\n }\n const ent: [string, any][] = objKeys\n .filter(k => expSet.has(k))\n .map(k => [k, obj[k]])\n\n return this.sort\n ? ent.sort((a, b) => a[0].localeCompare(b[0], 'en'))\n : ent\n }\n\n printMapEntryUnexpected(_key: any, _val: any) {\n // nothing to do, this is fine\n }\n\n // only test expected array entries within the expect array length\n get objectAsArray() {\n const arr = super.objectAsArray\n if (arr) {\n const exp = super.expectAsArray\n if (exp && exp.length < arr.length) {\n const value = arr.slice(0, exp.length)\n Object.defineProperty(this, 'objectAsArray', {\n value,\n configurable: true,\n })\n return value\n }\n }\n const value = arr\n Object.defineProperty(this, 'objectAsArray', {\n value,\n configurable: true,\n })\n return value\n }\n\n // always include message/name, so you can do t.has(er, { message }) etc.\n printErrorBody() {\n super.printErrorBody()\n const expKeys = new Set(this.getPojoKeys(this.expect))\n if (expKeys.has('name') && this.expect.name) {\n this.printPojoEntry('name', this.object.name)\n }\n if (expKeys.has('message') && this.expect.message) {\n this.printPojoEntry('message', this.object.message)\n }\n }\n\n // this one is a little tricky, because we need to only walk the ones that\n // actually exist in the expect set.\n printSetBody() {\n // if there are MORE items in the expectation, that's always a fail.\n if (this.expect.size > this.object.size) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect += this.simplePrint(this.expect)\n return\n }\n const seen = new Set()\n // skip all identity matches\n for (const val of this.expect) {\n if (this.object.has(val)) {\n seen.add(val)\n continue\n }\n }\n for (const exp of this.expect) {\n if (seen.has(exp)) {\n continue\n }\n let sawMatch = false\n for (const val of this.object) {\n if (seen.has(val)) {\n continue\n }\n const s = this.child(val, {\n expect: exp,\n provisional: true,\n })\n s.print()\n if (s.match) {\n sawMatch = true\n seen.add(val)\n break\n }\n }\n if (!sawMatch) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect += this.simplePrint(this.expect)\n return\n }\n }\n }\n}\n"]}
{"version":3,"file":"has.js","sourceRoot":"","sources":["../../src/has.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM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BACD,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;oBACxB,MAAM,EAAE,GAAG;oBACX,WAAW,EAAE,IAAI;iBAClB,CAAC,CAAA;gBACF,CAAC,CAAC,KAAK,EAAE,CAAA;gBACT,IAAI,CAAC,CAAC,KAAK,EAAE;oBACX,QAAQ,GAAG,IAAI,CAAA;oBACf,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;oBACb,MAAK;iBACN;aACF;YACD,IAAI,CAAC,QAAQ,EAAE;gBACb,IAAI,CAAC,OAAO,EAAE,CAAA;gBACd,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAC1C,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAChD,OAAM;aACP;SACF;IACH,CAAC;CACF","sourcesContent":["import { Format } from './format.js'\nimport { Same } from './same.js'\n/**\n * The same as {@link Same}, but ignore any fields present in the\n * test object and not present in the expect pattern.\n */\nexport class Has extends Same {\n // don't care about object shape, only that it has\n // matching fields of the same type.\n simpleMatch() {\n this.simple = this.test()\n if (!this.simple) {\n this.unmatch()\n }\n }\n\n isArray() {\n return super.isArray() && new Format(this.expect).isArray()\n }\n\n // just return the entries that exist in the expect object\n getPojoEntries(obj: any) {\n if (obj !== this.object) {\n return super.getPojoEntries(obj)\n }\n const expKeys = this.getPojoKeys(this.expect)\n const expSet = new Set(expKeys)\n const objKeys = this.getPojoKeys(obj)\n const objSet = new Set(objKeys)\n for (const k of expKeys) {\n if (!objSet.has(k) && this.expect[k] == undefined) {\n objKeys.push(k)\n }\n }\n const ent: [string, any][] = objKeys\n .filter(k => expSet.has(k))\n .map(k => [k, obj[k]])\n\n return this.sort\n ? ent.sort((a, b) => a[0].localeCompare(b[0], 'en'))\n : ent\n }\n\n printMapEntryUnexpected(_key: any, _val: any) {\n // nothing to do, this is fine\n }\n\n // only test expected array entries within the expect array length\n get objectAsArray() {\n const arr = super.objectAsArray\n if (arr) {\n const exp = super.expectAsArray\n if (exp && exp.length < arr.length) {\n const value = arr.slice(0, exp.length)\n Object.defineProperty(this, 'objectAsArray', {\n value,\n configurable: true,\n })\n return value\n }\n }\n const value = arr\n Object.defineProperty(this, 'objectAsArray', {\n value,\n configurable: true,\n })\n return value\n }\n\n // always include message/name, so you can do t.has(er, { message }) etc.\n printErrorBody() {\n super.printErrorBody()\n const expKeys = new Set(this.getPojoKeys(this.expect))\n if (expKeys.has('name') && this.expect.name) {\n this.printPojoEntry('name', this.object.name)\n }\n if (expKeys.has('message') && this.expect.message) {\n this.printPojoEntry('message', this.object.message)\n }\n }\n\n // this one is a little tricky, because we need to only walk the ones that\n // actually exist in the expect set.\n printSetBody() {\n // if there are MORE items in the expectation, that's always a fail.\n if (this.expect.size > this.object.size) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect += this.simplePrint(this.expect)\n return\n }\n const seen = new Set()\n // skip all identity matches\n for (const val of this.expect) {\n if (this.object.has(val)) {\n seen.add(val)\n continue\n }\n }\n for (const exp of this.expect) {\n if (seen.has(exp)) {\n continue\n }\n let sawMatch = false\n for (const val of this.object) {\n if (seen.has(val)) {\n continue\n }\n const s = this.child(val, {\n expect: exp,\n provisional: true,\n })\n s.print()\n if (s.match) {\n sawMatch = true\n seen.add(val)\n break\n }\n }\n if (!sawMatch) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect += this.simplePrint(this.expect)\n return\n }\n }\n }\n}\n"]}

@@ -0,16 +1,40 @@

/**
* Export all implementation classes, and convenience methods for each
* @module
*/
import { FormatOptions } from './format.js';
import { SameOptions } from './same.js';
/**
* The return value from all comparison functions.
*/
export interface Result {
/**
* Diff of formatted test object and expected pattern. Only shows
* properties which differ, not the entire object.
*/
diff: string;
/**
* whether or not the objects are a satisfying match
*/
match: boolean;
}
export type CompareOptions = FormatOptions & Pick<SameOptions, 'diffContext'>;
/** format a value and return the formatted string */
export declare const format: (obj: any, options?: FormatOptions) => string;
/** convenience method for {@link Same} */
export declare const same: (obj: any, pattern: any, options?: CompareOptions) => Result;
/** convenience method for {@link Strict} */
export declare const strict: (obj: any, pattern: any, options?: CompareOptions) => Result;
/** convenience method for {@link Has} */
export declare const has: (obj: any, pattern: any, options?: CompareOptions) => Result;
/** convenience method for {@link HasStrict} */
export declare const hasStrict: (obj: any, pattern: any, options?: CompareOptions) => Result;
/** convenience method for {@link Match} */
export declare const match: (obj: any, pattern: any, options?: CompareOptions) => Result;
/** convenience method for {@link MatchOnly} */
export declare const matchOnly: (obj: any, pattern: any, options?: CompareOptions) => Result;
/** convenience method for {@link MatchStrict} */
export declare const matchStrict: (obj: any, pattern: any, options?: CompareOptions) => Result;
/** convenience method for {@link MatchOnlyStrict} */
export declare const matchOnlyStrict: (obj: any, pattern: any, options?: CompareOptions) => Result;
export { Format } from './format.js';

@@ -22,2 +46,3 @@ export type { FormatOptions } from './format.js';

export { MatchStrict } from './match-strict.js';
export { MatchOnlyStrict } from './match-only-strict.js';
export { Match } from './match.js';

@@ -24,0 +49,0 @@ export { Same } from './same.js';

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

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,aAAa,EAAE,MAAM,aAAa,CAAA;AAMnD,OAAO,EAAQ,WAAW,EAAE,MAAM,WAAW,CAAA;AAG7C,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,OAAO,CAAA;CACf;AAOD,MAAM,MAAM,cAAc,GAAG,aAAa,GACxC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAA;AAYlC,eAAO,MAAM,MAAM,QACZ,GAAG,YACC,aAAa,KACrB,MAA0C,CAAA;AAE7C,eAAO,MAAM,IAAI,QAdT,GAAG,WAAW,GAAG,YAAW,cAAc,WActB,CAAA;AAC5B,eAAO,MAA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AiB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,YAAY,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA"}

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

/**
* Export all implementation classes, and convenience methods for each
* @module
*/
import { Format } from './format.js';

@@ -6,2 +10,3 @@ import { HasStrict } from './has-strict.js';

import { MatchStrict } from './match-strict.js';
import { MatchOnlyStrict } from './match-only-strict.js';
import { Match } from './match.js';

@@ -19,10 +24,20 @@ import { Same } from './same.js';

}));
/** format a value and return the formatted string */
export const format = (obj, options = {}) => new Format(obj, options).print();
/** convenience method for {@link Same} */
export const same = fn(Same);
/** convenience method for {@link Strict} */
export const strict = fn(Strict);
/** convenience method for {@link Has} */
export const has = fn(Has);
/** convenience method for {@link HasStrict} */
export const hasStrict = fn(HasStrict);
/** convenience method for {@link Match} */
export const match = fn(Match);
/** convenience method for {@link MatchOnly} */
export const matchOnly = fn(MatchOnly);
/** convenience method for {@link MatchStrict} */
export const matchStrict = fn(MatchStrict);
/** convenience method for {@link MatchOnlyStrict} */
export const matchOnlyStrict = fn(MatchOnlyStrict);
export { Format } from './format.js';

@@ -33,2 +48,3 @@ export { HasStrict } from './has-strict.js';

export { MatchStrict } from './match-strict.js';
export { MatchOnlyStrict } from './match-only-strict.js';
export { Match } from './match.js';

@@ -35,0 +51,0 @@ export { Same } from './same.js';

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

{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,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MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,CAAA;AAC9B,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;AACtC,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC,WAAW,CAAC,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA","sourcesContent":["import { Format, FormatOptions } from './format.js'\nimport { HasStrict } from './has-strict.js'\nimport { Has } from './has.js'\nimport { MatchOnly } from './match-only.js'\nimport { MatchStrict } from './match-strict.js'\nimport { Match } from './match.js'\nimport { Same, SameOptions } from './same.js'\nimport { Strict } from './strict.js'\n\nexport interface Result {\n diff: string\n match: boolean\n}\nconst simple = <T extends Same>(o: T): Result => ({\n diff: o.print(),\n match: o.match,\n})\n\ntype Class<T> = { new (obj: any, options: SameOptions): T }\nexport type CompareOptions = FormatOptions &\n Pick<SameOptions, 'diffContext'>\nconst fn =\n <T extends Same>(Cls: Class<T>) =>\n (obj: any, pattern: any, options: CompareOptions = {}) =>\n simple<T>(\n new Cls(obj, {\n ...options,\n expect: pattern,\n parent: undefined,\n })\n )\n\nexport const format = (\n obj: any,\n options: FormatOptions = {}\n): string => new Format(obj, options).print()\n\nexport const same = fn(Same)\nexport const strict = fn(Strict)\nexport const has = fn(Has)\nexport const hasStrict = fn(HasStrict)\nexport const match = fn(Match)\nexport const matchOnly = fn(MatchOnly)\nexport const matchStrict = fn(MatchStrict)\nexport { Format } from './format.js'\nexport type { FormatOptions } from './format.js'\nexport { HasStrict } from './has-strict.js'\nexport { Has } from './has.js'\nexport { MatchOnly } from './match-only.js'\nexport { MatchStrict } from './match-strict.js'\nexport { Match } from './match.js'\nexport { Same } from './same.js'\nexport type { SameOptions } from './same.js'\nexport { Strict } from './strict.js'\nexport { styles } from './styles.js'\nexport type { Style } from './styles.js'\n"]}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAiB,MAAM,aAAa,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,IAAI,EAAe,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAgBpC,MAAM,MAAM,GAAG,CAAiB,CAAI,EAAU,EAAE,CAAC,CAAC;IAChD,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE;IACf,KAAK,EAAE,CAAC,CAAC,KAAK;CACf,CAAC,CAAA;AAKF,MAAM,EAAE,GACN,CAAiB,GAAa,EAAE,EAAE,CAClC,CAAC,GAAQ,EAAE,OAAY,EAAE,UAA0B,EAAE,EAAE,EAAE,CACvD,MAAM,CACJ,IAAI,GAAG,CAAC,GAAG,EAAE;IACX,GAAG,OAAO;IACV,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,SAAS;CAClB,CA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CAAA;AAEhC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA","sourcesContent":["/**\n * Export all implementation classes, and convenience methods for each\n * @module\n */\nimport { Format, FormatOptions } from './format.js'\nimport { HasStrict } from './has-strict.js'\nimport { Has } from './has.js'\nimport { MatchOnly } from './match-only.js'\nimport { MatchStrict } from './match-strict.js'\nimport { MatchOnlyStrict } from './match-only-strict.js'\nimport { Match } from './match.js'\nimport { Same, SameOptions } from './same.js'\nimport { Strict } from './strict.js'\n\n/**\n * The return value from all comparison functions.\n */\nexport interface Result {\n /**\n * Diff of formatted test object and expected pattern. Only shows\n * properties which differ, not the entire object.\n */\n diff: string\n /**\n * whether or not the objects are a satisfying match\n */\n match: boolean\n}\nconst simple = <T extends Same>(o: T): Result => ({\n diff: o.print(),\n match: o.match,\n})\n\ntype Class<T> = { new (obj: any, options: SameOptions): T }\nexport type CompareOptions = FormatOptions &\n Pick<SameOptions, 'diffContext'>\nconst fn =\n <T extends Same>(Cls: Class<T>) =>\n (obj: any, pattern: any, options: CompareOptions = {}) =>\n simple<T>(\n new Cls(obj, {\n ...options,\n expect: pattern,\n parent: undefined,\n })\n )\n\n/** format a value and return the formatted string */\nexport const format = (\n obj: any,\n options: FormatOptions = {}\n): string => new Format(obj, options).print()\n/** convenience method for {@link Same} */\nexport const same = fn(Same)\n/** convenience method for {@link Strict} */\nexport const strict = fn(Strict)\n/** convenience method for {@link Has} */\nexport const has = fn(Has)\n/** convenience method for {@link HasStrict} */\nexport const hasStrict = fn(HasStrict)\n/** convenience method for {@link Match} */\nexport const match = fn(Match)\n/** convenience method for {@link MatchOnly} */\nexport const matchOnly = fn(MatchOnly)\n/** convenience method for {@link MatchStrict} */\nexport const matchStrict = fn(MatchStrict)\n/** convenience method for {@link MatchOnlyStrict} */\nexport const matchOnlyStrict = fn(MatchOnlyStrict)\n\nexport { Format } from './format.js'\nexport type { FormatOptions } from './format.js'\nexport { HasStrict } from './has-strict.js'\nexport { Has } from './has.js'\nexport { MatchOnly } from './match-only.js'\nexport { MatchStrict } from './match-strict.js'\nexport { MatchOnlyStrict } from './match-only-strict.js'\nexport { Match } from './match.js'\nexport { Same } from './same.js'\nexport type { SameOptions } from './same.js'\nexport { Strict } from './strict.js'\nexport { styles } from './styles.js'\nexport type { Style } from './styles.js'\n"]}
import { Same } from './same.js';
/**
* this uses the test method from {@link Match}, but requires that *only* the
* specified fields in the pattern are present in the object.
*
* It does still allow a field to be present in the object and not the pattern
* if the value is set to null or undefined.
*/
export declare class MatchOnly extends Same {

@@ -3,0 +10,0 @@ test(): boolean | "COMPLEX";

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

{"version":3,"file":"match-only.d.ts","sourceRoot":"","sources":["../../src/match-only.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,qBAAa,SAAU,SAAQ,IAAI;IACjC,IAAI;CAGL"}
{"version":3,"file":"match-only.d.ts","sourceRoot":"","sources":["../../src/match-only.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;;;;;GAMG;AACH,qBAAa,SAAU,SAAQ,IAAI;IACjC,IAAI;CAGL"}

@@ -1,8 +0,10 @@

// this uses the test method from match, but requires that *only*
// the specified fields in the pattern are present in the object.
//
// Note: it does still allow a field to be present in the object
// and not the pattern if the value is set to null or undefined.
import { Match } from './match.js';
import { Same } from './same.js';
/**
* this uses the test method from {@link Match}, but requires that *only* the
* specified fields in the pattern are present in the object.
*
* It does still allow a field to be present in the object and not the pattern
* if the value is set to null or undefined.
*/
export class MatchOnly extends Same {

@@ -9,0 +11,0 @@ test() {

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

{"version":3,"file":"match-only.js","sourceRoot":"","sources":["../../src/match-only.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,iEAAiE;AACjE,EAAE;AACF,gEAAgE;AAChE,gEAAgE;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,MAAM,OAAO,SAAU,SAAQ,IAAI;IACjC,IAAI;QACF,OAAO,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACxC,CAAC;CACF","sourcesContent":["// this uses the test method from match, but requires that *only*\n// the specified fields in the pattern are present in the object.\n//\n// Note: it does still allow a field to be present in the object\n// and not the pattern if the value is set to null or undefined.\n\nimport { Match } from './match.js'\nimport { Same } from './same.js'\nexport class MatchOnly extends Same {\n test() {\n return Match.prototype.test.call(this)\n }\n}\n"]}
{"version":3,"file":"match-only.js","sourceRoot":"","sources":["../../src/match-only.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;;;;;GAMG;AACH,MAAM,OAAO,SAAU,SAAQ,IAAI;IACjC,IAAI;QACF,OAAO,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACxC,CAAC;CACF","sourcesContent":["import { Match } from './match.js'\nimport { Same } from './same.js'\n\n/**\n * this uses the test method from {@link Match}, but requires that *only* the\n * specified fields in the pattern are present in the object.\n *\n * It does still allow a field to be present in the object and not the pattern\n * if the value is set to null or undefined.\n */\nexport class MatchOnly extends Same {\n test() {\n return Match.prototype.test.call(this)\n }\n}\n"]}
import { Match } from './match.js';
/**
* Identical to {@link Match}, *except* in the case of two simple types.
* If the value loosely equals the expected pattern, but is not strictly
* equal, then the test returns false.
*/
export declare class MatchStrict extends Match {

@@ -3,0 +8,0 @@ test(): boolean | "COMPLEX";

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

{"version":3,"file":"match-strict.d.ts","sourceRoot":"","sources":["../../src/match-strict.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,qBAAa,WAAY,SAAQ,KAAK;IACpC,IAAI;CAOL"}
{"version":3,"file":"match-strict.d.ts","sourceRoot":"","sources":["../../src/match-strict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,IAAI;CAOL"}

@@ -1,5 +0,7 @@

// this is a weird one. Basically, it is identical to Match,
// EXCEPT in the case of two simple types. If the object == expect,
// but the object does not === expect, then it returns false.
import { Match } from './match.js';
/**
* Identical to {@link Match}, *except* in the case of two simple types.
* If the value loosely equals the expected pattern, but is not strictly
* equal, then the test returns false.
*/
export class MatchStrict extends Match {

@@ -6,0 +8,0 @@ test() {

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

{"version":3,"file":"match-strict.js","sourceRoot":"","sources":["../../src/match-strict.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,oEAAoE;AACpE,6DAA6D;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,IAAI;QACF,kDAAkD;QAClD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE;YAC7D,OAAO,KAAK,CAAA;SACb;QACD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC;CACF","sourcesContent":["// this is a weird one. Basically, it is identical to Match,\n// EXCEPT in the case of two simple types. If the object == expect,\n// but the object does not === expect, then it returns false.\nimport { Match } from './match.js'\nexport class MatchStrict extends Match {\n test() {\n // equal on type coercion, but not equal strictly.\n if (this.expect == this.object && this.expect !== this.object) {\n return false\n }\n return super.test()\n }\n}\n"]}
{"version":3,"file":"match-strict.js","sourceRoot":"","sources":["../../src/match-strict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,IAAI;QACF,kDAAkD;QAClD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE;YAC7D,OAAO,KAAK,CAAA;SACb;QACD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC;CACF","sourcesContent":["import { Match } from './match.js'\n\n/**\n * Identical to {@link Match}, *except* in the case of two simple types.\n * If the value loosely equals the expected pattern, but is not strictly\n * equal, then the test returns false.\n */\nexport class MatchStrict extends Match {\n test() {\n // equal on type coercion, but not equal strictly.\n if (this.expect == this.object && this.expect !== this.object) {\n return false\n }\n return super.test()\n }\n}\n"]}
import { Has } from './has.js';
/**
* The loosed and most flexibly magical matching strategy.
*
* - If the objects pass the {@link Has} test, then return true.
* - If the pattern is a regular expression, then test it against the
* string form of the test value.
* - If the pattern is a string, and the test value is a string, then test
* that the pattern appears somewhere in the test value.
* - If the pattern is a string, and the test value is a Date, then test
* parse the pattern as a Date and verify that they have the same value
* - If the pattern is a constructor, then test that the value is an
* instance of the constructor. In the case of scalar constructors, like
* Number, Boolean, etc, also pass if the `typeof` the value matches.
* That is `Match(1, { expect: Number })` passes.
* - If the pattern is the `Array` constructor, then pass for any iterable
* valuef.
*/
export declare class Match extends Has {

@@ -3,0 +20,0 @@ test(): boolean | 'COMPLEX';

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

{"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../src/match.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,qBAAa,KAAM,SAAQ,GAAG;IAC5B,IAAI,IAAI,OAAO,GAAG,SAAS;CAsE5B"}
{"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../src/match.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B;;;;;;;;;;;;;;;;GAgBG;AAEH,qBAAa,KAAM,SAAQ,GAAG;IAC5B,IAAI,IAAI,OAAO,GAAG,SAAS;CAsE5B"}
import { Format } from './format.js';
import { Has } from './has.js';
/**
* The loosed and most flexibly magical matching strategy.
*
* - If the objects pass the {@link Has} test, then return true.
* - If the pattern is a regular expression, then test it against the
* string form of the test value.
* - If the pattern is a string, and the test value is a string, then test
* that the pattern appears somewhere in the test value.
* - If the pattern is a string, and the test value is a Date, then test
* parse the pattern as a Date and verify that they have the same value
* - If the pattern is a constructor, then test that the value is an
* instance of the constructor. In the case of scalar constructors, like
* Number, Boolean, etc, also pass if the `typeof` the value matches.
* That is `Match(1, { expect: Number })` passes.
* - If the pattern is the `Array` constructor, then pass for any iterable
* valuef.
*/
export class Match extends Has {

@@ -4,0 +21,0 @@ test() {

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

{"version":3,"file":"match.js","sourceRoot":"","sources":["../../src/match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,MAAM,OAAO,KAAM,SAAQ,GAAG;IAC5B,IAAI;QACF,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAA;QACvB,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAA;QAE3B,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,IAAI;YAC1B,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,mDAAmD;gBACrD,sDAAsD;gBACtD,OAAO,IAAI,IAAI,IAAI,GAAG,IAAI,IAAI;oBAC9B,CAAC,CAAC,KAAK;oBACP,CAAC,CAAC,OAAO,YAAY,MAAM,IAAI,GAAG,YAAY,MAAM;wBACpD,CAAC,CAAC,KAAK;wBACP,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;4BAClD,CAAC,CAAC,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AC,KAAK;wHACP,CAAC,CAAC,SAAS,CAAA;IACf,CAAC;CACF","sourcesContent":["import { Format } from './format.js'\nimport { Has } from './has.js'\nexport class Match extends Has {\n test(): boolean | 'COMPLEX' {\n const obj = this.object\n const pattern = this.expect\n\n return super.test() === true\n ? true\n : // failures that would also fail in the super class\n // but if they didn't pass, then should fail here, too\n pattern == null || obj == null\n ? false\n : pattern instanceof RegExp && obj instanceof RegExp\n ? false\n : Buffer.isBuffer(obj) && Buffer.isBuffer(pattern)\n ? false\n : typeof pattern === 'symbol'\n ? false\n : // ok, Match-specific stuff\n pattern instanceof RegExp\n ? pattern.test('' + obj)\n : typeof obj === 'string' &&\n typeof pattern === 'string' &&\n pattern\n ? obj.indexOf(pattern) !== -1\n : obj instanceof Date && typeof pattern === 'string'\n ? obj.getTime() === new Date(pattern).getTime()\n : pattern === BigInt\n ? typeof obj === 'bigint'\n : pattern === Buffer\n ? Buffer.isBuffer(obj)\n : pattern === Function\n ? typeof obj === 'function'\n : pattern === Number\n ? typeof obj === 'number' && obj === obj && isFinite(obj)\n : pattern === String\n ? typeof obj === 'string'\n : pattern === Symbol\n ? typeof obj === 'symbol'\n : pattern === Boolean\n ? typeof obj === 'boolean'\n : pattern === Map\n ? this.isMap()\n : pattern === Set\n ? this.isSet()\n : pattern === Object\n ? obj && typeof obj === 'object'\n : pattern === Array\n ? new Format(obj).isArray()\n : !this.isError() && pattern instanceof Error\n ? false\n : this.isError() &&\n ((pattern.message &&\n !new Match(obj.message, {\n expect: pattern.message,\n }).test()) ||\n (pattern.name &&\n !new Match(obj.name, {\n expect: pattern.name,\n }).test()))\n ? false\n : // standard deep matching stuff, same as parent, but not simple.\n this.isSet() && !(pattern instanceof Set)\n ? false\n : this.isMap() && !(pattern instanceof Map)\n ? false\n : typeof pattern === 'function' && typeof obj === 'object'\n ? obj instanceof pattern\n : typeof obj !== 'object' || typeof pattern !== 'object'\n ? false\n : 'COMPLEX'\n }\n}\n"]}
{"version":3,"file":"match.js","source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E;4GACtB,MAAM,EAAE,OAAO,CAAC,OAAO;yGACxB,CAAC,CAAC,IAAI,EAAE,CAAC;wGACV,CAAC,OAAO,CAAC,IAAI;4GACX,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE;gHACnB,MAAM,EAAE,OAAO,CAAC,IAAI;6GACrB,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;oGACjB,CAAC,CAAC,KAAK;oGACP,CAAC,CAAC,gEAAgE;wGAClE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,OAAO,YAAY,GAAG,CAAC;4GACzC,CAAC,CAAC,KAAK;4GACP,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,OAAO,YAAY,GAAG,CAAC;gHAC3C,CAAC,CAAC,KAAK;gHACP,CAAC,CAAC,OAAO,OAAO,KAAK,UAAU,IAAI,OAAO,GAAG,KAAK,QAAQ;oHAC1D,CAAC,CAAC,GAAG,YAAY,OAAO;oHACxB,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ;wHACxD,CAAC,CAAC,KAAK;wHACP,CAAC,CAAC,SAAS,CAAA;IACf,CAAC;CACF","sourcesContent":["import { Format } from './format.js'\nimport { Has } from './has.js'\n\n/**\n * The loosed and most flexibly magical matching strategy.\n *\n * - If the objects pass the {@link Has} test, then return true.\n * - If the pattern is a regular expression, then test it against the\n * string form of the test value.\n * - If the pattern is a string, and the test value is a string, then test\n * that the pattern appears somewhere in the test value.\n * - If the pattern is a string, and the test value is a Date, then test\n * parse the pattern as a Date and verify that they have the same value\n * - If the pattern is a constructor, then test that the value is an\n * instance of the constructor. In the case of scalar constructors, like\n * Number, Boolean, etc, also pass if the `typeof` the value matches.\n * That is `Match(1, { expect: Number })` passes.\n * - If the pattern is the `Array` constructor, then pass for any iterable\n * valuef.\n */\n\nexport class Match extends Has {\n test(): boolean | 'COMPLEX' {\n const obj = this.object\n const pattern = this.expect\n\n return super.test() === true\n ? true\n : // failures that would also fail in the super class\n // but if they didn't pass, then should fail here, too\n pattern == null || obj == null\n ? false\n : pattern instanceof RegExp && obj instanceof RegExp\n ? false\n : Buffer.isBuffer(obj) && Buffer.isBuffer(pattern)\n ? false\n : typeof pattern === 'symbol'\n ? false\n : // ok, Match-specific stuff\n pattern instanceof RegExp\n ? pattern.test('' + obj)\n : typeof obj === 'string' &&\n typeof pattern === 'string' &&\n pattern\n ? obj.indexOf(pattern) !== -1\n : obj instanceof Date && typeof pattern === 'string'\n ? obj.getTime() === new Date(pattern).getTime()\n : pattern === BigInt\n ? typeof obj === 'bigint'\n : pattern === Buffer\n ? Buffer.isBuffer(obj)\n : pattern === Function\n ? typeof obj === 'function'\n : pattern === Number\n ? typeof obj === 'number' && obj === obj && isFinite(obj)\n : pattern === String\n ? typeof obj === 'string'\n : pattern === Symbol\n ? typeof obj === 'symbol'\n : pattern === Boolean\n ? typeof obj === 'boolean'\n : pattern === Map\n ? this.isMap()\n : pattern === Set\n ? this.isSet()\n : pattern === Object\n ? obj && typeof obj === 'object'\n : pattern === Array\n ? new Format(obj).isArray()\n : !this.isError() && pattern instanceof Error\n ? false\n : this.isError() &&\n ((pattern.message &&\n !new Match(obj.message, {\n expect: pattern.message,\n }).test()) ||\n (pattern.name &&\n !new Match(obj.name, {\n expect: pattern.name,\n }).test()))\n ? false\n : // standard deep matching stuff, same as parent, but not simple.\n this.isSet() && !(pattern instanceof Set)\n ? false\n : this.isMap() && !(pattern instanceof Map)\n ? false\n : typeof pattern === 'function' && typeof obj === 'object'\n ? obj instanceof pattern\n : typeof obj !== 'object' || typeof pattern !== 'object'\n ? false\n : 'COMPLEX'\n }\n}\n"]}
import { Format, FormatOptions } from './format.js';
/**
* Options for all comparator operations
*/
export interface SameOptions extends FormatOptions {
/** the pattern to test against */
expect: any;

@@ -7,4 +11,27 @@ parent?: Same;

expectKey?: any;
/**
* how many lines of context to print around changes in diffs
* @default 10
*/
diffContext?: number;
}
/**
* Base class for all comparators
*
* We walk through both of the expect and actual objects,
* creating a Same node for each field in common, based on
* their similarity:
* - true (they're a match) omit from the result (the child node is discarded)
* - false (they're simply nonmatching) format both expect and object
* - COMPLEX - walk through child nodes
* - if match: child node is discarded
* - else, child node is retained (along with its non-matching children)
*
* We 'discard' by just having the print method return ''
*
* When walking child nodes, we use the shouldCompare(key) method to determine
* whether to check a given field. In this class, this is always true (because
* we are testing for full deep sameness), but in {@link Has} and subclasses,
* it's more complicated (only test nodes that exist in the expect object).
*/
export declare class Same extends Format {

@@ -11,0 +38,0 @@ provisional: boolean;

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

{"version":3,"file":"same.d.ts","sourceRoot":"","sources":["../../src/same.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAanD,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,MAAM,EAAE,GAAG,CAAA;IACX,MAAM,CAAC,EAAE,IAAI,CAAA;IACb,GAAG,CAAC,EAAE,GAAG,CAAA;IACT,SAAS,CAAC,EAAE,GAAG,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,qBAAa,IAAK,SAAQ,MAAM;IAC9B,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,EAAE,GAAG,CAAA;IACX,MAAM,EAAE,IAAI,GAAG,IAAI,CAAA;IACnB,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAO;IACzC,KAAK,EAAE,OAAO,CAAO;IACrB,WAAW,EAAE,MAAM,CAAK;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAO;IAE9B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAO;gBAEpB,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,WAAW;IAuB1C,WAAW;IAUX,IAAI;IAuCJ,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAU/B,OAAO;IAUP,WAAW,CAAC,GAAG,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,GAAG,EAAE,GAAG;IAapB,IAAI,aAAa,iBAWhB;IAED,UAAU,IAAI,IAAI;IA0BlB,QAAQ,IAAI,IAAI;IAsBhB,SAAS;IAkBT,WAAW;IAGX,iBAAiB;IAGjB,cAAc;IAGd,WAAW,CAAC,GAAG,GAAE,GAAiB,GAAG,MAAM,EAAE;IAS7C,aAAa;IAMb,aAAa;IAKb,aAAa;IAkBb,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,OAAO;IAYrD,UAAU;IAaV,YAAY;IAGZ,kBAAkB;IAOlB,eAAe;IAGf,cAAc;IAMd,cAAc;IAOd,QAAQ,IAAI,IAAI;IAahB,UAAU;IAGV,gBAAgB;IAGhB,YAAY;IAKZ,YAAY,IAAI,IAAI;IAKpB,YAAY,IAAI,IAAI;IAqDpB,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,GAAE,GAAS;IAMtD,qBAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IAQxC,uBAAuB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IA0B1C,UAAU,IAAI,IAAI;IAOlB,YAAY;IAGZ,kBAAkB,IAAI,OAAO;IAI7B,eAAe;IAGf,cAAc;IAgBd,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG;IAKrC,QAAQ;IAOR,gBAAgB;IAGhB,UAAU;IAGV,YAAY;CA6Cb"}

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

// Same is the base class for all comparators
//
// We walk through both of the expect and actual objects,
// creating a Same node for each field in common, based on
// their similarity:
// - true (they're a match) omit from the result (the child node is discarded)
// - false (they're simply nonmatching) format both expect and object
// - COMPLEX - walk through child nodes
// - if match: child node is discarded
// - else, child node is retained (along with its non-matching children)
//
// We 'discard' by just having the print method return ''
//
// When walking child nodes, we use the shouldCompare(key) method to determine
// whether to check a given field. In this class, this is always true (because
// we are testing for full deep sameness), but in Has classes, it's more
// complicated (only test nodes that exist in the expect object).
import { createTwoFilesPatch } from 'diff';

@@ -30,2 +13,21 @@ import { Format } from './format.js';

const { defineProperty } = Object;
/**
* Base class for all comparators
*
* We walk through both of the expect and actual objects,
* creating a Same node for each field in common, based on
* their similarity:
* - true (they're a match) omit from the result (the child node is discarded)
* - false (they're simply nonmatching) format both expect and object
* - COMPLEX - walk through child nodes
* - if match: child node is discarded
* - else, child node is retained (along with its non-matching children)
*
* We 'discard' by just having the print method return ''
*
* When walking child nodes, we use the shouldCompare(key) method to determine
* whether to check a given field. In this class, this is always true (because
* we are testing for full deep sameness), but in {@link Has} and subclasses,
* it's more complicated (only test nodes that exist in the expect object).
*/
export class Same extends Format {

@@ -32,0 +34,0 @@ provisional;

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

{"version":3,"file":"same.js","sourceRoot":"","sources":["../../src/same.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,yDAAyD;AACzD,0DAA0D;AAC1D,oBAAoB;AACpB,8EAA8E;AAC9E,qEAAqE;AACrE,uCAAuC;AACvC,wCAAwC;AACxC,0EAA0E;AAC1E,EAAE;AACF,yDAAyD;AACzD,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,wEAAwE;AACxE,iEAAiE;AAEjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAA;AAE1C,OAAO,EAAE,MAAM,EAAiB,MAAM,aAAa,CAAA;AAEnD,MAAM,SAAS,GAAG,CAAC,GAAQ,EAAE,EAAE;IAC7B,IAAI;QACF,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;KACvB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,IAAI,CAAA;KACZ;AACH,CAAC,CAAA;AAED,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,SAAS,CAAA;AAC3C,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAA;AAUjC,MAA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MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE;YAC7B,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBACxB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;gBACb,SAAQ;aACT;SACF;QACD,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE;YAC7B,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBACjB,SAAQ;aACT;YACD,IAAI,QAAQ,GAAG,KAAK,CAAA;YACpB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE;gBAC7B,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;oBACjB,SAAQ;iBACT;gBACD,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;oBACxB,MAAM,EAAE,GAAG;oBACX,WAAW,EAAE,IAAI;iBAClB,CAAC,CAAA;gBACF,CAAC,CAAC,KAAK,EAAE,CAAA;gBACT,IAAI,CAAC,CAAC,KAAK,EAAE;oBACX,QAAQ,GAAG,IAAI,CAAA;oBACf,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;oBACb,MAAK;iBACN;aACF;YACD,IAAI,CAAC,QAAQ,EAAE;gBACb,IAAI,CAAC,OAAO,EAAE,CAAA;gBACd,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,EAAE,CAAA;gBACvC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAA;gBAC3C,OAAM;aACP;SACF;IACH,CAAC;CACF","sourcesContent":["// Same is the base class for all comparators\n//\n// We walk through both of the expect and actual objects,\n// creating a Same node for each field in common, based on\n// their similarity:\n// - true (they're a match) omit from the result (the child node is discarded)\n// - false (they're simply nonmatching) format both expect and object\n// - COMPLEX - walk through child nodes\n// - if match: child node is discarded\n// - else, child node is retained (along with its non-matching children)\n//\n// We 'discard' by just having the print method return ''\n//\n// When walking child nodes, we use the shouldCompare(key) method to determine\n// whether to check a given field. In this class, this is always true (because\n// we are testing for full deep sameness), but in Has classes, it's more\n// complicated (only test nodes that exist in the expect object).\n\nimport { createTwoFilesPatch } from 'diff'\n\nimport { Format, FormatOptions } from './format.js'\n\nconst arrayFrom = (obj: any) => {\n try {\n return Array.from(obj)\n } catch (_) {\n return null\n }\n}\n\nconst { hasOwnProperty } = Object.prototype\nconst { defineProperty } = Object\n\nexport interface SameOptions extends FormatOptions {\n expect: any\n parent?: Same\n key?: any\n expectKey?: any\n diffContext?: number\n}\n\nexport class Same extends Format {\n provisional: boolean\n expect: any\n parent: Same | null\n simple: boolean | 'COMPLEX' | null = null\n match: boolean = true\n diffContext: number = 10\n memoDiff: string | null = null\n\n memoExpect: string | null = null\n\n constructor(obj: any, options: SameOptions) {\n if (!options || typeof options !== 'object') {\n throw new TypeError('must supply options object')\n }\n if (!('expect' in options)) {\n throw new TypeError('must supply expected value')\n }\n super(obj, options)\n this.parent = options.parent || null\n this.expect = options.expect\n if (!this.style.diffable) {\n throw new Error(\n `\"${options.style}\" style not appropriate for diffs`\n )\n }\n\n if (options.diffContext) {\n this.diffContext = options.diffContext\n }\n this.provisional = !!options.provisional\n this.simpleMatch()\n }\n\n simpleMatch() {\n this.simple = this.test()\n if (this.seen() !== this.seenExpect()) {\n this.simple = false\n }\n if (!this.simple) {\n this.unmatch()\n }\n }\n\n test() {\n const a = this.object\n const b = this.expect\n return typeof a === 'function' && typeof b === 'function'\n ? a === b ||\n (a.name === b.name && a.toString() === b.toString())\n : typeof a === 'symbol' || typeof b === 'symbol'\n ? typeof a === typeof b && a.toString() === b.toString()\n : typeof a !== 'object' && typeof b !== 'object' && a == b\n ? true\n : a === b\n ? true\n : a === null || b === null\n ? a == b\n : a !== a\n ? b !== b\n : typeof a !== 'object' || typeof b !== 'object'\n ? false\n : !this.isError() && b instanceof Error\n ? false\n : this.isError() &&\n ((b.message && b.message !== a.message) ||\n (b.name && b.name !== a.name))\n ? false\n : this.isSet() && !new Format(b).isSet()\n ? false\n : this.isMap() && !new Format(b).isMap()\n ? false\n : this.isArray() && !new Format(b).isArray()\n ? false\n : Buffer.isBuffer(a) && Buffer.isBuffer(b)\n ? a.equals(b)\n : a instanceof Date && b instanceof Date\n ? a.getTime() === b.getTime()\n : a instanceof RegExp && b instanceof RegExp\n ? this.regexpSame(a, b)\n : 'COMPLEX' // might still be a deeper mismatch, of course\n }\n\n regexpSame(a: RegExp, b: RegExp) {\n return (\n a.source === b.source &&\n a.global === b.global &&\n a.multiline === b.multiline &&\n a.lastIndex === b.lastIndex &&\n a.ignoreCase === b.ignoreCase\n )\n }\n\n unmatch() {\n if (this.match) {\n this.match = false\n if (!this.provisional) {\n this.parent && this.parent.unmatch()\n }\n }\n }\n\n // just print the thing as-is\n simplePrint(obj: any, options: FormatOptions = {}) {\n return new Format(obj, {\n ...this.options,\n ...options,\n }).print()\n }\n\n simplePrintExpect() {\n return new Format(this.expect, {\n ...this.options,\n seen: this.seenExpect,\n }).print()\n }\n\n seenExpect() {\n if (!this.expect || typeof this.expect !== 'object') {\n return false\n }\n\n for (let p = this.parent; p; p = p.parent) {\n if (p.expect === this.expect) {\n p.id = p.id || p.getId()\n return p\n }\n }\n return false\n }\n\n // if it's the root, then we do the diff\n // otherwise, we do the dual-walk of both trees,\n // building up the object and expect memos\n // this actually returns '' for any non-root node.\n print(): string {\n if (this.memo === null && this.memoExpect === null) {\n this.memo = ''\n this.memoExpect = ''\n if (!this.simple) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect += this.simplePrintExpect()\n } else {\n const seen = this.seen()\n const seenExpect = this.seenExpect()\n if (this.simple === true && seen === seenExpect) {\n this.memo = ''\n this.memoExpect = ''\n } else {\n if (seen) {\n this.printCircular(this.object)\n } else {\n this.printCollection()\n }\n }\n }\n }\n return this.diff()\n }\n\n printCircular(seen: Format): void {\n this.memo += this.style.circular(seen)\n const seenExpect = this.seenExpect()\n this.memoExpect = this.memoExpect || ''\n if (seenExpect) {\n this.memoExpect += this.style.circular(seenExpect)\n }\n }\n\n diff(): string {\n // impossible\n /* c8 ignore start */\n if (this.memoExpect === null || this.memo === null) {\n throw new TypeError('called diff() prior to print()')\n }\n /* c8 ignore stop */\n\n if (this.parent || this.match || this.memoExpect === this.memo) {\n return (this.memoDiff = '')\n }\n\n if (this.memoDiff !== null) {\n return this.memoDiff\n }\n\n return (this.memoDiff = createTwoFilesPatch(\n 'expected',\n 'actual',\n this.memoExpect + '\\n',\n this.memo + '\\n',\n undefined,\n undefined,\n { context: this.diffContext }\n ).replace(/^\\=+\\n/, ''))\n }\n\n child(\n obj: any,\n options: FormatOptions | SameOptions,\n cls?: typeof Same\n ) {\n const expectKey = hasOwnProperty.call(options, 'expectKey')\n ? (options as SameOptions).expectKey\n : options.key\n return super.child(\n obj,\n {\n expect: this.childExpect(expectKey),\n ...options,\n },\n cls\n )\n }\n\n childExpect(key: any) {\n // if we get here, we know that both expect and actual\n // are collections of the same type. Otherwise they\n // would have gotten the simple printed diff.\n return this.isSet()\n ? key\n : this.isMap()\n ? this.expect.get(key)\n : this.isArray()\n ? (this.expectAsArray as any[])[key]\n : this.expect[key]\n }\n\n get expectAsArray() {\n const value = Array.isArray(this.expect)\n ? this.expect\n : new Format(this.expect).isArray()\n ? arrayFrom(this.expect)\n : /* c8 ignore start */\n null\n /* c8 ignore stop */\n\n defineProperty(this, 'expectAsArray', { value })\n return value\n }\n\n printStart(): void {\n if (!this.parent) {\n this.memo = this.nodeId() + this.memo\n this.memoExpect = this.nodeId() + this.memoExpect\n return\n }\n // we always simple print keys\n /* c8 ignore start */\n const indent = this.isKey ? '' : this.indentLevel()\n /* c8 ignore stop */\n // this will always be keyless, because Array and Set\n // objects are always simple printed. But if that\n // chagnes, this will be relevant.\n /* c8 ignore start */\n const key = this.isKeyless() ? '' : this.getKey()\n /* c8 ignore stop */\n const sep = !key\n ? ''\n : this.parent && this.parent.isMap()\n ? this.style.mapKeyValSep()\n : this.style.pojoKeyValSep()\n const start = this.style.start(indent, key, sep)\n this.memo = start + this.nodeId() + this.memo\n this.memoExpect = start + this.nodeId() + this.memoExpect\n }\n\n printEnd(): void {\n if (!this.parent || this.isKey) {\n return\n }\n const end = this.parent.isMap()\n ? this.style.mapEntrySep()\n : this.parent.isArray()\n ? this.style.arrayEntrySep()\n : // these types are always simple printed\n /* c8 ignore start */\n this.parent.isSet()\n ? this.style.setEntrySep()\n : this.parent.isBuffer()\n ? ''\n : this.parent.isString()\n ? ''\n : /* c8 ignore stop */\n this.style.pojoEntrySep()\n this.memo += end\n this.memoExpect += end\n }\n\n printPojo() {\n // even though it's not a simple mismatch, it's possible that\n // a child entry will cause a mismatch, so we have to print\n // the body *before* doing the head. If we still aren't unmatched\n // after walking the graph, then nothing to do.\n if (this.pojoIsEmpty()) {\n this.memo = this.memo || ''\n this.memo += this.printPojoEmpty()\n } else {\n this.printPojoBody()\n if (!this.match) {\n this.printPojoHead()\n this.printStart()\n this.printPojoTail()\n this.printEnd()\n }\n }\n }\n pojoIsEmpty() {\n return super.pojoIsEmpty() && this.pojoExpectIsEmpty()\n }\n pojoExpectIsEmpty() {\n return super.pojoIsEmpty(this.expect)\n }\n printPojoEmpty() {\n // both are empty and not a simple mismatch, nothing to do\n }\n getPojoKeys(obj: any = this.object): string[] {\n const fromSuper = super.getPojoKeys(obj)\n if (obj === this.expect) {\n return fromSuper\n }\n return fromSuper.concat(\n this.getPojoKeys(this.expect).filter(k => k in obj)\n )\n }\n printPojoHead() {\n const h = this.style.pojoHead(this.getClass())\n\n this.memo = h + this.memo\n this.memoExpect = h + this.memoExpect\n }\n printPojoTail() {\n const t = this.style.pojoTail(this.indentLevel())\n this.memo += t\n this.memoExpect += t\n }\n printPojoBody() {\n const objEnt = new Map(this.getPojoEntries(this.object))\n const expEnt = new Map(this.getPojoEntries(this.expect))\n for (const [key, val] of objEnt.entries()) {\n if (!expEnt.has(key)) {\n this.unmatch()\n }\n this.printPojoEntry(key, val, false)\n }\n for (const key of expEnt.keys()) {\n if (objEnt.has(key)) {\n continue\n }\n this.unmatch()\n this.printPojoEntry(key, undefined, true)\n }\n }\n\n printPojoEntry(key: any, val: any, notFound?: boolean) {\n const child = this.child(val, { key })\n child.print()\n if (!notFound) {\n this.memo += child.memo\n }\n if (notFound || hasOwnProperty.call(this.expect, key)) {\n this.memoExpect += child.memoExpect\n }\n }\n\n // error is just a pojo with some fancy styling\n printError() {\n if (this.errorIsEmpty()) {\n return this.printErrorEmpty()\n } else {\n this.printErrorBody()\n if (!this.match) {\n this.printErrorHead()\n this.printStart()\n this.printErrorTail()\n this.printEnd()\n }\n }\n }\n errorIsEmpty() {\n return super.errorIsEmpty() && this.expectErrorIsEmpty()\n }\n expectErrorIsEmpty() {\n return (\n this.getPojoEntries(this.expect).filter(\n ([k]) => k !== 'name' && k !== 'message'\n ).length === 0\n )\n }\n printErrorEmpty() {\n // nothing to do\n }\n printErrorHead() {\n const headObj = this.style.errorHead(this.object, this.getClass())\n this.memo = headObj + this.memo\n const headExp = this.style.errorHead(this.expect, this.getClass())\n this.memoExpect = headExp + this.memoExpect\n }\n printErrorTail() {\n const t = this.style.errorTail(this.indentLevel())\n this.memo += t\n this.memoExpect += t\n }\n\n // maps are like pojos with fancier keys\n printMap(): void {\n if (this.mapIsEmpty()) {\n this.printMapEmpty()\n } else {\n this.printMapBody()\n if (!this.match) {\n this.printMapHead()\n this.printStart()\n this.printMapTail()\n this.printEnd()\n }\n }\n }\n mapIsEmpty() {\n return super.mapIsEmpty() && this.mapExpectIsEmpty()\n }\n mapExpectIsEmpty() {\n return this.expect.size === 0\n }\n printMapHead() {\n const h = this.style.mapHead(this.getClass())\n this.memo = h + this.memo\n this.memoExpect = h + this.memoExpect\n }\n printMapTail(): void {\n const t = this.style.mapTail(this.indentLevel())\n this.memo += t\n this.memoExpect += t\n }\n printMapBody(): void {\n // new Map([{}:1]) matches another new Map([{}:1])\n // so we can't rely on key identity.\n const seen = new Set()\n // first pass to get any that are key identity matches\n for (const [key, val] of this.object.entries()) {\n if (this.expect.has(key)) {\n seen.add(key)\n this.printMapEntry(key, val)\n continue\n }\n }\n for (const [key, val] of this.object.entries()) {\n if (seen.has(key)) {\n continue\n }\n // try to find a matching key not yet seen\n let sawMatch = false\n for (const expectKey of this.expect.keys()) {\n if (seen.has(expectKey)) {\n continue\n }\n const s = this.child(key, {\n expect: expectKey,\n provisional: true,\n })\n s.print()\n if (s.match) {\n // it's a match! test against this one.\n sawMatch = true\n seen.add(key)\n seen.add(expectKey)\n sawMatch = true\n this.printMapEntry(key, val, expectKey)\n break\n }\n }\n\n if (!sawMatch) {\n this.printMapEntryUnexpected(key, val)\n seen.add(key)\n }\n }\n\n // now loop over all expected values not found in object\n for (const [key, val] of this.expect.entries()) {\n if (seen.has(key)) {\n continue\n }\n this.printMapEntryNotFound(key, val)\n }\n }\n\n printMapEntry(key: any, val: any, expectKey: any = key) {\n const child = this.child(val, { key, expectKey })\n child.print()\n this.memo += child.memo\n this.memoExpect += child.memoExpect\n }\n printMapEntryNotFound(key: any, val: any) {\n this.unmatch()\n this.memoExpect += this.simplePrint(val, {\n parent: this,\n key,\n seen: this.seenExpect,\n })\n }\n printMapEntryUnexpected(key: any, val: any) {\n this.unmatch()\n this.memo += this.simplePrint(val, {\n key,\n parent: this,\n })\n }\n\n // arrays and sets don't have useful keys, so it's really hard to see\n // where the mismatch occurs with only the path context. For example,\n // if you have an array of objects with many keys, that mismatches on\n // only one key in one object, we would get a diff that looks like:\n // [\n // + {key: value},\n // - {key: otherValue},\n // ]\n // which isn't super helpful, since you don't know which index it failed\n // on, or even have the other properties of the object or key path to\n // use to find it.\n // So, if it's not a match, we simplePrint both the expected and object,\n // and let the diff sort it out, since it does a pretty good job of that\n // anyway.\n // This can be somewhat noisy, if you have an array with a single large\n // object, of course. An alternative approach to consider is to do the\n // full simplePrint for Sets, but include the Array index in the array\n // print, so it's at least clear where it deviated.\n printArray(): void {\n if (this.arrayIsEmpty()) {\n this.printArrayEmpty()\n } else {\n this.printArrayBody()\n }\n }\n arrayIsEmpty() {\n return super.arrayIsEmpty() && this.arrayExpectIsEmpty()\n }\n arrayExpectIsEmpty(): boolean {\n const a = this.expectAsArray\n return !!a && a.length === 0\n }\n printArrayEmpty() {\n // nothing to do\n }\n printArrayBody() {\n // we know that they're both arrays if we got this far\n const obj = this.objectAsArray as any[]\n const exp = this.expectAsArray\n // if lengths match, just call printArrayEntry() for each of them\n if (exp && obj.length === exp.length) {\n super.printArrayBody()\n } else {\n this.unmatch()\n }\n if (!this.match) {\n this.memo += this.simplePrint(this.object)\n this.memoExpect = this.memoExpect || ''\n this.memoExpect += this.simplePrintExpect()\n }\n }\n printArrayEntry(key: number, val: any) {\n const child = this.child(val, { key })\n child.print()\n }\n\n printSet() {\n if (this.setIsEmpty()) {\n this.printSetEmpty()\n } else {\n this.printSetBody()\n }\n }\n setExpectIsEmpty() {\n return this.expect.size === 0\n }\n setIsEmpty() {\n return super.setIsEmpty() && this.setExpectIsEmpty()\n }\n printSetBody() {\n if (this.expect.size !== this.object.size) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect = this.memoExpect || ''\n this.memoExpect += this.simplePrintExpect()\n return\n }\n const seen = new Set()\n // skip all identity matches, nothing to do for these\n for (const val of this.object) {\n if (this.expect.has(val)) {\n seen.add(val)\n continue\n }\n }\n for (const val of this.object) {\n if (seen.has(val)) {\n continue\n }\n let sawMatch = false\n for (const exp of this.expect) {\n if (seen.has(exp)) {\n continue\n }\n const s = this.child(val, {\n expect: exp,\n provisional: true,\n })\n s.print()\n if (s.match) {\n sawMatch = true\n seen.add(exp)\n break\n }\n }\n if (!sawMatch) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect = this.memoExpect || ''\n this.memoExpect += this.simplePrintExpect()\n return\n }\n }\n }\n}\n"]}
{"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G,CAAC,GAAG,CAAC,CAAA;oBACb,MAAK;iBACN;aACF;YACD,IAAI,CAAC,QAAQ,EAAE;gBACb,IAAI,CAAC,OAAO,EAAE,CAAA;gBACd,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,EAAE,CAAA;gBACvC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAA;gBAC3C,OAAM;aACP;SACF;IACH,CAAC;CACF","sourcesContent":["import { createTwoFilesPatch } from 'diff'\n\nimport { Format, FormatOptions } from './format.js'\n\nconst arrayFrom = (obj: any) => {\n try {\n return Array.from(obj)\n } catch (_) {\n return null\n }\n}\n\nconst { hasOwnProperty } = Object.prototype\nconst { defineProperty } = Object\n\n/**\n * Options for all comparator operations\n */\nexport interface SameOptions extends FormatOptions {\n /** the pattern to test against */\n expect: any\n parent?: Same\n key?: any\n expectKey?: any\n /**\n * how many lines of context to print around changes in diffs\n * @default 10\n */\n diffContext?: number\n}\n\n/**\n * Base class for all comparators\n *\n * We walk through both of the expect and actual objects,\n * creating a Same node for each field in common, based on\n * their similarity:\n * - true (they're a match) omit from the result (the child node is discarded)\n * - false (they're simply nonmatching) format both expect and object\n * - COMPLEX - walk through child nodes\n * - if match: child node is discarded\n * - else, child node is retained (along with its non-matching children)\n *\n * We 'discard' by just having the print method return ''\n *\n * When walking child nodes, we use the shouldCompare(key) method to determine\n * whether to check a given field. In this class, this is always true (because\n * we are testing for full deep sameness), but in {@link Has} and subclasses,\n * it's more complicated (only test nodes that exist in the expect object).\n */\nexport class Same extends Format {\n provisional: boolean\n expect: any\n parent: Same | null\n simple: boolean | 'COMPLEX' | null = null\n match: boolean = true\n diffContext: number = 10\n memoDiff: string | null = null\n\n memoExpect: string | null = null\n\n constructor(obj: any, options: SameOptions) {\n if (!options || typeof options !== 'object') {\n throw new TypeError('must supply options object')\n }\n if (!('expect' in options)) {\n throw new TypeError('must supply expected value')\n }\n super(obj, options)\n this.parent = options.parent || null\n this.expect = options.expect\n if (!this.style.diffable) {\n throw new Error(\n `\"${options.style}\" style not appropriate for diffs`\n )\n }\n\n if (options.diffContext) {\n this.diffContext = options.diffContext\n }\n this.provisional = !!options.provisional\n this.simpleMatch()\n }\n\n simpleMatch() {\n this.simple = this.test()\n if (this.seen() !== this.seenExpect()) {\n this.simple = false\n }\n if (!this.simple) {\n this.unmatch()\n }\n }\n\n test() {\n const a = this.object\n const b = this.expect\n return typeof a === 'function' && typeof b === 'function'\n ? a === b ||\n (a.name === b.name && a.toString() === b.toString())\n : typeof a === 'symbol' || typeof b === 'symbol'\n ? typeof a === typeof b && a.toString() === b.toString()\n : typeof a !== 'object' && typeof b !== 'object' && a == b\n ? true\n : a === b\n ? true\n : a === null || b === null\n ? a == b\n : a !== a\n ? b !== b\n : typeof a !== 'object' || typeof b !== 'object'\n ? false\n : !this.isError() && b instanceof Error\n ? false\n : this.isError() &&\n ((b.message && b.message !== a.message) ||\n (b.name && b.name !== a.name))\n ? false\n : this.isSet() && !new Format(b).isSet()\n ? false\n : this.isMap() && !new Format(b).isMap()\n ? false\n : this.isArray() && !new Format(b).isArray()\n ? false\n : Buffer.isBuffer(a) && Buffer.isBuffer(b)\n ? a.equals(b)\n : a instanceof Date && b instanceof Date\n ? a.getTime() === b.getTime()\n : a instanceof RegExp && b instanceof RegExp\n ? this.regexpSame(a, b)\n : 'COMPLEX' // might still be a deeper mismatch, of course\n }\n\n regexpSame(a: RegExp, b: RegExp) {\n return (\n a.source === b.source &&\n a.global === b.global &&\n a.multiline === b.multiline &&\n a.lastIndex === b.lastIndex &&\n a.ignoreCase === b.ignoreCase\n )\n }\n\n unmatch() {\n if (this.match) {\n this.match = false\n if (!this.provisional) {\n this.parent && this.parent.unmatch()\n }\n }\n }\n\n // just print the thing as-is\n simplePrint(obj: any, options: FormatOptions = {}) {\n return new Format(obj, {\n ...this.options,\n ...options,\n }).print()\n }\n\n simplePrintExpect() {\n return new Format(this.expect, {\n ...this.options,\n seen: this.seenExpect,\n }).print()\n }\n\n seenExpect() {\n if (!this.expect || typeof this.expect !== 'object') {\n return false\n }\n\n for (let p = this.parent; p; p = p.parent) {\n if (p.expect === this.expect) {\n p.id = p.id || p.getId()\n return p\n }\n }\n return false\n }\n\n // if it's the root, then we do the diff\n // otherwise, we do the dual-walk of both trees,\n // building up the object and expect memos\n // this actually returns '' for any non-root node.\n print(): string {\n if (this.memo === null && this.memoExpect === null) {\n this.memo = ''\n this.memoExpect = ''\n if (!this.simple) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect += this.simplePrintExpect()\n } else {\n const seen = this.seen()\n const seenExpect = this.seenExpect()\n if (this.simple === true && seen === seenExpect) {\n this.memo = ''\n this.memoExpect = ''\n } else {\n if (seen) {\n this.printCircular(this.object)\n } else {\n this.printCollection()\n }\n }\n }\n }\n return this.diff()\n }\n\n printCircular(seen: Format): void {\n this.memo += this.style.circular(seen)\n const seenExpect = this.seenExpect()\n this.memoExpect = this.memoExpect || ''\n if (seenExpect) {\n this.memoExpect += this.style.circular(seenExpect)\n }\n }\n\n diff(): string {\n // impossible\n /* c8 ignore start */\n if (this.memoExpect === null || this.memo === null) {\n throw new TypeError('called diff() prior to print()')\n }\n /* c8 ignore stop */\n\n if (this.parent || this.match || this.memoExpect === this.memo) {\n return (this.memoDiff = '')\n }\n\n if (this.memoDiff !== null) {\n return this.memoDiff\n }\n\n return (this.memoDiff = createTwoFilesPatch(\n 'expected',\n 'actual',\n this.memoExpect + '\\n',\n this.memo + '\\n',\n undefined,\n undefined,\n { context: this.diffContext }\n ).replace(/^\\=+\\n/, ''))\n }\n\n child(\n obj: any,\n options: FormatOptions | SameOptions,\n cls?: typeof Same\n ) {\n const expectKey = hasOwnProperty.call(options, 'expectKey')\n ? (options as SameOptions).expectKey\n : options.key\n return super.child(\n obj,\n {\n expect: this.childExpect(expectKey),\n ...options,\n },\n cls\n )\n }\n\n childExpect(key: any) {\n // if we get here, we know that both expect and actual\n // are collections of the same type. Otherwise they\n // would have gotten the simple printed diff.\n return this.isSet()\n ? key\n : this.isMap()\n ? this.expect.get(key)\n : this.isArray()\n ? (this.expectAsArray as any[])[key]\n : this.expect[key]\n }\n\n get expectAsArray() {\n const value = Array.isArray(this.expect)\n ? this.expect\n : new Format(this.expect).isArray()\n ? arrayFrom(this.expect)\n : /* c8 ignore start */\n null\n /* c8 ignore stop */\n\n defineProperty(this, 'expectAsArray', { value })\n return value\n }\n\n printStart(): void {\n if (!this.parent) {\n this.memo = this.nodeId() + this.memo\n this.memoExpect = this.nodeId() + this.memoExpect\n return\n }\n // we always simple print keys\n /* c8 ignore start */\n const indent = this.isKey ? '' : this.indentLevel()\n /* c8 ignore stop */\n // this will always be keyless, because Array and Set\n // objects are always simple printed. But if that\n // chagnes, this will be relevant.\n /* c8 ignore start */\n const key = this.isKeyless() ? '' : this.getKey()\n /* c8 ignore stop */\n const sep = !key\n ? ''\n : this.parent && this.parent.isMap()\n ? this.style.mapKeyValSep()\n : this.style.pojoKeyValSep()\n const start = this.style.start(indent, key, sep)\n this.memo = start + this.nodeId() + this.memo\n this.memoExpect = start + this.nodeId() + this.memoExpect\n }\n\n printEnd(): void {\n if (!this.parent || this.isKey) {\n return\n }\n const end = this.parent.isMap()\n ? this.style.mapEntrySep()\n : this.parent.isArray()\n ? this.style.arrayEntrySep()\n : // these types are always simple printed\n /* c8 ignore start */\n this.parent.isSet()\n ? this.style.setEntrySep()\n : this.parent.isBuffer()\n ? ''\n : this.parent.isString()\n ? ''\n : /* c8 ignore stop */\n this.style.pojoEntrySep()\n this.memo += end\n this.memoExpect += end\n }\n\n printPojo() {\n // even though it's not a simple mismatch, it's possible that\n // a child entry will cause a mismatch, so we have to print\n // the body *before* doing the head. If we still aren't unmatched\n // after walking the graph, then nothing to do.\n if (this.pojoIsEmpty()) {\n this.memo = this.memo || ''\n this.memo += this.printPojoEmpty()\n } else {\n this.printPojoBody()\n if (!this.match) {\n this.printPojoHead()\n this.printStart()\n this.printPojoTail()\n this.printEnd()\n }\n }\n }\n pojoIsEmpty() {\n return super.pojoIsEmpty() && this.pojoExpectIsEmpty()\n }\n pojoExpectIsEmpty() {\n return super.pojoIsEmpty(this.expect)\n }\n printPojoEmpty() {\n // both are empty and not a simple mismatch, nothing to do\n }\n getPojoKeys(obj: any = this.object): string[] {\n const fromSuper = super.getPojoKeys(obj)\n if (obj === this.expect) {\n return fromSuper\n }\n return fromSuper.concat(\n this.getPojoKeys(this.expect).filter(k => k in obj)\n )\n }\n printPojoHead() {\n const h = this.style.pojoHead(this.getClass())\n\n this.memo = h + this.memo\n this.memoExpect = h + this.memoExpect\n }\n printPojoTail() {\n const t = this.style.pojoTail(this.indentLevel())\n this.memo += t\n this.memoExpect += t\n }\n printPojoBody() {\n const objEnt = new Map(this.getPojoEntries(this.object))\n const expEnt = new Map(this.getPojoEntries(this.expect))\n for (const [key, val] of objEnt.entries()) {\n if (!expEnt.has(key)) {\n this.unmatch()\n }\n this.printPojoEntry(key, val, false)\n }\n for (const key of expEnt.keys()) {\n if (objEnt.has(key)) {\n continue\n }\n this.unmatch()\n this.printPojoEntry(key, undefined, true)\n }\n }\n\n printPojoEntry(key: any, val: any, notFound?: boolean) {\n const child = this.child(val, { key })\n child.print()\n if (!notFound) {\n this.memo += child.memo\n }\n if (notFound || hasOwnProperty.call(this.expect, key)) {\n this.memoExpect += child.memoExpect\n }\n }\n\n // error is just a pojo with some fancy styling\n printError() {\n if (this.errorIsEmpty()) {\n return this.printErrorEmpty()\n } else {\n this.printErrorBody()\n if (!this.match) {\n this.printErrorHead()\n this.printStart()\n this.printErrorTail()\n this.printEnd()\n }\n }\n }\n errorIsEmpty() {\n return super.errorIsEmpty() && this.expectErrorIsEmpty()\n }\n expectErrorIsEmpty() {\n return (\n this.getPojoEntries(this.expect).filter(\n ([k]) => k !== 'name' && k !== 'message'\n ).length === 0\n )\n }\n printErrorEmpty() {\n // nothing to do\n }\n printErrorHead() {\n const headObj = this.style.errorHead(this.object, this.getClass())\n this.memo = headObj + this.memo\n const headExp = this.style.errorHead(this.expect, this.getClass())\n this.memoExpect = headExp + this.memoExpect\n }\n printErrorTail() {\n const t = this.style.errorTail(this.indentLevel())\n this.memo += t\n this.memoExpect += t\n }\n\n // maps are like pojos with fancier keys\n printMap(): void {\n if (this.mapIsEmpty()) {\n this.printMapEmpty()\n } else {\n this.printMapBody()\n if (!this.match) {\n this.printMapHead()\n this.printStart()\n this.printMapTail()\n this.printEnd()\n }\n }\n }\n mapIsEmpty() {\n return super.mapIsEmpty() && this.mapExpectIsEmpty()\n }\n mapExpectIsEmpty() {\n return this.expect.size === 0\n }\n printMapHead() {\n const h = this.style.mapHead(this.getClass())\n this.memo = h + this.memo\n this.memoExpect = h + this.memoExpect\n }\n printMapTail(): void {\n const t = this.style.mapTail(this.indentLevel())\n this.memo += t\n this.memoExpect += t\n }\n printMapBody(): void {\n // new Map([{}:1]) matches another new Map([{}:1])\n // so we can't rely on key identity.\n const seen = new Set()\n // first pass to get any that are key identity matches\n for (const [key, val] of this.object.entries()) {\n if (this.expect.has(key)) {\n seen.add(key)\n this.printMapEntry(key, val)\n continue\n }\n }\n for (const [key, val] of this.object.entries()) {\n if (seen.has(key)) {\n continue\n }\n // try to find a matching key not yet seen\n let sawMatch = false\n for (const expectKey of this.expect.keys()) {\n if (seen.has(expectKey)) {\n continue\n }\n const s = this.child(key, {\n expect: expectKey,\n provisional: true,\n })\n s.print()\n if (s.match) {\n // it's a match! test against this one.\n sawMatch = true\n seen.add(key)\n seen.add(expectKey)\n sawMatch = true\n this.printMapEntry(key, val, expectKey)\n break\n }\n }\n\n if (!sawMatch) {\n this.printMapEntryUnexpected(key, val)\n seen.add(key)\n }\n }\n\n // now loop over all expected values not found in object\n for (const [key, val] of this.expect.entries()) {\n if (seen.has(key)) {\n continue\n }\n this.printMapEntryNotFound(key, val)\n }\n }\n\n printMapEntry(key: any, val: any, expectKey: any = key) {\n const child = this.child(val, { key, expectKey })\n child.print()\n this.memo += child.memo\n this.memoExpect += child.memoExpect\n }\n printMapEntryNotFound(key: any, val: any) {\n this.unmatch()\n this.memoExpect += this.simplePrint(val, {\n parent: this,\n key,\n seen: this.seenExpect,\n })\n }\n printMapEntryUnexpected(key: any, val: any) {\n this.unmatch()\n this.memo += this.simplePrint(val, {\n key,\n parent: this,\n })\n }\n\n // arrays and sets don't have useful keys, so it's really hard to see\n // where the mismatch occurs with only the path context. For example,\n // if you have an array of objects with many keys, that mismatches on\n // only one key in one object, we would get a diff that looks like:\n // [\n // + {key: value},\n // - {key: otherValue},\n // ]\n // which isn't super helpful, since you don't know which index it failed\n // on, or even have the other properties of the object or key path to\n // use to find it.\n // So, if it's not a match, we simplePrint both the expected and object,\n // and let the diff sort it out, since it does a pretty good job of that\n // anyway.\n // This can be somewhat noisy, if you have an array with a single large\n // object, of course. An alternative approach to consider is to do the\n // full simplePrint for Sets, but include the Array index in the array\n // print, so it's at least clear where it deviated.\n printArray(): void {\n if (this.arrayIsEmpty()) {\n this.printArrayEmpty()\n } else {\n this.printArrayBody()\n }\n }\n arrayIsEmpty() {\n return super.arrayIsEmpty() && this.arrayExpectIsEmpty()\n }\n arrayExpectIsEmpty(): boolean {\n const a = this.expectAsArray\n return !!a && a.length === 0\n }\n printArrayEmpty() {\n // nothing to do\n }\n printArrayBody() {\n // we know that they're both arrays if we got this far\n const obj = this.objectAsArray as any[]\n const exp = this.expectAsArray\n // if lengths match, just call printArrayEntry() for each of them\n if (exp && obj.length === exp.length) {\n super.printArrayBody()\n } else {\n this.unmatch()\n }\n if (!this.match) {\n this.memo += this.simplePrint(this.object)\n this.memoExpect = this.memoExpect || ''\n this.memoExpect += this.simplePrintExpect()\n }\n }\n printArrayEntry(key: number, val: any) {\n const child = this.child(val, { key })\n child.print()\n }\n\n printSet() {\n if (this.setIsEmpty()) {\n this.printSetEmpty()\n } else {\n this.printSetBody()\n }\n }\n setExpectIsEmpty() {\n return this.expect.size === 0\n }\n setIsEmpty() {\n return super.setIsEmpty() && this.setExpectIsEmpty()\n }\n printSetBody() {\n if (this.expect.size !== this.object.size) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect = this.memoExpect || ''\n this.memoExpect += this.simplePrintExpect()\n return\n }\n const seen = new Set()\n // skip all identity matches, nothing to do for these\n for (const val of this.object) {\n if (this.expect.has(val)) {\n seen.add(val)\n continue\n }\n }\n for (const val of this.object) {\n if (seen.has(val)) {\n continue\n }\n let sawMatch = false\n for (const exp of this.expect) {\n if (seen.has(exp)) {\n continue\n }\n const s = this.child(val, {\n expect: exp,\n provisional: true,\n })\n s.print()\n if (s.match) {\n sawMatch = true\n seen.add(exp)\n break\n }\n }\n if (!sawMatch) {\n this.unmatch()\n this.memo += this.simplePrint(this.object)\n this.memoExpect = this.memoExpect || ''\n this.memoExpect += this.simplePrintExpect()\n return\n }\n }\n }\n}\n"]}
import { Same } from './same.js';
/**
* The same as {@link Same}, but without type coercion
*/
export declare class Strict extends Same {

@@ -3,0 +6,0 @@ test(): boolean | "COMPLEX";

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

{"version":3,"file":"strict.d.ts","sourceRoot":"","sources":["../../src/strict.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,qBAAa,MAAO,SAAQ,IAAI;IAC9B,IAAI;CA6BL"}
{"version":3,"file":"strict.d.ts","sourceRoot":"","sources":["../../src/strict.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC;;GAEG;AACH,qBAAa,MAAO,SAAQ,IAAI;IAC9B,IAAI;CA6BL"}
import { Format } from './format.js';
import { Same } from './same.js';
/**
* The same as {@link Same}, but without type coercion
*/
export class Strict extends Same {

@@ -4,0 +7,0 @@ test() {

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

{"version":3,"file":"strict.js","sourceRoot":"","sources":["../../src/strict.ts"],"names":[],"mappings":"AAAA,OAAO,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C1C;4CACH,CAAC,CAAC,KAAK;4CACP,CAAC,CAAC,SAAS,CAAA;IACf,CAAC;CACF","sourcesContent":["import { Format } from './format.js'\nimport { Same } from './same.js'\nexport class Strict extends Same {\n test() {\n const a = this.object\n const b = this.expect\n const st = super.test()\n return st === false\n ? false\n : a === b\n ? true\n : a !== a\n ? b !== b\n : typeof a !== 'object' || typeof b !== 'object'\n ? false\n : Buffer.isBuffer(a) && Buffer.isBuffer(b)\n ? st\n : a instanceof Date && b instanceof Date\n ? st\n : a instanceof RegExp && b instanceof RegExp\n ? st\n : this.isArguments() && !new Format(b).isArguments()\n ? false\n : a.constructor !== b.constructor &&\n !(\n Array.isArray(b) &&\n Array.isArray(b) &&\n a.constructor.name === b.constructor.name\n )\n ? false\n : 'COMPLEX'\n }\n}\n"]}
{"version":3,"file":"strict.js","sourceRoot":"","sources":["../../src/strict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,IAAI;IAC9B,IAAI;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;QACrB,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;QACrB,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;QACvB,OAAO,EAAE,KAAK,KAAK;YACjB,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,CAAC,KAAK,CAAC;gBACT,CAAC,CAAC,IAAI;gBACN,CAAC,CAAC,CAAC,KAAK,CAAC;oBACT,CAAC,CAAC,CAAC,KAAK,CAAC;oBACT,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ;wBAChD,CAAC,CAAC,KAAK;wBACP,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;4BAC1C,CAAC,CAAC,EAAE;4BACJ,CAAC,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,IAAI;gCACxC,CAAC,CAAC,EAAE;gCACJ,CAAC,CAAC,CAAC,YAAY,MAAM,IAAI,CAAC,YAAY,MAAM;oCAC5C,CAAC,CAAC,EAAE;oCACJ,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;wCACpD,CAAC,CAAC,KAAK;wCACP,CAAC,CAAC,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW;4CAC/B,CAAC,CACC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gDAChB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gDAChB,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,CAAC,IAAI,CAC1C;4CACH,CAAC,CAAC,KAAK;4CACP,CAAC,CAAC,SAAS,CAAA;IACf,CAAC;CACF","sourcesContent":["import { Format } from './format.js'\nimport { Same } from './same.js'\n/**\n * The same as {@link Same}, but without type coercion\n */\nexport class Strict extends Same {\n test() {\n const a = this.object\n const b = this.expect\n const st = super.test()\n return st === false\n ? false\n : a === b\n ? true\n : a !== a\n ? b !== b\n : typeof a !== 'object' || typeof b !== 'object'\n ? false\n : Buffer.isBuffer(a) && Buffer.isBuffer(b)\n ? st\n : a instanceof Date && b instanceof Date\n ? st\n : a instanceof RegExp && b instanceof RegExp\n ? st\n : this.isArguments() && !new Format(b).isArguments()\n ? false\n : a.constructor !== b.constructor &&\n !(\n Array.isArray(b) &&\n Array.isArray(b) &&\n a.constructor.name === b.constructor.name\n )\n ? false\n : 'COMPLEX'\n }\n}\n"]}

@@ -1,18 +0,38 @@

/// <reference types="node" />
/// <reference types="node" resolution-mode="require"/>
import type { Format } from './format.js';
export type StyleType = 'pretty' | 'js' | 'tight';
/**
* A set of functions defining how various sorts of things get converted
* into strings.
*/
export interface Style {
/** a function, optionally with a class name */
fn: (fn: Function, cls: string) => string;
/** an empty `Set` */
setEmpty: (cls: string) => string;
/** start of a `Set` */
setHead: (cls: string) => string;
/** end of a `Set` */
setTail: (indent: string) => string;
/** separator between entries in a `Set` */
setEntrySep: () => string;
/** an empty `Map` */
mapEmpty: (cls: string) => string;
/** start of a `Map` */
mapHead: (cls: string) => string;
/** end of a `Map` */
mapTail: (indent: string) => string;
/** start of a key in a `Map` */
mapKeyStart: () => string;
/** separator between key and value in a `Map` */
mapKeyValSep: () => string;
/** separator between entries in a `Map` */
mapEntrySep: () => string;
/** what to print when we encounter a circular reference */
circular: (node: Format) => string;
/** how to print node identifiers for circular references */
nodeId: (id: number) => string;
/** an empty `Error` object */
errorEmpty: (er: Error, cls: string) => string;
/** start of an `Error` object */
errorHead: (er: (Error | {

@@ -24,35 +44,67 @@ name?: string;

}, cls: string) => string;
/** end of an `Error` object */
errorTail: (indent: string) => string;
/** empty JavaScript object */
pojoEmpty: (cls: string) => string;
/** start of a JavaScript object */
pojoHead: (cls: string) => string;
/** end of a JavaScript object */
pojoTail: (indent: string) => string;
/** separator between key and value in a JavaScript object */
pojoKeyValSep: () => string;
/** separator between entries in a JavaScript object */
pojoEntrySep: () => string;
/** an empty `Array` */
arrayEmpty: (cls: string) => string;
/** start of an `Array` */
arrayHead: (cls: string) => string;
/** end of an `Array` */
arrayTail: (indent: string) => string;
/** separator between entries in an `Array` */
arrayEntrySep: () => string;
/**
* how many bytes of a `Buffer` to show per line. can be overridden by
* the Format constructor options.
* */
bufferChunkSize: number;
/** an empty `Buffer` */
bufferEmpty: () => string;
/** start of a short `Buffer` */
bufferStart: () => string;
/** contents of a short `Buffer` */
bufferBody: (buf: Buffer) => string;
/** end of a short `Buffer` */
bufferEnd: (buf: Buffer) => string;
/** start of a long `Buffer` */
bufferHead: () => string;
/** line numbers to print for lines in a long `Buffer` */
bufferKey: (i: number) => string;
/** line of bytes in a long `Buffer` */
bufferLine: (buf: Buffer, chunkSize: number) => string;
/** separator between lines in a long `Buffer` */
bufferLineSep: () => string;
/** end of a long `Buffer` */
bufferTail: (indent: string) => string;
/** separator between line number and contents of a long `Buffer` */
bufferKeySep: () => string;
/** an empty string */
stringEmpty: () => string;
/** a string that fits on one line */
stringOneLine: (str: string) => string;
/** start of a long string */
stringHead: () => string;
/** separator between lines of a long string */
stringLineSep: () => string;
/** each line of a long string */
stringLine: (str: string) => string;
/** end of a long string */
stringTail: (indent: string) => string;
/** indicator as to whether this style is suitable for use in diffs */
diffable: boolean;
/** beginning of a thing being printed */
start: (indent: string, key: string, sep: string) => string;
}
export declare const styles: {
[style: string]: Style;
[style in StyleType]: Style;
};
//# sourceMappingURL=styles.d.ts.map

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

{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/styles.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAQzC,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACzC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACjC,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IAChC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;IACnC,WAAW,EAAE,MAAM,MAAM,CAAA;IACzB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACjC,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IAChC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;IACnC,WAAW,EAAE,MAAM,MAAM,CAAA;IACzB,YAAY,EAAE,MAAM,MAAM,CAAA;IAC1B,WAAW,EAAE,MAAM,MAAM,CAAA;IACzB,QAAQ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M,MAAM,CAAA;IACzB,qCAAqC;IACrC,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACtC,6BAA6B;IAC7B,UAAU,EAAE,MAAM,MAAM,CAAA;IACxB,+CAA+C;IAC/C,aAAa,EAAE,MAAM,MAAM,CAAA;IAC3B,iCAAiC;IACjC,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACnC,2BAA2B;IAC3B,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;IAEtC,sEAAsE;IACtE,QAAQ,EAAE,OAAO,CAAA;IACjB,yCAAyC;IACzC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;CAC5D;AAsOD,eAAO,MAAM,MAAM,EAAE;KAAG,KAAK,IAAI,SAAS,GAAG,KAAK;CAIjD,CAAA"}

@@ -5,4 +5,7 @@ // can't use buf.toString('ascii') because that unmasks high bytes

.toString();
export const styles = {};
styles.pretty = {
/**
* The default style, suitable for diffs, and optimized for human
* readability.
*/
const pretty = {
fn: (fn, cls) => {

@@ -92,3 +95,11 @@ const name = fn.name;

};
styles.js = {
/**
* A style that can (mostly) be copy-pasted into a JS program
* and used as-is.
*
* Of course, object and function identities won't really work,
* and if there are circular references, then the results won't
* be valid JavaScript.
*/
const js = {
fn: (fn, _) => fn.toString(),

@@ -143,5 +154,8 @@ setEmpty: cls => `new ${cls}()`,

};
// this one won't work for diffs
// same as the js style, but no indentation or \n
styles.tight = {
/**
* same as the {@link js} style, but no indentation or \n
*
* Not suitable for diffs, as everything is printed on one line.
*/
const tight = {
fn: (fn, _) => fn.toString(),

@@ -185,11 +199,16 @@ setEmpty: cls => `new ${cls}()`,

stringTail: _ => '',
bufferHead: styles.js.bufferHead,
bufferKey: styles.js.bufferKey,
bufferLine: styles.js.bufferLine,
bufferLineSep: styles.js.bufferLineSep,
bufferTail: styles.js.bufferTail,
bufferKeySep: styles.js.bufferKeySep,
bufferHead: js.bufferHead,
bufferKey: js.bufferKey,
bufferLine: js.bufferLine,
bufferLineSep: js.bufferLineSep,
bufferTail: js.bufferTail,
bufferKeySep: js.bufferKeySep,
diffable: false,
start: (_indent, key, sep) => `${key}${sep}`,
};
export const styles = {
pretty,
js,
tight,
};
//# sourceMappingURL=styles.js.map

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

{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/styles.ts"],"names":[],"mappings":"AAEA,kEAAkE;AAClE,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE,CACjC,GAAG;KACA,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC1D,QAAQ,EAAE,CAAA;AA8Df,MAAM,CAAC,MAAM,MAAM,GAA+B,EAAE,CAAA;AAEpD,MAAM,CAAC,MAAM,GAAG;IACd,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE;QACd,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAA;QACpB,MAAM,IAAI,GAAG,EAAE;aACZ,QAAQ,EAAE;aACV,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;aACb,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACd,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;aAC3B,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;aAC1B,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;aACtB,KAAK,CAAC,GAAG,CAAC;aACV,IAAI,CAAC,IAAI,CAAC;aACV,IAAI,EAAE,CAAA;QACT,OAAO,GAAG,GAAG,IAAI,IAAI,IAAI,EAAE,IAAI,IAAI,GAAG,CAAA;IACxC,CAAC;IAC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AC,SAAS,CAAC,GAAG,CAAC;IACtC,aAAa,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;IACzC,UAAU,EAAE,GAAG,EAAE,CAAC,EAAE;IACpB,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;IACnB,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC,UAAU;IAChC,SAAS,EAAE,MAAM,CAAC,EAAE,CAAC,SAAS;IAC9B,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC,UAAU;IAChC,aAAa,EAAE,MAAM,CAAC,EAAE,CAAC,aAAa;IACtC,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC,UAAU;IAChC,YAAY,EAAE,MAAM,CAAC,EAAE,CAAC,YAAY;IACpC,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,GAAG,EAAE;CAC7C,CAAA","sourcesContent":["import type { Format } from './format.js'\n\n// can't use buf.toString('ascii') because that unmasks high bytes\nconst bufToAscii = (buf: Buffer) =>\n buf\n .map(c => (c <= 0x20 || c >= 0x7f ? '.'.charCodeAt(0) : c))\n .toString()\n\nexport interface Style {\n fn: (fn: Function, cls: string) => string\n setEmpty: (cls: string) => string\n setHead: (cls: string) => string\n setTail: (indent: string) => string\n setEntrySep: () => string\n mapEmpty: (cls: string) => string\n mapHead: (cls: string) => string\n mapTail: (indent: string) => string\n mapKeyStart: () => string\n mapKeyValSep: () => string\n mapEntrySep: () => string\n circular: (node: Format) => string\n nodeId: (id: number) => string\n errorEmpty: (er: Error, cls: string) => string\n errorHead: (\n er: (Error | { name?: string; message?: string }) & {\n generatedMessage?: string\n },\n cls: string\n ) => string\n errorTail: (indent: string) => string\n pojoEmpty: (cls: string) => string\n pojoHead: (cls: string) => string\n pojoTail: (indent: string) => string\n pojoKeyValSep: () => string\n pojoEntrySep: () => string\n arrayEmpty: (cls: string) => string\n arrayHead: (cls: string) => string\n arrayTail: (indent: string) => string\n arrayEntrySep: () => string\n\n bufferChunkSize: number\n bufferEmpty: () => string\n bufferStart: () => string\n bufferBody: (buf: Buffer) => string\n bufferEnd: (buf: Buffer) => string\n\n bufferHead: () => string\n\n // show line numbers as offset 0x0000 through 0xffff as zero-padded hex\n // this will wrap around if you have more than 64kb buffer, but that's\n // (a) highly unusual for the use cases tcompare works in, and (b) fine.\n bufferKey: (i: number) => string\n bufferLine: (buf: Buffer, chunkSize: number) => string\n bufferLineSep: () => string\n bufferTail: (indent: string) => string\n bufferKeySep: () => string\n\n stringEmpty: () => string\n stringOneLine: (str: string) => string\n stringHead: () => string\n stringLineSep: () => string\n stringLine: (str: string) => string\n stringTail: (indent: string) => string\n\n diffable: boolean\n start: (indent: string, key: string, sep: string) => string\n}\n\nexport const styles: { [style: string]: Style } = {}\n\nstyles.pretty = {\n fn: (fn, cls) => {\n const name = fn.name\n const args = fn\n .toString()\n .split('{')[0]\n .split('=>')[0]\n .replace(/[\\n\\r\\s\\t]+/g, '')\n .replace(/^[^\\(]*\\( */, '')\n .replace(/ *\\).*/g, '')\n .split(',')\n .join(', ')\n .trim()\n return `${cls} ${name || ''}(${args})`\n },\n setEmpty: cls => `${cls} \\{\\}`,\n setHead: cls => `${cls} \\{\\n`,\n setTail: indent => `${indent}}`,\n setEntrySep: () => ',\\n',\n mapEmpty: cls => `${cls} \\{\\}`,\n mapHead: cls => `${cls} \\{\\n`,\n mapTail: indent => `${indent}}`,\n mapKeyStart: () => '',\n mapKeyValSep: () => ' => ',\n mapEntrySep: () => ',\\n',\n circular: node => `<*ref_${node.id}>`,\n nodeId: id => `&ref_${id} `,\n errorEmpty: er =>\n !(er instanceof Error)\n ? `${(er as Error).name || '(no name)'}: ${\n (er as Error).message || '(no message)'\n }`\n : `${er.toString()}`,\n errorHead: (er, cls) => {\n // assertion errors sometimes generate WACKY stuff\n return cls === 'AssertionError' && er.generatedMessage\n ? er.name + ' {\\n'\n : !(er instanceof Error)\n ? `${(er as Error).name || '(no name)'}: ${\n (er as Error).message || '(no message)'\n } \\{\\n`\n : `${er.toString()} \\{\\n`\n },\n errorTail: indent => `${indent}}`,\n pojoEmpty: cls => `${cls} \\{\\}`,\n pojoHead: cls => `${cls} \\{\\n`,\n pojoTail: indent => `${indent}}`,\n pojoKeyValSep: () => ': ',\n pojoEntrySep: () => ',\\n',\n arrayEmpty: cls => `${cls} []`,\n arrayHead: cls => `${cls} [\\n`,\n arrayTail: indent => `${indent}]`,\n arrayEntrySep: () => ',\\n',\n\n bufferChunkSize: 32,\n bufferEmpty: () => 'Buffer <>',\n bufferStart: () => 'Buffer <',\n bufferBody: buf =>\n buf\n .toString('hex')\n .replace(/(....)/g, '$1 ')\n .trim(),\n bufferEnd: buf => ' ' + bufToAscii(buf) + '>',\n\n bufferHead: () => 'Buffer <\\n',\n\n // show line numbers as offset 0x0000 through 0xffff as zero-padded hex\n // this will wrap around if you have more than 64kb buffer, but that's\n // (a) highly unusual for the use cases tcompare works in, and (b) fine.\n bufferKey: i => (i + 0x10000).toString(16).slice(-4),\n bufferLine: (buf, chunkSize) => {\n const hex = buf\n .toString('hex')\n .replace(/(....)/g, '$1 ')\n .trim()\n // double for hex, then add 25% for the spaces between every 4 hexits\n const l = Math.ceil(chunkSize * 2 * 1.25)\n const pad = ' '.repeat(l - hex.length + 1)\n return hex + pad + bufToAscii(buf)\n },\n bufferLineSep: () => '\\n',\n bufferTail: indent => `\\n${indent}>`,\n bufferKeySep: () => ': ',\n\n stringEmpty: () => '\"\"',\n stringOneLine: str => JSON.stringify(str),\n stringHead: () => 'String(\\n',\n stringLineSep: () => '\\n',\n stringLine: str =>\n JSON.stringify(str.replace(/\\n$/, ''))\n .slice(1, -1)\n .replace(/\\\\\"/g, '\"'),\n stringTail: indent => `\\n${indent})`,\n diffable: true,\n start: (indent, key, sep) => `${indent}${key}${sep}`,\n}\n\nstyles.js = {\n fn: (fn, _) => fn.toString(),\n setEmpty: cls => `new ${cls}()`,\n setHead: cls => `new ${cls}([\\n`,\n setTail: indent => `${indent}])`,\n setEntrySep: () => ',\\n',\n mapEmpty: cls => `new ${cls}()`,\n mapHead: cls => `new ${cls}([\\n`,\n mapTail: indent => `${indent}])`,\n mapKeyStart: () => '[',\n mapKeyValSep: () => ', ',\n mapEntrySep: () => '],\\n',\n circular: node => `*ref_${node.id}`,\n nodeId: id => `&ref_${id} `,\n errorEmpty: (er, cls) =>\n `new ${cls}(${er.message ? JSON.stringify(er.message) : ''})`,\n errorHead: (er, cls) =>\n `Object.assign(new ${cls}(${\n er.message ? JSON.stringify(er.message) : ''\n }), {\\n`,\n errorTail: indent => `${indent}})`,\n pojoEmpty: _ => '{}',\n pojoHead: _ => `\\{\\n`,\n pojoTail: indent => `${indent}}`,\n pojoKeyValSep: () => ': ',\n pojoEntrySep: () => ',\\n',\n arrayEmpty: _ => `[]`,\n arrayHead: _ => `[\\n`,\n arrayTail: indent => `${indent}]`,\n arrayEntrySep: () => ',\\n',\n\n bufferChunkSize: 32,\n bufferEmpty: () => 'Buffer.alloc(0)',\n bufferStart: () => 'Buffer.from(\"',\n bufferBody: buf => buf.toString('hex'),\n bufferEnd: buf => '\", \"hex\") /* ' + bufToAscii(buf) + ' */',\n\n bufferHead: () => 'Buffer.from(\\n',\n bufferKey: () => '',\n bufferLine: (buf, chunkSize) =>\n JSON.stringify(buf.toString('hex')) +\n ' '.repeat((chunkSize + 1) * 2 - buf.length * 2) +\n '/* ' +\n bufToAscii(buf) +\n ' */',\n bufferTail: indent => `\\n${indent}, \"hex\")`,\n bufferLineSep: () => ' +\\n',\n bufferKeySep: () => '',\n\n stringEmpty: () => '\"\"',\n stringLineSep: () => ' +\\n',\n stringLine: str => JSON.stringify(str),\n stringOneLine: str => JSON.stringify(str),\n stringHead: () => 'String(\\n',\n stringTail: indent => `\\n${indent})`,\n diffable: true,\n start: (indent, key, sep) => `${indent}${key}${sep}`,\n}\n\n// this one won't work for diffs\n// same as the js style, but no indentation or \\n\nstyles.tight = {\n fn: (fn, _) => fn.toString(),\n setEmpty: cls => `new ${cls}()`,\n setHead: cls => `new ${cls}([`,\n setTail: _ => '])',\n setEntrySep: () => ',',\n mapEmpty: cls => `new ${cls}()`,\n mapHead: cls => `new ${cls}([`,\n mapTail: _ => '])',\n mapKeyStart: () => '[',\n mapKeyValSep: () => ',',\n mapEntrySep: () => '],',\n circular: node => `*${node.id}`,\n nodeId: id => `&${id} `,\n errorEmpty: (er, cls) =>\n `new ${cls}(${JSON.stringify(er.message)})`,\n errorHead: (er, cls) =>\n `Object.assign(new ${cls}(${\n er.message ? JSON.stringify(er.message) : ''\n }), {`,\n errorTail: _ => '})',\n pojoEmpty: _ => '{}',\n pojoHead: _ => `\\{`,\n pojoTail: _ => '}',\n pojoKeyValSep: () => ':',\n pojoEntrySep: () => ',',\n arrayEmpty: _ => `[]`,\n arrayHead: _ => `[`,\n arrayTail: () => ']',\n arrayEntrySep: () => ',',\n\n // tight style doesn't need buffer head/tail/body, because it's\n // always printed as one base64 line.\n bufferChunkSize: Infinity,\n bufferEmpty: () => 'Buffer.alloc(0)',\n bufferStart: () => 'Buffer.from(\"',\n bufferBody: buf => buf.toString('base64'),\n bufferEnd: () => '\",\"base64\")',\n\n stringEmpty: () => '\"\"',\n stringLineSep: () => '+',\n stringLine: str => JSON.stringify(str),\n stringOneLine: str => JSON.stringify(str),\n stringHead: () => '',\n stringTail: _ => '',\n bufferHead: styles.js.bufferHead,\n bufferKey: styles.js.bufferKey,\n bufferLine: styles.js.bufferLine,\n bufferLineSep: styles.js.bufferLineSep,\n bufferTail: styles.js.bufferTail,\n bufferKeySep: styles.js.bufferKeySep,\n diffable: false,\n start: (_indent, key, sep) => `${key}${sep}`,\n}\n"]}
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/styles.ts"],"names":[],"mappings":"AAEA,kEAAkE;AAClE,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE,CACjC,GAAG;KACA,GAAG,CAAC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AAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,GAAG,EAAE;CAC7C,CAAA;AAED,MAAM,CAAC,MAAM,MAAM,GAAoC;IACrD,MAAM;IACN,EAAE;IACF,KAAK;CACN,CAAA","sourcesContent":["import type { Format } from './format.js'\n\n// can't use buf.toString('ascii') because that unmasks high bytes\nconst bufToAscii = (buf: Buffer) =>\n buf\n .map(c => (c <= 0x20 || c >= 0x7f ? '.'.charCodeAt(0) : c))\n .toString()\n\nexport type StyleType = 'pretty' | 'js' | 'tight'\n\n/**\n * A set of functions defining how various sorts of things get converted\n * into strings.\n */\nexport interface Style {\n /** a function, optionally with a class name */\n fn: (fn: Function, cls: string) => string\n /** an empty `Set` */\n setEmpty: (cls: string) => string\n /** start of a `Set` */\n setHead: (cls: string) => string\n /** end of a `Set` */\n setTail: (indent: string) => string\n /** separator between entries in a `Set` */\n setEntrySep: () => string\n /** an empty `Map` */\n mapEmpty: (cls: string) => string\n /** start of a `Map` */\n mapHead: (cls: string) => string\n /** end of a `Map` */\n mapTail: (indent: string) => string\n /** start of a key in a `Map` */\n mapKeyStart: () => string\n /** separator between key and value in a `Map` */\n mapKeyValSep: () => string\n /** separator between entries in a `Map` */\n mapEntrySep: () => string\n /** what to print when we encounter a circular reference */\n circular: (node: Format) => string\n /** how to print node identifiers for circular references */\n nodeId: (id: number) => string\n /** an empty `Error` object */\n errorEmpty: (er: Error, cls: string) => string\n /** start of an `Error` object */\n errorHead: (\n er: (Error | { name?: string; message?: string }) & {\n generatedMessage?: string\n },\n cls: string\n ) => string\n /** end of an `Error` object */\n errorTail: (indent: string) => string\n /** empty JavaScript object */\n pojoEmpty: (cls: string) => string\n /** start of a JavaScript object */\n pojoHead: (cls: string) => string\n /** end of a JavaScript object */\n pojoTail: (indent: string) => string\n /** separator between key and value in a JavaScript object */\n pojoKeyValSep: () => string\n /** separator between entries in a JavaScript object */\n pojoEntrySep: () => string\n /** an empty `Array` */\n arrayEmpty: (cls: string) => string\n /** start of an `Array` */\n arrayHead: (cls: string) => string\n /** end of an `Array` */\n arrayTail: (indent: string) => string\n /** separator between entries in an `Array` */\n arrayEntrySep: () => string\n\n /**\n * how many bytes of a `Buffer` to show per line. can be overridden by\n * the Format constructor options.\n * */\n bufferChunkSize: number\n /** an empty `Buffer` */\n bufferEmpty: () => string\n /** start of a short `Buffer` */\n bufferStart: () => string\n /** contents of a short `Buffer` */\n bufferBody: (buf: Buffer) => string\n /** end of a short `Buffer` */\n bufferEnd: (buf: Buffer) => string\n\n /** start of a long `Buffer` */\n bufferHead: () => string\n\n // show line numbers as offset 0x0000 through 0xffff as zero-padded hex\n // this will wrap around if you have more than 64kb buffer, but that's\n // (a) highly unusual for the use cases tcompare works in, and (b) fine.\n /** line numbers to print for lines in a long `Buffer` */\n bufferKey: (i: number) => string\n /** line of bytes in a long `Buffer` */\n bufferLine: (buf: Buffer, chunkSize: number) => string\n /** separator between lines in a long `Buffer` */\n bufferLineSep: () => string\n /** end of a long `Buffer` */\n bufferTail: (indent: string) => string\n /** separator between line number and contents of a long `Buffer` */\n bufferKeySep: () => string\n\n /** an empty string */\n stringEmpty: () => string\n /** a string that fits on one line */\n stringOneLine: (str: string) => string\n /** start of a long string */\n stringHead: () => string\n /** separator between lines of a long string */\n stringLineSep: () => string\n /** each line of a long string */\n stringLine: (str: string) => string\n /** end of a long string */\n stringTail: (indent: string) => string\n\n /** indicator as to whether this style is suitable for use in diffs */\n diffable: boolean\n /** beginning of a thing being printed */\n start: (indent: string, key: string, sep: string) => string\n}\n\n/**\n * The default style, suitable for diffs, and optimized for human\n * readability.\n */\nconst pretty: Style = {\n fn: (fn, cls) => {\n const name = fn.name\n const args = fn\n .toString()\n .split('{')[0]\n .split('=>')[0]\n .replace(/[\\n\\r\\s\\t]+/g, '')\n .replace(/^[^\\(]*\\( */, '')\n .replace(/ *\\).*/g, '')\n .split(',')\n .join(', ')\n .trim()\n return `${cls} ${name || ''}(${args})`\n },\n setEmpty: cls => `${cls} \\{\\}`,\n setHead: cls => `${cls} \\{\\n`,\n setTail: indent => `${indent}}`,\n setEntrySep: () => ',\\n',\n mapEmpty: cls => `${cls} \\{\\}`,\n mapHead: cls => `${cls} \\{\\n`,\n mapTail: indent => `${indent}}`,\n mapKeyStart: () => '',\n mapKeyValSep: () => ' => ',\n mapEntrySep: () => ',\\n',\n circular: node => `<*ref_${node.id}>`,\n nodeId: id => `&ref_${id} `,\n errorEmpty: er =>\n !(er instanceof Error)\n ? `${(er as Error).name || '(no name)'}: ${\n (er as Error).message || '(no message)'\n }`\n : `${er.toString()}`,\n errorHead: (er, cls) => {\n // assertion errors sometimes generate WACKY stuff\n return cls === 'AssertionError' && er.generatedMessage\n ? er.name + ' {\\n'\n : !(er instanceof Error)\n ? `${(er as Error).name || '(no name)'}: ${\n (er as Error).message || '(no message)'\n } \\{\\n`\n : `${er.toString()} \\{\\n`\n },\n errorTail: indent => `${indent}}`,\n pojoEmpty: cls => `${cls} \\{\\}`,\n pojoHead: cls => `${cls} \\{\\n`,\n pojoTail: indent => `${indent}}`,\n pojoKeyValSep: () => ': ',\n pojoEntrySep: () => ',\\n',\n arrayEmpty: cls => `${cls} []`,\n arrayHead: cls => `${cls} [\\n`,\n arrayTail: indent => `${indent}]`,\n arrayEntrySep: () => ',\\n',\n\n bufferChunkSize: 32,\n bufferEmpty: () => 'Buffer <>',\n bufferStart: () => 'Buffer <',\n bufferBody: buf =>\n buf\n .toString('hex')\n .replace(/(....)/g, '$1 ')\n .trim(),\n bufferEnd: buf => ' ' + bufToAscii(buf) + '>',\n\n bufferHead: () => 'Buffer <\\n',\n\n // show line numbers as offset 0x0000 through 0xffff as zero-padded hex\n // this will wrap around if you have more than 64kb buffer, but that's\n // (a) highly unusual for the use cases tcompare works in, and (b) fine.\n bufferKey: i => (i + 0x10000).toString(16).slice(-4),\n bufferLine: (buf, chunkSize) => {\n const hex = buf\n .toString('hex')\n .replace(/(....)/g, '$1 ')\n .trim()\n // double for hex, then add 25% for the spaces between every 4 hexits\n const l = Math.ceil(chunkSize * 2 * 1.25)\n const pad = ' '.repeat(l - hex.length + 1)\n return hex + pad + bufToAscii(buf)\n },\n bufferLineSep: () => '\\n',\n bufferTail: indent => `\\n${indent}>`,\n bufferKeySep: () => ': ',\n\n stringEmpty: () => '\"\"',\n stringOneLine: str => JSON.stringify(str),\n stringHead: () => 'String(\\n',\n stringLineSep: () => '\\n',\n stringLine: str =>\n JSON.stringify(str.replace(/\\n$/, ''))\n .slice(1, -1)\n .replace(/\\\\\"/g, '\"'),\n stringTail: indent => `\\n${indent})`,\n diffable: true,\n start: (indent, key, sep) => `${indent}${key}${sep}`,\n}\n\n/**\n * A style that can (mostly) be copy-pasted into a JS program\n * and used as-is.\n *\n * Of course, object and function identities won't really work,\n * and if there are circular references, then the results won't\n * be valid JavaScript.\n */\nconst js: Style = {\n fn: (fn, _) => fn.toString(),\n setEmpty: cls => `new ${cls}()`,\n setHead: cls => `new ${cls}([\\n`,\n setTail: indent => `${indent}])`,\n setEntrySep: () => ',\\n',\n mapEmpty: cls => `new ${cls}()`,\n mapHead: cls => `new ${cls}([\\n`,\n mapTail: indent => `${indent}])`,\n mapKeyStart: () => '[',\n mapKeyValSep: () => ', ',\n mapEntrySep: () => '],\\n',\n circular: node => `*ref_${node.id}`,\n nodeId: id => `&ref_${id} `,\n errorEmpty: (er, cls) =>\n `new ${cls}(${er.message ? JSON.stringify(er.message) : ''})`,\n errorHead: (er, cls) =>\n `Object.assign(new ${cls}(${\n er.message ? JSON.stringify(er.message) : ''\n }), {\\n`,\n errorTail: indent => `${indent}})`,\n pojoEmpty: _ => '{}',\n pojoHead: _ => `\\{\\n`,\n pojoTail: indent => `${indent}}`,\n pojoKeyValSep: () => ': ',\n pojoEntrySep: () => ',\\n',\n arrayEmpty: _ => `[]`,\n arrayHead: _ => `[\\n`,\n arrayTail: indent => `${indent}]`,\n arrayEntrySep: () => ',\\n',\n\n bufferChunkSize: 32,\n bufferEmpty: () => 'Buffer.alloc(0)',\n bufferStart: () => 'Buffer.from(\"',\n bufferBody: buf => buf.toString('hex'),\n bufferEnd: buf => '\", \"hex\") /* ' + bufToAscii(buf) + ' */',\n\n bufferHead: () => 'Buffer.from(\\n',\n bufferKey: () => '',\n bufferLine: (buf, chunkSize) =>\n JSON.stringify(buf.toString('hex')) +\n ' '.repeat((chunkSize + 1) * 2 - buf.length * 2) +\n '/* ' +\n bufToAscii(buf) +\n ' */',\n bufferTail: indent => `\\n${indent}, \"hex\")`,\n bufferLineSep: () => ' +\\n',\n bufferKeySep: () => '',\n\n stringEmpty: () => '\"\"',\n stringLineSep: () => ' +\\n',\n stringLine: str => JSON.stringify(str),\n stringOneLine: str => JSON.stringify(str),\n stringHead: () => 'String(\\n',\n stringTail: indent => `\\n${indent})`,\n diffable: true,\n start: (indent, key, sep) => `${indent}${key}${sep}`,\n}\n\n/**\n * same as the {@link js} style, but no indentation or \\n\n *\n * Not suitable for diffs, as everything is printed on one line.\n */\nconst tight: Style = {\n fn: (fn, _) => fn.toString(),\n setEmpty: cls => `new ${cls}()`,\n setHead: cls => `new ${cls}([`,\n setTail: _ => '])',\n setEntrySep: () => ',',\n mapEmpty: cls => `new ${cls}()`,\n mapHead: cls => `new ${cls}([`,\n mapTail: _ => '])',\n mapKeyStart: () => '[',\n mapKeyValSep: () => ',',\n mapEntrySep: () => '],',\n circular: node => `*${node.id}`,\n nodeId: id => `&${id} `,\n errorEmpty: (er, cls) =>\n `new ${cls}(${JSON.stringify(er.message)})`,\n errorHead: (er, cls) =>\n `Object.assign(new ${cls}(${\n er.message ? JSON.stringify(er.message) : ''\n }), {`,\n errorTail: _ => '})',\n pojoEmpty: _ => '{}',\n pojoHead: _ => `\\{`,\n pojoTail: _ => '}',\n pojoKeyValSep: () => ':',\n pojoEntrySep: () => ',',\n arrayEmpty: _ => `[]`,\n arrayHead: _ => `[`,\n arrayTail: () => ']',\n arrayEntrySep: () => ',',\n\n // tight style doesn't need buffer head/tail/body, because it's\n // always printed as one base64 line.\n bufferChunkSize: Infinity,\n bufferEmpty: () => 'Buffer.alloc(0)',\n bufferStart: () => 'Buffer.from(\"',\n bufferBody: buf => buf.toString('base64'),\n bufferEnd: () => '\",\"base64\")',\n\n stringEmpty: () => '\"\"',\n stringLineSep: () => '+',\n stringLine: str => JSON.stringify(str),\n stringOneLine: str => JSON.stringify(str),\n stringHead: () => '',\n stringTail: _ => '',\n bufferHead: js.bufferHead,\n bufferKey: js.bufferKey,\n bufferLine: js.bufferLine,\n bufferLineSep: js.bufferLineSep,\n bufferTail: js.bufferTail,\n bufferKeySep: js.bufferKeySep,\n diffable: false,\n start: (_indent, key, sep) => `${key}${sep}`,\n}\n\nexport const styles: { [style in StyleType]: Style } = {\n pretty,\n js,\n tight,\n}\n"]}
{
"name": "tcompare",
"version": "6.0.1-1",
"version": "6.0.1-2",
"description": "A comprehensive comparison library, for use in test frameworks",
"author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)",
"license": "ISC",
"main": "./dist/cjs/index.js",
"module": "./dist/mjs/index.js",
"type": "module",
"exports": {

@@ -10,0 +9,0 @@ "./package.json": {

@@ -19,4 +19,5 @@ # tcompare

hasStrict,
matchStrict,
matchOnly,
matchStrict,
matchOnlyStrict,
} from 'tcompare'

@@ -103,4 +104,8 @@ import type { Result } from 'tcompare'

testing as `match()`, but will fail when two values are
equivalent but not strictly equal. (That is, when `a == b &&
!(a === b)`.)
equivalent but not strictly equal. (That is, when
`a == b && !(a === b)`.)
- `matchOnlyStrict(object, pattern, [options])` - Same comparison
testing as `matchOnly()`, but will fail when two values are
equivalent but not strictly equal. (That is, when
`a == b && !(a === b)`.)

@@ -130,2 +135,3 @@ There are classes exported to correspond to each of these. All of these are

+-- MatchOnly (uses Match.prototype.test)
+-- MatchOnlyStrict (uses MatchStrict.prototype.test)
```

@@ -132,0 +138,0 @@