Comparing version 6.0.0 to 6.0.1-1
@@ -125,1 +125,2 @@ /// <reference types="node" /> | ||
} | ||
//# sourceMappingURL=format.d.ts.map |
@@ -19,2 +19,18 @@ "use strict"; | ||
class Format { | ||
options; | ||
parent; | ||
memo; | ||
sort; | ||
id; | ||
idCounter; | ||
idMap; | ||
style; | ||
bufferChunkSize; | ||
key; | ||
isKey; | ||
level; | ||
indent; | ||
match; | ||
object; | ||
expect; | ||
constructor(obj, options = {}) { | ||
@@ -41,4 +57,3 @@ this.options = options; | ||
? Infinity | ||
: options.bufferChunkSize || | ||
this.style.bufferChunkSize; | ||
: options.bufferChunkSize || this.style.bufferChunkSize; | ||
// for printing child values of pojos and maps | ||
@@ -48,4 +63,3 @@ this.key = options.key; | ||
this.isKey = !!options.isKey; | ||
if (this.isKey && | ||
!(this.parent && this.parent.isMap())) { | ||
if (this.isKey && !(this.parent && this.parent.isMap())) { | ||
throw new Error('isKey should only be set for Map keys'); | ||
@@ -64,5 +78,3 @@ } | ||
incId() { | ||
return this.parent | ||
? this.parent.incId() | ||
: (this.idCounter += 1); | ||
return this.parent ? this.parent.incId() : (this.idCounter += 1); | ||
} | ||
@@ -136,3 +148,3 @@ getId() { | ||
const s = this.object; | ||
return (s && | ||
return (!!s && | ||
typeof s === 'object' && | ||
@@ -288,5 +300,3 @@ (typeof s.pipe === 'function' || // readable | ||
this.memo = | ||
this.style.start(indent, key, sep) + | ||
this.nodeId() + | ||
this.memo; | ||
this.style.start(indent, key, sep) + this.nodeId() + this.memo; | ||
} | ||
@@ -315,5 +325,3 @@ printEnd() { | ||
? this.style.mapKeyStart() + | ||
this.parent | ||
.child(this.key, { isKey: true }, Format) | ||
.print() | ||
this.parent.child(this.key, { isKey: true }, Format).print() | ||
: JSON.stringify(this.key); | ||
@@ -592,4 +600,3 @@ } | ||
for (const [name, prop] of Object.entries(desc)) { | ||
if (prop.enumerable && | ||
typeof prop.get === 'function') { | ||
if (prop.enumerable && typeof prop.get === 'function') { | ||
// public wrappers around internal things are worth showing | ||
@@ -638,3 +645,10 @@ own.add(name); | ||
getPojoEntries(obj) { | ||
const ent = this.getPojoKeys(obj).map(k => [k, obj[k]]); | ||
const ent = this.getPojoKeys(obj).map(k => { | ||
try { | ||
return [k, obj[k]]; | ||
} | ||
catch { | ||
return [k, undefined]; | ||
} | ||
}); | ||
return this.sort | ||
@@ -641,0 +655,0 @@ ? ent.sort((a, b) => a[0].localeCompare(b[0], 'en')) |
@@ -5,1 +5,2 @@ import { Has } from './has.js'; | ||
} | ||
//# sourceMappingURL=has-strict.d.ts.map |
@@ -11,1 +11,2 @@ import { Same } from './same.js'; | ||
} | ||
//# sourceMappingURL=has.d.ts.map |
@@ -16,3 +16,3 @@ "use strict"; | ||
isArray() { | ||
return (super.isArray() && new format_js_1.Format(this.expect).isArray()); | ||
return super.isArray() && new format_js_1.Format(this.expect).isArray(); | ||
} | ||
@@ -19,0 +19,0 @@ // just return the entries that exist in the expect object |
import { FormatOptions } from './format.js'; | ||
import { SameOptions } from './same.js'; | ||
export interface Result { | ||
@@ -6,17 +7,18 @@ diff: string; | ||
} | ||
export type CompareOptions = FormatOptions & Pick<SameOptions, 'diffContext'>; | ||
export declare const format: (obj: any, options?: FormatOptions) => string; | ||
export declare const same: (obj: any, pattern: any, options?: FormatOptions) => Result; | ||
export declare const strict: (obj: any, pattern: any, options?: FormatOptions) => Result; | ||
export declare const has: (obj: any, pattern: any, options?: FormatOptions) => Result; | ||
export declare const hasStrict: (obj: any, pattern: any, options?: FormatOptions) => Result; | ||
export declare const match: (obj: any, pattern: any, options?: FormatOptions) => Result; | ||
export declare const matchOnly: (obj: any, pattern: any, options?: FormatOptions) => Result; | ||
export declare const matchStrict: (obj: any, pattern: any, options?: FormatOptions) => Result; | ||
export declare const same: (obj: any, pattern: any, options?: CompareOptions) => Result; | ||
export declare const strict: (obj: any, pattern: any, options?: CompareOptions) => Result; | ||
export declare const has: (obj: any, pattern: any, options?: CompareOptions) => Result; | ||
export declare const hasStrict: (obj: any, pattern: any, options?: CompareOptions) => Result; | ||
export declare const match: (obj: any, pattern: any, options?: CompareOptions) => Result; | ||
export declare const matchOnly: (obj: any, pattern: any, options?: CompareOptions) => Result; | ||
export declare const matchStrict: (obj: any, pattern: any, options?: CompareOptions) => Result; | ||
export { Format } from './format.js'; | ||
export type { FormatOptions } from './format.js'; | ||
export { HasStrict } from './has-strict.js'; | ||
export { Has } from './has.js'; | ||
export { HasStrict } from './has-strict.js'; | ||
export { Match } from './match.js'; | ||
export { MatchOnly } from './match-only.js'; | ||
export { MatchStrict } from './match-strict.js'; | ||
export { Match } from './match.js'; | ||
export { Same } from './same.js'; | ||
@@ -27,1 +29,2 @@ export type { SameOptions } from './same.js'; | ||
export type { Style } from './styles.js'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.styles = exports.Strict = exports.Same = exports.MatchStrict = exports.MatchOnly = exports.Match = exports.HasStrict = exports.Has = 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.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; | ||
const format_js_1 = require("./format.js"); | ||
const has_strict_js_1 = require("./has-strict.js"); | ||
const has_js_1 = require("./has.js"); | ||
const has_strict_js_1 = require("./has-strict.js"); | ||
const match_js_1 = require("./match.js"); | ||
const match_only_js_1 = require("./match-only.js"); | ||
const match_strict_js_1 = require("./match-strict.js"); | ||
const match_js_1 = require("./match.js"); | ||
const same_js_1 = require("./same.js"); | ||
@@ -32,8 +32,6 @@ const strict_js_1 = require("./strict.js"); | ||
Object.defineProperty(exports, "Format", { enumerable: true, get: function () { return format_js_2.Format; } }); | ||
var has_strict_js_2 = require("./has-strict.js"); | ||
Object.defineProperty(exports, "HasStrict", { enumerable: true, get: function () { return has_strict_js_2.HasStrict; } }); | ||
var has_js_2 = require("./has.js"); | ||
Object.defineProperty(exports, "Has", { enumerable: true, get: function () { return has_js_2.Has; } }); | ||
var has_strict_js_2 = require("./has-strict.js"); | ||
Object.defineProperty(exports, "HasStrict", { enumerable: true, get: function () { return has_strict_js_2.HasStrict; } }); | ||
var match_js_2 = require("./match.js"); | ||
Object.defineProperty(exports, "Match", { enumerable: true, get: function () { return match_js_2.Match; } }); | ||
var match_only_js_2 = require("./match-only.js"); | ||
@@ -43,2 +41,4 @@ Object.defineProperty(exports, "MatchOnly", { enumerable: true, get: function () { return match_only_js_2.MatchOnly; } }); | ||
Object.defineProperty(exports, "MatchStrict", { enumerable: true, get: function () { return match_strict_js_2.MatchStrict; } }); | ||
var match_js_2 = require("./match.js"); | ||
Object.defineProperty(exports, "Match", { enumerable: true, get: function () { return match_js_2.Match; } }); | ||
var same_js_2 = require("./same.js"); | ||
@@ -45,0 +45,0 @@ Object.defineProperty(exports, "Same", { enumerable: true, get: function () { return same_js_2.Same; } }); |
@@ -5,1 +5,2 @@ import { Same } from './same.js'; | ||
} | ||
//# sourceMappingURL=match-only.d.ts.map |
@@ -5,1 +5,2 @@ import { Match } from './match.js'; | ||
} | ||
//# sourceMappingURL=match-strict.d.ts.map |
@@ -11,4 +11,3 @@ "use strict"; | ||
// equal on type coercion, but not equal strictly. | ||
if (this.expect == this.object && | ||
this.expect !== this.object) { | ||
if (this.expect == this.object && this.expect !== this.object) { | ||
return false; | ||
@@ -15,0 +14,0 @@ } |
@@ -5,1 +5,2 @@ import { Has } from './has.js'; | ||
} | ||
//# sourceMappingURL=match.d.ts.map |
@@ -38,5 +38,3 @@ "use strict"; | ||
: pattern === Number | ||
? typeof obj === 'number' && | ||
obj === obj && | ||
isFinite(obj) | ||
? typeof obj === 'number' && obj === obj && isFinite(obj) | ||
: pattern === String | ||
@@ -73,7 +71,5 @@ ? typeof obj === 'string' | ||
? false | ||
: typeof pattern === 'function' && | ||
typeof obj === 'object' | ||
: typeof pattern === 'function' && typeof obj === 'object' | ||
? obj instanceof pattern | ||
: typeof obj !== 'object' || | ||
typeof pattern !== 'object' | ||
: typeof obj !== 'object' || typeof pattern !== 'object' | ||
? false | ||
@@ -80,0 +76,0 @@ : 'COMPLEX'; |
@@ -69,1 +69,2 @@ import { Format, FormatOptions } from './format.js'; | ||
} | ||
//# sourceMappingURL=same.d.ts.map |
@@ -34,2 +34,10 @@ "use strict"; | ||
class Same extends format_js_1.Format { | ||
provisional; | ||
expect; | ||
parent; | ||
simple = null; | ||
match = true; | ||
diffContext = 10; | ||
memoDiff = null; | ||
memoExpect = null; | ||
constructor(obj, options) { | ||
@@ -43,7 +51,2 @@ if (!options || typeof options !== 'object') { | ||
super(obj, options); | ||
this.simple = null; | ||
this.match = true; | ||
this.diffContext = 10; | ||
this.memoDiff = null; | ||
this.memoExpect = null; | ||
this.parent = options.parent || null; | ||
@@ -72,13 +75,8 @@ this.expect = options.expect; | ||
const b = this.expect; | ||
return typeof a === 'function' && | ||
typeof b === 'function' | ||
return typeof a === 'function' && typeof b === 'function' | ||
? a === b || | ||
(a.name === b.name && | ||
a.toString() === b.toString()) | ||
(a.name === b.name && a.toString() === b.toString()) | ||
: typeof a === 'symbol' || typeof b === 'symbol' | ||
? typeof a === typeof b && | ||
a.toString() === b.toString() | ||
: typeof a !== 'object' && | ||
typeof b !== 'object' && | ||
a == b | ||
? typeof a === typeof b && a.toString() === b.toString() | ||
: typeof a !== 'object' && typeof b !== 'object' && a == b | ||
? true | ||
@@ -200,5 +198,3 @@ : a === b | ||
/* c8 ignore stop */ | ||
if (this.parent || | ||
this.match || | ||
this.memoExpect === this.memo) { | ||
if (this.parent || this.match || this.memoExpect === this.memo) { | ||
return (this.memoDiff = ''); | ||
@@ -266,4 +262,3 @@ } | ||
this.memo = start + this.nodeId() + this.memo; | ||
this.memoExpect = | ||
start + this.nodeId() + this.memoExpect; | ||
this.memoExpect = start + this.nodeId() + this.memoExpect; | ||
} | ||
@@ -270,0 +265,0 @@ printEnd() { |
@@ -5,1 +5,2 @@ import { Same } from './same.js'; | ||
} | ||
//# sourceMappingURL=strict.d.ts.map |
@@ -57,1 +57,2 @@ /// <reference types="node" /> | ||
}; | ||
//# sourceMappingURL=styles.d.ts.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
const bufToAscii = (buf) => buf | ||
.map(c => c <= 0x20 || c >= 0x7f ? '.'.charCodeAt(0) : c) | ||
.map(c => (c <= 0x20 || c >= 0x7f ? '.'.charCodeAt(0) : c)) | ||
.toString(); | ||
@@ -9,0 +9,0 @@ exports.styles = {}; |
@@ -125,1 +125,2 @@ /// <reference types="node" /> | ||
} | ||
//# sourceMappingURL=format.d.ts.map |
@@ -53,4 +53,3 @@ // Format is the base class for all other comparators, and used | ||
? Infinity | ||
: options.bufferChunkSize || | ||
this.style.bufferChunkSize; | ||
: options.bufferChunkSize || this.style.bufferChunkSize; | ||
// for printing child values of pojos and maps | ||
@@ -60,4 +59,3 @@ this.key = options.key; | ||
this.isKey = !!options.isKey; | ||
if (this.isKey && | ||
!(this.parent && this.parent.isMap())) { | ||
if (this.isKey && !(this.parent && this.parent.isMap())) { | ||
throw new Error('isKey should only be set for Map keys'); | ||
@@ -76,5 +74,3 @@ } | ||
incId() { | ||
return this.parent | ||
? this.parent.incId() | ||
: (this.idCounter += 1); | ||
return this.parent ? this.parent.incId() : (this.idCounter += 1); | ||
} | ||
@@ -148,3 +144,3 @@ getId() { | ||
const s = this.object; | ||
return (s && | ||
return (!!s && | ||
typeof s === 'object' && | ||
@@ -300,5 +296,3 @@ (typeof s.pipe === 'function' || // readable | ||
this.memo = | ||
this.style.start(indent, key, sep) + | ||
this.nodeId() + | ||
this.memo; | ||
this.style.start(indent, key, sep) + this.nodeId() + this.memo; | ||
} | ||
@@ -327,5 +321,3 @@ printEnd() { | ||
? this.style.mapKeyStart() + | ||
this.parent | ||
.child(this.key, { isKey: true }, Format) | ||
.print() | ||
this.parent.child(this.key, { isKey: true }, Format).print() | ||
: JSON.stringify(this.key); | ||
@@ -604,4 +596,3 @@ } | ||
for (const [name, prop] of Object.entries(desc)) { | ||
if (prop.enumerable && | ||
typeof prop.get === 'function') { | ||
if (prop.enumerable && typeof prop.get === 'function') { | ||
// public wrappers around internal things are worth showing | ||
@@ -650,3 +641,10 @@ own.add(name); | ||
getPojoEntries(obj) { | ||
const ent = this.getPojoKeys(obj).map(k => [k, obj[k]]); | ||
const ent = this.getPojoKeys(obj).map(k => { | ||
try { | ||
return [k, obj[k]]; | ||
} | ||
catch { | ||
return [k, undefined]; | ||
} | ||
}); | ||
return this.sort | ||
@@ -653,0 +651,0 @@ ? ent.sort((a, b) => a[0].localeCompare(b[0], 'en')) |
@@ -5,1 +5,2 @@ import { Has } from './has.js'; | ||
} | ||
//# sourceMappingURL=has-strict.d.ts.map |
@@ -11,1 +11,2 @@ import { Same } from './same.js'; | ||
} | ||
//# sourceMappingURL=has.d.ts.map |
@@ -13,3 +13,3 @@ import { Format } from './format.js'; | ||
isArray() { | ||
return (super.isArray() && new Format(this.expect).isArray()); | ||
return super.isArray() && new Format(this.expect).isArray(); | ||
} | ||
@@ -16,0 +16,0 @@ // just return the entries that exist in the expect object |
import { FormatOptions } from './format.js'; | ||
import { SameOptions } from './same.js'; | ||
export interface Result { | ||
@@ -6,17 +7,18 @@ diff: string; | ||
} | ||
export type CompareOptions = FormatOptions & Pick<SameOptions, 'diffContext'>; | ||
export declare const format: (obj: any, options?: FormatOptions) => string; | ||
export declare const same: (obj: any, pattern: any, options?: FormatOptions) => Result; | ||
export declare const strict: (obj: any, pattern: any, options?: FormatOptions) => Result; | ||
export declare const has: (obj: any, pattern: any, options?: FormatOptions) => Result; | ||
export declare const hasStrict: (obj: any, pattern: any, options?: FormatOptions) => Result; | ||
export declare const match: (obj: any, pattern: any, options?: FormatOptions) => Result; | ||
export declare const matchOnly: (obj: any, pattern: any, options?: FormatOptions) => Result; | ||
export declare const matchStrict: (obj: any, pattern: any, options?: FormatOptions) => Result; | ||
export declare const same: (obj: any, pattern: any, options?: CompareOptions) => Result; | ||
export declare const strict: (obj: any, pattern: any, options?: CompareOptions) => Result; | ||
export declare const has: (obj: any, pattern: any, options?: CompareOptions) => Result; | ||
export declare const hasStrict: (obj: any, pattern: any, options?: CompareOptions) => Result; | ||
export declare const match: (obj: any, pattern: any, options?: CompareOptions) => Result; | ||
export declare const matchOnly: (obj: any, pattern: any, options?: CompareOptions) => Result; | ||
export declare const matchStrict: (obj: any, pattern: any, options?: CompareOptions) => Result; | ||
export { Format } from './format.js'; | ||
export type { FormatOptions } from './format.js'; | ||
export { HasStrict } from './has-strict.js'; | ||
export { Has } from './has.js'; | ||
export { HasStrict } from './has-strict.js'; | ||
export { Match } from './match.js'; | ||
export { MatchOnly } from './match-only.js'; | ||
export { MatchStrict } from './match-strict.js'; | ||
export { Match } from './match.js'; | ||
export { Same } from './same.js'; | ||
@@ -27,1 +29,2 @@ export type { SameOptions } from './same.js'; | ||
export type { Style } from './styles.js'; | ||
//# sourceMappingURL=index.d.ts.map |
import { Format } from './format.js'; | ||
import { HasStrict } from './has-strict.js'; | ||
import { Has } from './has.js'; | ||
import { HasStrict } from './has-strict.js'; | ||
import { Match } from './match.js'; | ||
import { MatchOnly } from './match-only.js'; | ||
import { MatchStrict } from './match-strict.js'; | ||
import { Match } from './match.js'; | ||
import { Same } from './same.js'; | ||
@@ -27,7 +27,7 @@ import { Strict } from './strict.js'; | ||
export { Format } from './format.js'; | ||
export { HasStrict } from './has-strict.js'; | ||
export { Has } from './has.js'; | ||
export { HasStrict } from './has-strict.js'; | ||
export { Match } from './match.js'; | ||
export { MatchOnly } from './match-only.js'; | ||
export { MatchStrict } from './match-strict.js'; | ||
export { Match } from './match.js'; | ||
export { Same } from './same.js'; | ||
@@ -34,0 +34,0 @@ export { Strict } from './strict.js'; |
@@ -5,1 +5,2 @@ import { Same } from './same.js'; | ||
} | ||
//# sourceMappingURL=match-only.d.ts.map |
@@ -5,1 +5,2 @@ import { Match } from './match.js'; | ||
} | ||
//# sourceMappingURL=match-strict.d.ts.map |
@@ -8,4 +8,3 @@ // this is a weird one. Basically, it is identical to Match, | ||
// equal on type coercion, but not equal strictly. | ||
if (this.expect == this.object && | ||
this.expect !== this.object) { | ||
if (this.expect == this.object && this.expect !== this.object) { | ||
return false; | ||
@@ -12,0 +11,0 @@ } |
@@ -5,1 +5,2 @@ import { Has } from './has.js'; | ||
} | ||
//# sourceMappingURL=match.d.ts.map |
@@ -35,5 +35,3 @@ import { Format } from './format.js'; | ||
: pattern === Number | ||
? typeof obj === 'number' && | ||
obj === obj && | ||
isFinite(obj) | ||
? typeof obj === 'number' && obj === obj && isFinite(obj) | ||
: pattern === String | ||
@@ -70,7 +68,5 @@ ? typeof obj === 'string' | ||
? false | ||
: typeof pattern === 'function' && | ||
typeof obj === 'object' | ||
: typeof pattern === 'function' && typeof obj === 'object' | ||
? obj instanceof pattern | ||
: typeof obj !== 'object' || | ||
typeof pattern !== 'object' | ||
: typeof obj !== 'object' || typeof pattern !== 'object' | ||
? false | ||
@@ -77,0 +73,0 @@ : 'COMPLEX'; |
@@ -69,1 +69,2 @@ import { Format, FormatOptions } from './format.js'; | ||
} | ||
//# sourceMappingURL=same.d.ts.map |
@@ -70,13 +70,8 @@ // Same is the base class for all comparators | ||
const b = this.expect; | ||
return typeof a === 'function' && | ||
typeof b === 'function' | ||
return typeof a === 'function' && typeof b === 'function' | ||
? a === b || | ||
(a.name === b.name && | ||
a.toString() === b.toString()) | ||
(a.name === b.name && a.toString() === b.toString()) | ||
: typeof a === 'symbol' || typeof b === 'symbol' | ||
? typeof a === typeof b && | ||
a.toString() === b.toString() | ||
: typeof a !== 'object' && | ||
typeof b !== 'object' && | ||
a == b | ||
? typeof a === typeof b && a.toString() === b.toString() | ||
: typeof a !== 'object' && typeof b !== 'object' && a == b | ||
? true | ||
@@ -198,5 +193,3 @@ : a === b | ||
/* c8 ignore stop */ | ||
if (this.parent || | ||
this.match || | ||
this.memoExpect === this.memo) { | ||
if (this.parent || this.match || this.memoExpect === this.memo) { | ||
return (this.memoDiff = ''); | ||
@@ -264,4 +257,3 @@ } | ||
this.memo = start + this.nodeId() + this.memo; | ||
this.memoExpect = | ||
start + this.nodeId() + this.memoExpect; | ||
this.memoExpect = start + this.nodeId() + this.memoExpect; | ||
} | ||
@@ -268,0 +260,0 @@ printEnd() { |
@@ -5,1 +5,2 @@ import { Same } from './same.js'; | ||
} | ||
//# sourceMappingURL=strict.d.ts.map |
@@ -57,1 +57,2 @@ /// <reference types="node" /> | ||
}; | ||
//# sourceMappingURL=styles.d.ts.map |
// can't use buf.toString('ascii') because that unmasks high bytes | ||
const bufToAscii = (buf) => buf | ||
.map(c => c <= 0x20 || c >= 0x7f ? '.'.charCodeAt(0) : c) | ||
.map(c => (c <= 0x20 || c >= 0x7f ? '.'.charCodeAt(0) : c)) | ||
.toString(); | ||
@@ -5,0 +5,0 @@ export const styles = {}; |
{ | ||
"name": "tcompare", | ||
"version": "6.0.0", | ||
"version": "6.0.1-1", | ||
"description": "A comprehensive comparison library, for use in test frameworks", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/tapjs/tcompare.git" | ||
}, | ||
"author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)", | ||
@@ -14,9 +10,15 @@ "license": "ISC", | ||
"exports": { | ||
"./package.json": { | ||
"import": "./package.json", | ||
"require": "./package.json" | ||
}, | ||
".": { | ||
"import": "./dist/mjs/index.js", | ||
"require": "./dist/cjs/index.js" | ||
}, | ||
"./plugin-base": { | ||
"import": "./dist/mjs/plugin-base.js", | ||
"require": "./dist/cjs/plugin-base.js" | ||
"import": { | ||
"types": "./dist/mjs/index.d.ts", | ||
"default": "./dist/mjs/index.js" | ||
}, | ||
"require": { | ||
"types": "./dist/cjs/index.d.ts", | ||
"default": "./dist/cjs/index.js" | ||
} | ||
} | ||
@@ -30,53 +32,21 @@ }, | ||
}, | ||
"devDependencies": { | ||
"@types/diff": "^5.0.2", | ||
"@types/node": "^18.11.9", | ||
"@types/tap": "^15.0.7", | ||
"c8": "^7.12.0", | ||
"prettier": "^2.8.0", | ||
"tap": "^16.3.2", | ||
"ts-node": "^10.9.1", | ||
"typedoc": "^0.23.21", | ||
"typescript": "^4.9.3" | ||
}, | ||
"prettier": { | ||
"semi": false, | ||
"printWidth": 60, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"singleQuote": true, | ||
"jsxSingleQuote": false, | ||
"bracketSameLine": true, | ||
"arrowParens": "avoid", | ||
"endOfLine": "lf" | ||
}, | ||
"scripts": { | ||
"snap": "c8 tap", | ||
"test": "c8 tap", | ||
"preprepare": "rm -rf dist", | ||
"prepare": "tsc -p tsconfig-cjs.json && tsc -p tsconfig-esm.json", | ||
"postprepare": "bash fixup.sh", | ||
"snap": "tap", | ||
"test": "tap", | ||
"prepare": "tsc -p tsconfig/cjs.json && tsc -p tsconfig/esm.json && bash scripts/fixup.sh", | ||
"pretest": "npm run prepare", | ||
"presnap": "npm run prepare", | ||
"format": "prettier --write . --loglevel warn", | ||
"preversion": "npm test", | ||
"postversion": "npm publish", | ||
"prepublishOnly": "git push origin --follow-tags", | ||
"typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts" | ||
"format": "prettier --write . --loglevel warn --ignore-path ../../.prettierignore --cache", | ||
"typedoc": "typedoc --tsconfig tsconfig/esm.json ./src/*.ts" | ||
}, | ||
"tap": { | ||
"test-env": [ | ||
"LC_ALL=sk" | ||
], | ||
"coverage": false, | ||
"node-arg": [ | ||
"--no-warnings", | ||
"--loader", | ||
"ts-node/esm" | ||
], | ||
"ts": false | ||
"coverage-map": "map.js" | ||
}, | ||
"engines": { | ||
"node": ">=16" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/tapjs/tapjs.git" | ||
} | ||
} |
@@ -34,6 +34,3 @@ # tcompare | ||
import { MatchOnly } from 'tcompare' | ||
const mo = new MatchOnly( | ||
{ a: 1, b: 2 }, | ||
{ expect: { a: Number } } | ||
) | ||
const mo = new MatchOnly({ a: 1, b: 2 }, { expect: { a: Number } }) | ||
const diff: string = mo.print() | ||
@@ -40,0 +37,0 @@ console.log(mo.match) // false |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
409640
0
85
0
1
4157
2
289