UNPKG

@zsnout/ithkuil

Version:

A set of tools which can generate and parse romanized Ithkuil text and which can generate Ithkuil script from text and JSON data.

29 lines (28 loc) 997 B
/** * A Partial type that allows undefined values when `exactOptionalPropertyTypes` * is `true`. This is mainly so that this project works in environments with * that flag enabled. */ export type Partial<T> = { [K in keyof T]?: T[K] | undefined; }; /** * Merges two objects, overriding values of the first object with values from * the second. `undefined` and `null` values in the second object are ignored. * * @example * fillDefaults({ name: "Ithkuil IV", creation: 2020 }, { creation: 2023 }) * // { name: "Ithkuil IV", creation: 2023 } * * @example * fillDefaults( * { case: "THM", caseScope: "CCN" }, * { case: undefined, caseScope: "CCS" }, * ) * // { case: "THM", caseScope: "CCS" } * * @param defaultValue The default object. * @param additions The additions to be included into the object. * @returns An object containing the merged defaults and additions. */ export declare function fillDefaults<T>(defaultValue: T, additions: Partial<T>): T;