nonNegativeFinite()
Clamp a value to a finite, non-negative number.
Import
Section titled “Import”import { nonNegativeFinite } from "@graphrefly/ts/solutions/reactive-layout";Signature
Section titled “Signature”function nonNegativeFinite( value: number, fallback: number,): numberParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | number | Input value. |
fallback | number | Value used when input is not finite. |
Returns
Section titled “Returns”A finite, non-negative number.
Example
Section titled “Example”nonNegativeFinite(-2, 0);Source
Section titled “Source”packages/ts/src/solutions/reactive-layout/utils.ts