# intervalEngulfsUnix

Industry: Core

## Signature

```ts
intervalEngulfsUnix(aStart: string | number, aEnd: string | number, bStart: string | number, bEnd: string | number): boolean
```

Return true when the half-open interval B `[bStart, bEnd)` lies within the half-open interval A `[aStart, aEnd)` — every instant of B falls within A.

- Compares numeric Unix epoch values directly.
- B is inside A when the intervals overlap and `aStart <= bStart` and `bEnd <= aEnd`. Both ends are exclusive, so B may start at A's start and end at A's end.
- An empty B counts only strictly inside A, the same edge rule as `clampInterval`; at either edge of A it returns `false`, and an empty A engulfs nothing.
- Equivalent to 4-argument `intervalContainsUnix(aStart, aEnd, bStart, bEnd)`.
- Returns `false` if either interval is invalid (`start > end`).
- 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 |
| --- | --- | --- |
| `aStart` | `string` \| `number` | Unix epoch value, in the one unit all epoch arguments share — outer interval start |
| `aEnd` | `string` \| `number` | Unix epoch value, in the one unit all epoch arguments share — outer interval end |
| `bStart` | `string` \| `number` | Unix epoch value, in the one unit all epoch arguments share — inner interval start |
| `bEnd` | `string` \| `number` | Unix epoch value, in the one unit all epoch arguments share — inner interval end |

## Returns

true if B is fully contained in A, or false on invalid input

## Examples

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

intervalEngulfsUnix(0, 1700000000, 1500000000, 1600000000) // true
```

## Source

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