ts-proto 2.18.3 → 2.18.4
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 +4 -0
- package/package.json +1 -1
package/build/src/main.js
CHANGED
|
@@ -518,6 +518,10 @@ function makeDeepPartial(options, longs) {
|
|
|
518
518
|
if (options.useDate === options_1.DateOption.TEMPORAL) {
|
|
519
519
|
optionalBuiltins.push("Temporal.Instant");
|
|
520
520
|
}
|
|
521
|
+
// Otherwise Exact reaches `null & {}`, which is never, and drops null from optional fields
|
|
522
|
+
if (options.useNullAsOptional) {
|
|
523
|
+
optionalBuiltins.push("null");
|
|
524
|
+
}
|
|
521
525
|
const Builtin = (0, ts_poet_1.conditionalOutput)("Builtin", (0, ts_poet_1.code) `type Builtin = Date | Function | Uint8Array | string | number | boolean ${optionalBuiltins.length ? `| ${optionalBuiltins.join(" | ")} ` : ""}| undefined;`);
|
|
522
526
|
// Based on https://github.com/sindresorhus/type-fest/pull/259
|
|
523
527
|
const maybeExcludeType = (0, options_1.addTypeToMessages)(options) ? `| '$type'` : "";
|