The loosed and most flexibly magical matching strategy.

  • If the objects pass the tcompare!has.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.

Hierarchy (view full)

Constructors

Properties

Accessors

Methods

Constructors

Properties

bufferChunkSize: number
diffContext: number = 10
expect: any
id: null | number
idCounter: number
idMap: Map<any, number>
indent: string
isKey: boolean
key: any
level: number
match: boolean = true
memo: null | string
memoDiff: null | string = null
memoExpect: null | string = null
object: any
options: FormatOptions
parent: null | Same
provisional: boolean
simple: null | boolean | "COMPLEX" = null
sort: boolean
style: Style

Accessors

Methods