import { Predicate } from "../../types/types" import { LoDash } from "../../shared"; /** * Returns true if two values are deeply structurally equal. * * *This function is implemented using LoDash's isEqual().* */ export function equal(value: T, other: T): boolean /** * Returns a predicate function that returns true if an input value is deeply structurally equal to the original * **value**. * * *This function is implemented using LoDash's isEqual().* */ export function equal(value: T): Predicate export function equal(value: T, other?: T): boolean | Predicate { if (other === undefined) { return (other: T) => LoDash.isEqual(value, other) } return LoDash.isEqual(value, other) } /** * Returns true if two values are not deeply structurally equal. * * *This function is implemented using LoDash's isEqual().* */ export function unequal(value: T, other: T): boolean /** * Returns a predicate function that returns true if an input value is not deeply structurally equal to the original * **value**. * * *This function is implemented using LoDash's isEqual().* */ export function unequal(value: T): Predicate export function unequal(value: T, other?: T): boolean | Predicate { if (other === undefined) { return (other: T) => !LoDash.isEqual(value, other) } return !LoDash.isEqual(value, other) } /** * Returns true if two values are strictly equal. */ export function is(value: T, other: T): boolean /** * Returns a predicate function that returns true if an input value is strictly equal to the original **value**. */ export function is(value: T): Predicate export function is(value: T, other?: T): boolean | Predicate { if (other === undefined) { return (other) => other === value } return value === other } /** * Returns true if two values are not strictly equal. */ export function isnt(value: T, other: T): boolean /** * Returns a predicate function that returns true if an input value is not strictly equal to the original **value**. */ export function isnt(value: T): Predicate export function isnt(value: T, other?: T): boolean | Predicate { if (other === undefined) { return (other) => other !== value } return value !== other }