From b2e78533530a46f1ea685e6617405a3ede91f773 Mon Sep 17 00:00:00 2001 From: sefaphlvn <45564783+sefaphlvn@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:23:11 +0300 Subject: [PATCH] oneof field outer comment small fix & yarn proto2ts --- .../google/protobuf/struct.ts | 3 +- .../google/protobuf/struct.ts | 3 +- integration/oneof-unions-value/oneof.ts | 3 +- .../oneof-unions/google/protobuf/struct.ts | 3 +- integration/oneof-unions/oneof.ts | 3 +- .../google/protobuf/struct.ts | 3 +- src/main.ts | 63 ++++++++----------- 7 files changed, 37 insertions(+), 44 deletions(-) diff --git a/integration/oneof-unions-snake/google/protobuf/struct.ts b/integration/oneof-unions-snake/google/protobuf/struct.ts index 8d948efa7..c37458bb6 100644 --- a/integration/oneof-unions-snake/google/protobuf/struct.ts +++ b/integration/oneof-unions-snake/google/protobuf/struct.ts @@ -69,7 +69,8 @@ export interface Struct_FieldsEntry { * The JSON representation for `Value` is JSON value. */ export interface Value { - /** The kind of value. */ kind?: + /** The kind of value. */ + kind?: | // /** Represents a null value. */ { $case: "null_value"; null_value: NullValue } diff --git a/integration/oneof-unions-value/google/protobuf/struct.ts b/integration/oneof-unions-value/google/protobuf/struct.ts index bc04e9777..5bc88ea6d 100644 --- a/integration/oneof-unions-value/google/protobuf/struct.ts +++ b/integration/oneof-unions-value/google/protobuf/struct.ts @@ -69,7 +69,8 @@ export interface Struct_FieldsEntry { * The JSON representation for `Value` is JSON value. */ export interface Value { - /** The kind of value. */ kind?: + /** The kind of value. */ + kind?: | // /** Represents a null value. */ { $case: "nullValue"; value: NullValue } diff --git a/integration/oneof-unions-value/oneof.ts b/integration/oneof-unions-value/oneof.ts index 2febeda97..18f3b70dc 100644 --- a/integration/oneof-unions-value/oneof.ts +++ b/integration/oneof-unions-value/oneof.ts @@ -12,7 +12,8 @@ export interface PleaseChoose { /** * Please to be choosing one of the fields within this oneof clause. * This text exists to ensure we transpose comments correctly. - */ choice?: + */ + choice?: | // /** * Use this if you want a number. Numbers are great. Who doesn't diff --git a/integration/oneof-unions/google/protobuf/struct.ts b/integration/oneof-unions/google/protobuf/struct.ts index bce7c6590..2516fe90b 100644 --- a/integration/oneof-unions/google/protobuf/struct.ts +++ b/integration/oneof-unions/google/protobuf/struct.ts @@ -69,7 +69,8 @@ export interface Struct_FieldsEntry { * The JSON representation for `Value` is JSON value. */ export interface Value { - /** The kind of value. */ kind?: + /** The kind of value. */ + kind?: | // /** Represents a null value. */ { $case: "nullValue"; nullValue: NullValue } diff --git a/integration/oneof-unions/oneof.ts b/integration/oneof-unions/oneof.ts index b090c484f..6da00e41e 100644 --- a/integration/oneof-unions/oneof.ts +++ b/integration/oneof-unions/oneof.ts @@ -12,7 +12,8 @@ export interface PleaseChoose { /** * Please to be choosing one of the fields within this oneof clause. * This text exists to ensure we transpose comments correctly. - */ choice?: + */ + choice?: | // /** * Use this if you want a number. Numbers are great. Who doesn't diff --git a/integration/use-readonly-types/google/protobuf/struct.ts b/integration/use-readonly-types/google/protobuf/struct.ts index 3966b916a..325e08200 100644 --- a/integration/use-readonly-types/google/protobuf/struct.ts +++ b/integration/use-readonly-types/google/protobuf/struct.ts @@ -69,7 +69,8 @@ export interface Struct_FieldsEntry { * The JSON representation for `Value` is JSON value. */ export interface Value { - /** The kind of value. */ readonly kind?: + /** The kind of value. */ + readonly kind?: | // /** Represents a null value. */ { readonly $case: "nullValue"; readonly nullValue: NullValue } diff --git a/src/main.ts b/src/main.ts index 8f118b71d..c7742df4e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -664,9 +664,8 @@ function makeDeepPartial(options: Options, longs: ReturnType ${readSnippet("e")}): ${fallback}, + ${fieldKey}: ${ctx.utils.globalThis + }.Array.isArray(${jsonPropertyOptional}) ? ${jsonProperty}.map((e: any) => ${readSnippet("e")}): ${fallback}, `); } }