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 tcompare!has.Has and subclasses, it's more complicated (only test nodes that exist in the expect object).

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