intervalEngulfsUnix
Signature
Section titled “Signature”intervalEngulfsUnix(aStart: string | number, aEnd: string | number, bStart: string | number, bEnd: string | number): booleanimport { intervalEngulfsUnix } from "@northguild/gmt/unix/interval";Return true when interval B is fully contained within interval A — every instant of B
- falls within A.
- Compares numeric Unix epoch values directly.
- Equivalent to 4-argument
intervalContainsUnix(aStart, aEnd, bStart, bEnd). - Returns
falseif either interval is invalid (start > end). - Returns
falseon invalid input (non-numeric types, non-finite values).
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
aStart |
string | number |
Unix epoch value (seconds or milliseconds) — outer interval start |
aEnd |
string | number |
Unix epoch value (seconds or milliseconds) — outer interval end |
bStart |
string | number |
Unix epoch value (seconds or milliseconds) — inner interval start |
bEnd |
string | number |
Unix epoch value (seconds or milliseconds) — inner interval end |
Returns
Section titled “Returns”true if B is fully contained in A, or false on invalid input
Examples
Section titled “Examples”intervalEngulfsUnix(0, 1700000000, 1500000000, 1600000000) // trueintervalEngulfsUnix(0, 1700000000, 0, 1700000000) // true (equal intervals)intervalEngulfsUnix(0, 1700000000, 0, 1500000000) // trueintervalEngulfsUnix(1500000000, 1600000000, 0, 1700000000) // falseintervalEngulfsUnix(NaN, 1700000000, 1500000000, 1600000000) // false