Reference · Streams, draws and seeds
checkBlocksfunction
The blocks in ascending order, checked: whole numbers, inside 1 to most,
none overlapping another. Throws a RangeError naming the first fault.
Import it
import { checkBlocks } from "@johnmorrisdotca/tane";
Definition
function checkBlocks(blocks: readonly SeedBlock[], most?: number): SeedBlock[]
Parameters
| Name | Type | Description |
|---|---|---|
blocks | readonly SeedBlock[] | The reserved blocks to validate and sort. |
most (optional) | number | The largest seed admitted by the host. |
Returns
SeedBlock[]
The blocks in ascending order, checked: whole numbers, inside 1 to most, none overlapping another. Throws a RangeError naming the first fault.
Examples
import { checkBlocks } from "@johnmorrisdotca/tane";
console.log(checkBlocks([{ from: 1000, size: 100 }, { from: 10, size: 5 }]));[ { from: 10, size: 5 }, { from: 1000, size: 100 } ]What it prints (run when this page was built)