UNPKG

mute-structs

Version:

NodeJS module providing an implementation of the LogootSplit CRDT algorithm

11 lines (10 loc) 498 B
import { Ordering } from "./ordering"; export declare function findPredecessor<T>(list: T[], element: T, compareFn: (a: T, b: T) => Ordering): T | undefined; /** * Check if an array is sorted * * @param {T[]} array The array to browse * @param {(a: T, b: T) => Ordering} compareFn The comparison function used to determine the order between two elements * @return {boolean} Is the array sorted */ export declare function isSorted<T>(array: T[], compareFn: (a: T, b: T) => Ordering): boolean;