intervalAbutsUnix
Signature
Section titled “Signature”intervalAbutsUnix(aStart: string | number, aEnd: string | number, bStart: string | number, bEnd: string | number): booleanimport { intervalAbutsUnix } from "@northguild/gmt/unix/interval";Return true when two Unix intervals are exactly adjacent — one’s end equals the other’s
- start minus 1 (no gap, no overlap).
- Compares numeric Unix epoch values directly.
- Returns
truewhenaEnd + 1 === bStartorbEnd + 1 === aStart. - Returns
falsewhen intervals overlap, are disjoint with a gap, or are invalid. - 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) — first interval start |
aEnd |
string | number |
Unix epoch value (seconds or milliseconds) — first interval end |
bStart |
string | number |
Unix epoch value (seconds or milliseconds) — second interval start |
bEnd |
string | number |
Unix epoch value (seconds or milliseconds) — second interval end |
Returns
Section titled “Returns”true if intervals are exactly adjacent, or false on invalid input
Examples
Section titled “Examples”intervalAbutsUnix(0, 1500000000, 1500000001, 1700000000) // trueintervalAbutsUnix(1500000001, 1700000000, 0, 1500000000) // trueintervalAbutsUnix(0, 1500000000, 1500000002, 1700000000) // false (gap)intervalAbutsUnix(0, 1500000001, 1500000000, 1700000000) // false (overlap)intervalAbutsUnix(NaN, 1500000000, 1500000001, 1700000000) // false