checkBlocks関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The blocks in ascending order, checked: whole numbers, inside 1 to most,
none overlapping another. Throws a RangeError naming the first fault.
インポート
import { checkBlocks } from "@johnmorrisdotca/tane";
定義
function checkBlocks(blocks: readonly SeedBlock[], most?: number): SeedBlock[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
blocks | readonly SeedBlock[] | The reserved blocks to validate and sort. |
most (省略可) | number | The largest seed admitted by the host. |
戻り値
SeedBlock[]
The blocks in ascending order, checked: whole numbers, inside 1 to most, none overlapping another. Throws a RangeError naming the first fault.
例
import { checkBlocks } from "@johnmorrisdotca/tane";
console.log(checkBlocks([{ from: 1000, size: 100 }, { from: 10, size: 5 }]));[ { from: 10, size: 5 }, { from: 1000, size: 100 } ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。