MCPcopy
hub / github.com/nodejs/undici / headerValueEquals

Function headerValueEquals

lib/cache/sqlite-cache-store.js:444–463  ·  view source on GitHub ↗

* @param {string|string[]|null|undefined} lhs * @param {string|string[]|null|undefined} rhs * @returns {boolean}

(lhs, rhs)

Source from the content-addressed store, hash-verified

442 * @returns {boolean}
443 */
444function headerValueEquals (lhs, rhs) {
445 if (lhs == null && rhs == null) {
446 return true
447 }
448
449 if ((lhs == null && rhs != null) ||
450 (lhs != null && rhs == null)) {
451 return false
452 }
453
454 if (Array.isArray(lhs) && Array.isArray(rhs)) {
455 if (lhs.length !== rhs.length) {
456 return false
457 }
458
459 return lhs.every((x, i) => x === rhs[i])
460 }
461
462 return lhs === rhs
463}

Callers 1

#findValueMethod · 0.85

Calls 1

everyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…