# intervalContainsUnix

Industry: Core

## Signature

```ts
intervalContainsUnix(intervalStart: string | number, intervalEnd: string | number, pointOrStart: string | number, pointEnd?: string | number): boolean
```

Return true when `pointOrStart` falls within the half-open interval `[intervalStart, intervalEnd)` (3-arg), or when the inner interval `[innerStart, innerEnd)` lies within the outer interval `[intervalStart, intervalEnd)` (4-arg).

- Compares numeric Unix epoch values directly.
- Point mode: `start <= point < end`, the same rule as `intervalContains`. The `end` is excluded, so a point at `end` returns `false`, and an empty interval (`start === end`) contains no point.
- Interval mode: the intervals overlap and `start <= innerStart` and `innerEnd <= end`. An inner interval may share the outer `end`. An empty inner interval counts only strictly inside the outer interval, the same edge rule as `clampInterval`, and an empty outer interval contains nothing.
- Returns `false` if `intervalStart > intervalEnd` (invalid outer interval).
- Returns `false` if `innerStart > innerEnd` in 4-arg mode (invalid inner interval).
- Returns `false` on invalid input: non-numeric types, empty strings, and values that are not safe integers (fractions, `NaN`, `±Infinity`, beyond ±(2^53 − 1)).

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `intervalStart` | `string` \| `number` | Unix epoch value, in the one unit all epoch arguments share — outer interval start |
| `intervalEnd` | `string` \| `number` | Unix epoch value, in the one unit all epoch arguments share — outer interval end |
| `pointOrStart` | `string` \| `number` | Unix epoch value for the point (3-arg) or inner start (4-arg) |
| `pointEnd` | `string` \| `number` | optional Unix epoch value for the inner interval end (4-arg mode) |

## Returns

true if the point or inner interval is contained, or false on invalid input

## Examples

```ts
import { intervalContainsUnix } from "@northguild/gmt/unix/interval";

intervalContainsUnix(0, 1700000000, 170000000) // true
```

## Source

[unix/interval/intervalContainsUnix.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/unix/interval/intervalContainsUnix.ts)
