struct
import { struct } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/comparable.ts";Create a Comparable for struct types.
@example
import { struct } from "./comparable.ts";
import * as N from "./number.ts";
import * as S from "./string.ts";
const structComparable = struct({
id: N.ComparableNumber,
name: S.ComparableString
});
const result = structComparable.compare({ id: 1, name: "John" })({ id: 1, name: "John" }); // true
function struct<A>(comparables: readonly [K in keyof A]: Comparable<A[K]>): Comparable<readonly [K in keyof A]: A[K]>;
§
struct<A>(comparables: readonly [K in keyof A]: Comparable<A[K]>): Comparable<readonly [K in keyof A]: A[K]>
[src]§Parameters
§
comparables: readonly [K in keyof A]: Comparable<A[K]>
[src]§Return Type
§
Comparable<readonly [K in keyof A]: A[K]>
[src]