readonly
import { readonly } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/comparable.ts";Create a Comparable for Readonly types.
@example
import { readonly, fromCompare } from "./comparable.ts";
// This has type Comparable<Array<string>>
const ComparableMutableArray = fromCompare<Array<string>>(
(second) => (first) => first.length === second.length
&& first.every((value, index) => value === second[index])
);
// This has type Comparable<Readonly<Array<string>>>
const ComparableReadonlyArray = readonly(ComparableMutableArray);