type-plus
Version:
Provides additional types for TypeScript.
14 lines • 286 B
JavaScript
/**
* Left join `a` with `b`.
*
* This returns the proper type of `{ ...a, ...b }`
*
* @example
* ```ts
* leftJoin({ a: 1 }, {} as { a?: string | undefined }) // { a: number | string }
* ```
*/
export function merge(a, b) {
return { ...a, ...b };
}
//# sourceMappingURL=merge.js.map