MCPcopy Index your code
hub / github.com/nodejs/node / checkOperator

Function checkOperator

lib/internal/assert/assertion_error.js:94–109  ·  view source on GitHub ↗
(actual, expected, operator)

Source from the content-addressed store, hash-verified

92}
93
94function checkOperator(actual, expected, operator) {
95 // In case both values are objects or functions explicitly mark them as not
96 // reference equal for the `strictEqual` operator.
97 if (
98 operator === 'strictEqual' &&
99 ((typeof actual === 'object' &&
100 actual !== null &&
101 typeof expected === 'object' &&
102 expected !== null) ||
103 (typeof actual === 'function' && typeof expected === 'function'))
104 ) {
105 operator = 'strictEqualObject';
106 }
107
108 return operator;
109}
110
111function getColoredMyersDiff(actual, expected) {
112 const header = `${colors.green}actual${colors.white} ${colors.red}expected${colors.white}`;

Callers 1

createErrDiffFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…