UNPKG

@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.

16 lines • 949 B
/** * The own enumerable options as `[name, value]` pairs, read through property descriptors so a * getter is never run, or `null` when one is an accessor or a number `JSON` cannot key (not * finite). A value of a type the option is not declared with (a boxed string, an object, a * string for `hour12`, a string for a digit count) throws `TypeError`, which each caller turns * into its sentinel: `Intl` would convert it. An `undefined` value is skipped, as `Intl` reads it * as absent. * * @param options the options object to read * @returns the pairs, or `null` when the options cannot be keyed safely * * @example plainOptionEntries({ year: "numeric", day: undefined }) // [["year", "numeric"]] * @example plainOptionEntries({ get year() { return "numeric"; } }) // null * @example plainOptionEntries({ hour12: "yes" }) // throws TypeError */ export declare function plainOptionEntries(options: object): [string, unknown][] | null;