generateSubArrays
function generateSubArrays<T>(arr): T[][];Defined in: keyset.ts:122
Return every non-empty prefix of an array.
This is the primitive behind lexicographic keyset comparison:
[a, b, c] becomes [a], [a, b], [a, b, c], which maps to
(a > x) OR (a = x AND b > y) OR (a = x AND b = y AND c > z).
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
arr |
readonly T[] |
Returns
Section titled “Returns”T[][]
Example
Section titled “Example”generateSubArrays(["createdAt", "id"]);// [["createdAt"], ["createdAt", "id"]]