premap
import { premap } from "https://raw.githubusercontent.com/baetheus/fun/main/sortable.ts";
Derives an instance of Sortable by take an existing Sortable over D and a function that turns an L into D and returns an Sortable over L.
@example
import { premap } from "./sortable.ts";
import { SortableNumber } from "./number.ts";
import { pipe } from "./fn.ts";
// Use number ordering, turn date into number and premap
const date = pipe(
SortableNumber,
premap((d: Date) => d.valueOf()),
);