ts-proto 2.18.0 → 2.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/main.js +2 -2
- package/package.json +1 -1
package/build/src/main.js
CHANGED
|
@@ -523,10 +523,10 @@ function makeDeepPartial(options, longs) {
|
|
|
523
523
|
const maybeExcludeType = (0, options_1.addTypeToMessages)(options) ? `| '$type'` : "";
|
|
524
524
|
const Exact = (0, ts_poet_1.conditionalOutput)("Exact", (0, ts_poet_1.code) `
|
|
525
525
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
526
|
-
${maybeExport} type Exact<P, I
|
|
526
|
+
${maybeExport} type Exact<P, I> = ${maybeUnknownP}P extends ${Builtin}
|
|
527
527
|
? P
|
|
528
528
|
: P &
|
|
529
|
-
{ [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> ${maybeExcludeType}>]: never };
|
|
529
|
+
{ [K in keyof P as Extract<K, keyof I>]: Exact<P[K], I[K & keyof I]> } & { [K in Exclude<keyof I, KeysOfUnion<P> ${maybeExcludeType}>]: never };
|
|
530
530
|
`);
|
|
531
531
|
// Based on the type from ts-essentials
|
|
532
532
|
const keys = (0, options_1.addTypeToMessages)(options) ? (0, ts_poet_1.code) `Exclude<keyof T, '$type'>` : (0, ts_poet_1.code) `keyof T`;
|