intervalAbutsUnix
Signature
Section titled “Signature”intervalAbutsUnix(aStart: string | number, aEnd: string | number, bStart: string | number, bEnd: string | number): booleanReturn true when two half-open Unix intervals [start, end) are exactly adjacent — one ends where the other starts, so they share no value and leave no gap (Allen’s “meets”, either order).
- Compares numeric Unix epoch values directly.
- Returns
truewhenaEnd === bStartorbEnd === aStartand neither interval is empty. No value is stepped by an epoch unit. - Returns
falsewhen intervals overlap, are disjoint with a gap (even one epoch unit), or when either is empty (start === end): an empty interval abuts nothing. - Returns
falseon invalid input: non-numeric types, empty strings, and values that are not safe integers (fractions,NaN,±Infinity, beyond ±(2^53 − 1)).
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
aStart | string | number | Unix epoch value, in the one unit all epoch arguments share — first interval start |
aEnd | string | number | Unix epoch value, in the one unit all epoch arguments share — first interval end |
bStart | string | number | Unix epoch value, in the one unit all epoch arguments share — second interval start |
bEnd | string | number | Unix epoch value, in the one unit all epoch arguments share — second interval end |
Returns
Section titled “Returns”true if intervals are exactly adjacent, or false on invalid input
Examples
Section titled “Examples”import { intervalAbutsUnix } from "@northguild/gmt/unix/interval";
intervalAbutsUnix(0, 1500000000, 1500000000, 1700000000) // true