ts-proto 1.156.0 → 1.156.2

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.
Files changed (2) hide show
  1. package/build/main.js +4 -4
  2. package/package.json +2 -2
package/build/main.js CHANGED
@@ -1801,17 +1801,17 @@ function generateFromPartial(ctx, fullName, messageDesc) {
1801
1801
  if (ctx.options.useExactTypes) {
1802
1802
  chunks.push((0, ts_poet_1.code) `
1803
1803
  create<I extends ${utils.Exact}<${utils.DeepPartial}<${fullName}>, I>>(base?: I): ${fullName} {
1804
+ return ${fullName}.fromPartial(base ?? ({} as any));
1805
+ },
1804
1806
  `);
1805
1807
  }
1806
1808
  else {
1807
1809
  chunks.push((0, ts_poet_1.code) `
1808
1810
  create(base?: ${utils.DeepPartial}<${fullName}>): ${fullName} {
1811
+ return ${fullName}.fromPartial(base ?? {});
1812
+ },
1809
1813
  `);
1810
1814
  }
1811
- chunks.push((0, ts_poet_1.code) `
1812
- return ${fullName}.fromPartial(base ?? {})
1813
- `);
1814
- chunks.push((0, ts_poet_1.code) `},`, (0, ts_poet_1.code) ``);
1815
1815
  // create the fromPartial function declaration
1816
1816
  const paramName = messageDesc.field.length > 0 ? "object" : "_";
1817
1817
  if (ctx.options.useExactTypes) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-proto",
3
- "version": "1.156.0",
3
+ "version": "1.156.2",
4
4
  "description": "",
5
5
  "main": "build/plugin.js",
6
6
  "repository": "github:stephenh/ts-proto",
@@ -68,7 +68,7 @@
68
68
  "case-anything": "^2.1.13",
69
69
  "protobufjs": "^7.2.4",
70
70
  "ts-poet": "^6.5.0",
71
- "ts-proto-descriptors": "1.14.0"
71
+ "ts-proto-descriptors": "1.15.0"
72
72
  },
73
73
  "packageManager": "yarn@3.6.0"
74
74
  }