Files
headroom/frontend/node_modules/effect/dist/esm/Equal.js
Santhosh Janardhanan de2d83092e feat: Reinitialize frontend with SvelteKit and TypeScript
- Delete old Vite+Svelte frontend
- Initialize new SvelteKit project with TypeScript
- Configure Tailwind CSS v4 + DaisyUI
- Implement JWT authentication with auto-refresh
- Create login page with form validation (Zod)
- Add protected route guards
- Update Docker configuration for single-stage build
- Add E2E tests with Playwright (6/11 passing)
- Fix Svelte 5 reactivity with $state() runes

Known issues:
- 5 E2E tests failing (timing/async issues)
- Token refresh implementation needs debugging
- Validation error display timing
2026-02-17 16:19:59 -05:00

71 lines
2.4 KiB
JavaScript

import * as Hash from "./Hash.js";
import { hasProperty } from "./Predicate.js";
import { structuralRegionState } from "./Utils.js";
/**
* @since 2.0.0
* @category symbols
*/
export const symbol = /*#__PURE__*/Symbol.for("effect/Equal");
export function equals() {
if (arguments.length === 1) {
return self => compareBoth(self, arguments[0]);
}
return compareBoth(arguments[0], arguments[1]);
}
function compareBoth(self, that) {
if (self === that) {
return true;
}
const selfType = typeof self;
if (selfType !== typeof that) {
return false;
}
if (selfType === "object" || selfType === "function") {
if (self !== null && that !== null) {
if (isEqual(self) && isEqual(that)) {
if (Hash.hash(self) === Hash.hash(that) && self[symbol](that)) {
return true;
} else {
return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
}
} else if (self instanceof Date && that instanceof Date) {
const t1 = self.getTime();
const t2 = that.getTime();
return t1 === t2 || Number.isNaN(t1) && Number.isNaN(t2);
} else if (self instanceof URL && that instanceof URL) {
return self.href === that.href;
}
}
if (structuralRegionState.enabled) {
if (Array.isArray(self) && Array.isArray(that)) {
return self.length === that.length && self.every((v, i) => compareBoth(v, that[i]));
}
if (Object.getPrototypeOf(self) === Object.prototype && Object.getPrototypeOf(that) === Object.prototype) {
const keysSelf = Object.keys(self);
const keysThat = Object.keys(that);
if (keysSelf.length === keysThat.length) {
for (const key of keysSelf) {
// @ts-expect-error
if (!(key in that && compareBoth(self[key], that[key]))) {
return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
}
}
return true;
}
}
return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
}
}
return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
}
/**
* @since 2.0.0
* @category guards
*/
export const isEqual = u => hasProperty(u, symbol);
/**
* @since 2.0.0
* @category instances
*/
export const equivalence = () => equals;
//# sourceMappingURL=Equal.js.map