MCPcopy Create free account
hub / github.com/Effect-TS/effect / intervalValue

Function intervalValue

packages/sql/pg/src/PgTypes.ts:1318–1325  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

1316}
1317
1318const intervalValue = (value: unknown): Interval => {
1319 if (typeof value !== "object" || value === null) return fail("Expected an object for interval")
1320 const interval = value as Interval
1321 const months = requireInteger(interval.months, "interval months", INT32_MIN, INT32_MAX)
1322 const days = requireInteger(interval.days, "interval days", INT32_MIN, INT32_MAX)
1323 const microseconds = requireInt64(interval.microseconds, "interval microseconds")
1324 return { months, days, microseconds }
1325}
1326
1327const intervalCodec: UnsafeCodec<Interval> = codecOf(
1328 (bytes, offset, size) => {

Callers 1

PgTypes.tsFile · 0.85

Calls 3

requireIntegerFunction · 0.85
requireInt64Function · 0.85
failFunction · 0.70

Tested by

no test coverage detected