core3-utils

@wixc3/typescript on Github

Home > @wixc3/typescript > isSame

isSame() function

Compared 2 code snippet (or ASTs)

Signature:

export declare function isSame(a?: ts.Node, b?: ts.Node, ignore?: Predicate<ts.Node | undefined>, reportDiff?: (a?: string, b?: string) => void): boolean;

Parameters

Parameter Type Description
a ts.Node _(Optional)_
b ts.Node _(Optional)_
ignore [Predicate](/core3-utils/common.predicate.html)<ts.Node \| undefined> _(Optional)_ if this predicate is satisfied for an AST node, it (and its children) will be considered same
reportDiff (a?: string, b?: string) => void _(Optional)_

Returns:

boolean

true iff the code is functionally the same. i.e. ignoring comments, white spaces, ineffective line breaks etc