All files / src/internal/client/reactivity equality.js

100% Statements 20/20
85.71% Branches 6/7
100% Functions 3/3
100% Lines 20/20

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 212x 2x 8795x 8795x 2x 2x 2x 2x 2x 2x 2x 34734x 34734x 34734x 34734x 2x 2x 2x 34672x 34672x  
/** @type {import('#client').Equals} */
export function equals(value) {
	return value === this.v;
}
 
/**
 * @param {unknown} a
 * @param {unknown} b
 * @returns {boolean}
 */
export function safe_not_equal(a, b) {
	return a != a
		? b == b
		: a !== b || (a !== null && typeof a === 'object') || typeof a === 'function';
}
 
/** @type {import('#client').Equals} */
export function safe_equals(value) {
	return !safe_not_equal(value, this.v);
}