ts-proto 2.18.3 → 2.18.5

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.
@@ -91,7 +91,7 @@ function generateUnwrapDeep(ctx, fullProtoTypeName, fieldNames) {
91
91
  const chunks = [];
92
92
  if ((0, types_1.isStructTypeName)(fullProtoTypeName)) {
93
93
  if (ctx.options.useMapType) {
94
- chunks.push((0, ts_poet_1.code) `unwrap(message: ${(0, utils_1.wrapTypeName)(ctx.options, "Struct")}: {[key: string]: any} {
94
+ chunks.push((0, ts_poet_1.code) `unwrap(message: ${(0, utils_1.wrapTypeName)(ctx.options, "Struct")}): {[key: string]: any} {
95
95
  const object: { [key: string]: any } = {};
96
96
  if (message.fields) {
97
97
  for (const key of message.fields.keys()) {
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'` : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-proto",
3
- "version": "2.18.3",
3
+ "version": "2.18.5",
4
4
  "description": "",
5
5
  "main": "build/src/plugin.js",
6
6
  "repository": "github:stephenh/ts-proto",