type-plus
Version:
Provides additional types for TypeScript.
18 lines • 403 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.merge = void 0;
/**
* 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 }
* ```
*/
function merge(a, b) {
return { ...a, ...b };
}
exports.merge = merge;
//# sourceMappingURL=merge.js.map