@northguild/gmt
Version:
Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.
17 lines • 840 B
TypeScript
import { Overflow } from "../types/overflow.js";
import "../types/index.js";
/**
* Resolve an optional overflow value to its default ("constrain") when unset.
*
* - Only an *omitted* member takes the default. Temporal's GetOption reads any other value,
* `null` included, through ToString, so `{ overflow: null }` is the string "null" and a
* RangeError — never "constrain" (Chromium 153: "Value null out of range for
* Temporal.PlainDate.prototype.add options property overflow"). Passing it through is what
* lets the caller's `catch` return its sentinel.
*
* @param overflow optional overflow value
* @example resolveOverflow(undefined) // "constrain"
* @example resolveOverflow("reject") // "reject"
* @returns the resolved overflow value
*/
export declare function resolveOverflow(overflow?: Overflow): Overflow;