* @param {string|string[]|null|undefined} lhs * @param {string|string[]|null|undefined} rhs * @returns {boolean}
(lhs, rhs)
| 442 | * @returns {boolean} |
| 443 | */ |
| 444 | function 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 | } |
no test coverage detected
searching dependent graphs…