diff --git a/__fixtures__/misc/output-base64/misc/eval_request.ts b/__fixtures__/misc/output-base64/misc/eval_request.ts index 881c09e02..711589138 100644 --- a/__fixtures__/misc/output-base64/misc/eval_request.ts +++ b/__fixtures__/misc/output-base64/misc/eval_request.ts @@ -123,7 +123,7 @@ export interface EvalRequest { opt: FeatureSet_Utf8Validation; graph?: TestNest_Graph; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestProtoMsg { typeUrl: "/misc.EvalRequest"; @@ -173,7 +173,7 @@ export interface EvalRequestSDKType { test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; } export interface AccessConfig { sender: string; @@ -424,7 +424,7 @@ function createBaseEvalRequest(): EvalRequest { testArray: [], opt: 0, graph: undefined, - deprecated: "" + deprecated: undefined }; } export const EvalRequest = { @@ -469,7 +469,7 @@ export const EvalRequest = { if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -617,7 +617,7 @@ export const EvalRequest = { if (object.graph !== undefined && object.graph !== null) { message.graph = TestNest_Graph.fromPartial(object.graph); } - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -669,7 +669,7 @@ export const EvalRequest = { test_array: Array.isArray(object?.test_array) ? object.test_array.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromSDKJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toSDK(message: EvalRequest): EvalRequestSDKType { @@ -777,7 +777,7 @@ export const EvalRequest = { } obj.opt = message.opt ?? 0; obj.graph = message.graph ? TestNest_Graph.toAmino(message.graph) : undefined; - obj.deprecated = message.deprecated === "" ? undefined : message.deprecated; + obj.deprecated = message.deprecated === null ? undefined : message.deprecated; return obj; }, fromAminoMsg(object: EvalRequestAminoMsg): EvalRequest { diff --git a/__fixtures__/misc/output-decimals/agoric/misc/eval_request.ts b/__fixtures__/misc/output-decimals/agoric/misc/eval_request.ts index 881c09e02..711589138 100644 --- a/__fixtures__/misc/output-decimals/agoric/misc/eval_request.ts +++ b/__fixtures__/misc/output-decimals/agoric/misc/eval_request.ts @@ -123,7 +123,7 @@ export interface EvalRequest { opt: FeatureSet_Utf8Validation; graph?: TestNest_Graph; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestProtoMsg { typeUrl: "/misc.EvalRequest"; @@ -173,7 +173,7 @@ export interface EvalRequestSDKType { test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; } export interface AccessConfig { sender: string; @@ -424,7 +424,7 @@ function createBaseEvalRequest(): EvalRequest { testArray: [], opt: 0, graph: undefined, - deprecated: "" + deprecated: undefined }; } export const EvalRequest = { @@ -469,7 +469,7 @@ export const EvalRequest = { if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -617,7 +617,7 @@ export const EvalRequest = { if (object.graph !== undefined && object.graph !== null) { message.graph = TestNest_Graph.fromPartial(object.graph); } - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -669,7 +669,7 @@ export const EvalRequest = { test_array: Array.isArray(object?.test_array) ? object.test_array.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromSDKJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toSDK(message: EvalRequest): EvalRequestSDKType { @@ -777,7 +777,7 @@ export const EvalRequest = { } obj.opt = message.opt ?? 0; obj.graph = message.graph ? TestNest_Graph.toAmino(message.graph) : undefined; - obj.deprecated = message.deprecated === "" ? undefined : message.deprecated; + obj.deprecated = message.deprecated === null ? undefined : message.deprecated; return obj; }, fromAminoMsg(object: EvalRequestAminoMsg): EvalRequest { diff --git a/__fixtures__/misc/output-proto-amino/amino-interface-proto-optionality/misc/eval_request.ts b/__fixtures__/misc/output-proto-amino/amino-interface-proto-optionality/misc/eval_request.ts index e6b3c0865..24272378f 100644 --- a/__fixtures__/misc/output-proto-amino/amino-interface-proto-optionality/misc/eval_request.ts +++ b/__fixtures__/misc/output-proto-amino/amino-interface-proto-optionality/misc/eval_request.ts @@ -124,7 +124,7 @@ export interface EvalRequest { opt: FeatureSet_Utf8Validation; graph?: TestNest_Graph; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestProtoMsg { typeUrl: "/misc.EvalRequest"; @@ -152,7 +152,7 @@ export interface EvalRequestAmino { opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphAmino; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestAminoMsg { type: "/misc.EvalRequest"; @@ -174,7 +174,7 @@ export interface EvalRequestSDKType { test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; } export interface AccessConfig { sender: string; @@ -427,19 +427,19 @@ function createBaseEvalRequest(): EvalRequest { testArray: [], opt: 0, graph: undefined, - deprecated: "" + deprecated: undefined }; } export const EvalRequest = { typeUrl: "/misc.EvalRequest", is(o: any): o is EvalRequest { - return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.testNum === "number" && typeof o.testString === "string" && typeof o.testBool === "boolean" && Array.isArray(o.testArray) && (!o.testArray.length || typeof o.testArray[0] === "string") && isSet(o.opt) && typeof o.deprecated === "string"); + return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.testNum === "number" && typeof o.testString === "string" && typeof o.testBool === "boolean" && Array.isArray(o.testArray) && (!o.testArray.length || typeof o.testArray[0] === "string") && isSet(o.opt)); }, isSDK(o: any): o is EvalRequestSDKType { - return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt) && typeof o.deprecated === "string"); + return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt)); }, isAmino(o: any): o is EvalRequestAmino { - return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt) && typeof o.deprecated === "string"); + return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt)); }, encode(message: EvalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { Object.entries(message.bindings).forEach(([key, value]) => { @@ -481,7 +481,7 @@ export const EvalRequest = { if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -629,7 +629,7 @@ export const EvalRequest = { if (object.graph !== undefined && object.graph !== null) { message.graph = TestNest_Graph.fromPartial(object.graph); } - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -681,7 +681,7 @@ export const EvalRequest = { test_array: Array.isArray(object?.test_array) ? object.test_array.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromSDKJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toSDK(message: EvalRequest): EvalRequestSDKType { @@ -789,7 +789,7 @@ export const EvalRequest = { } obj.opt = message.opt ?? 0; obj.graph = message.graph ? TestNest_Graph.toAmino(message.graph) : undefined; - obj.deprecated = message.deprecated === "" ? undefined : message.deprecated; + obj.deprecated = message.deprecated === null ? undefined : message.deprecated; return obj; }, fromAminoMsg(object: EvalRequestAminoMsg): EvalRequest { diff --git a/__fixtures__/misc/output-proto-amino/amino-interface/misc/eval_request.ts b/__fixtures__/misc/output-proto-amino/amino-interface/misc/eval_request.ts index dd755efba..3f20e6058 100644 --- a/__fixtures__/misc/output-proto-amino/amino-interface/misc/eval_request.ts +++ b/__fixtures__/misc/output-proto-amino/amino-interface/misc/eval_request.ts @@ -124,7 +124,7 @@ export interface EvalRequest { opt: FeatureSet_Utf8Validation; graph?: TestNest_Graph; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestProtoMsg { typeUrl: "/misc.EvalRequest"; @@ -174,7 +174,7 @@ export interface EvalRequestSDKType { test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; } export interface AccessConfig { sender: string; @@ -427,19 +427,19 @@ function createBaseEvalRequest(): EvalRequest { testArray: [], opt: 0, graph: undefined, - deprecated: "" + deprecated: undefined }; } export const EvalRequest = { typeUrl: "/misc.EvalRequest", is(o: any): o is EvalRequest { - return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.testNum === "number" && typeof o.testString === "string" && typeof o.testBool === "boolean" && Array.isArray(o.testArray) && (!o.testArray.length || typeof o.testArray[0] === "string") && isSet(o.opt) && typeof o.deprecated === "string"); + return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.testNum === "number" && typeof o.testString === "string" && typeof o.testBool === "boolean" && Array.isArray(o.testArray) && (!o.testArray.length || typeof o.testArray[0] === "string") && isSet(o.opt)); }, isSDK(o: any): o is EvalRequestSDKType { - return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt) && typeof o.deprecated === "string"); + return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt)); }, isAmino(o: any): o is EvalRequestAmino { - return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt) && typeof o.deprecated === "string"); + return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt)); }, encode(message: EvalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { Object.entries(message.bindings).forEach(([key, value]) => { @@ -481,7 +481,7 @@ export const EvalRequest = { if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -629,7 +629,7 @@ export const EvalRequest = { if (object.graph !== undefined && object.graph !== null) { message.graph = TestNest_Graph.fromPartial(object.graph); } - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -681,7 +681,7 @@ export const EvalRequest = { test_array: Array.isArray(object?.test_array) ? object.test_array.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromSDKJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toSDK(message: EvalRequest): EvalRequestSDKType { @@ -789,7 +789,7 @@ export const EvalRequest = { } obj.opt = message.opt ?? 0; obj.graph = message.graph ? TestNest_Graph.toAmino(message.graph) : undefined; - obj.deprecated = message.deprecated === "" ? undefined : message.deprecated; + obj.deprecated = message.deprecated === null ? undefined : message.deprecated; return obj; }, fromAminoMsg(object: EvalRequestAminoMsg): EvalRequest { diff --git a/__fixtures__/misc/output-proto-amino/amino-legacy/misc/eval_request.ts b/__fixtures__/misc/output-proto-amino/amino-legacy/misc/eval_request.ts index 842859c8c..6f53d88c6 100644 --- a/__fixtures__/misc/output-proto-amino/amino-legacy/misc/eval_request.ts +++ b/__fixtures__/misc/output-proto-amino/amino-legacy/misc/eval_request.ts @@ -106,7 +106,7 @@ export interface EvalRequest { opt: FeatureSet_Utf8Validation; graph?: TestNest_Graph; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestProtoMsg { typeUrl: "/misc.EvalRequest"; @@ -128,7 +128,7 @@ export interface EvalRequestSDKType { test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; } export interface AccessConfig { sender: string; @@ -364,7 +364,7 @@ function createBaseEvalRequest(): EvalRequest { testArray: [], opt: 0, graph: undefined, - deprecated: "" + deprecated: undefined }; } export const EvalRequest = { @@ -409,7 +409,7 @@ export const EvalRequest = { if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -557,7 +557,7 @@ export const EvalRequest = { if (object.graph !== undefined && object.graph !== null) { message.graph = TestNest_Graph.fromPartial(object.graph); } - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -609,7 +609,7 @@ export const EvalRequest = { test_array: Array.isArray(object?.test_array) ? object.test_array.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromSDKJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toSDK(message: EvalRequest): EvalRequestSDKType { @@ -717,7 +717,7 @@ export const EvalRequest = { } obj.opt = message.opt ?? 0; obj.graph = message.graph ? TestNest_Graph.toAmino(message.graph) : undefined; - obj.deprecated = message.deprecated === "" ? undefined : message.deprecated; + obj.deprecated = message.deprecated === null ? undefined : message.deprecated; return obj; }, fromAminoMsg(object: EvalRequestAminoMsg): EvalRequest { diff --git a/__fixtures__/misc/output-proto-amino/amino-msg-no-func/misc/eval_request.ts b/__fixtures__/misc/output-proto-amino/amino-msg-no-func/misc/eval_request.ts index 881c09e02..711589138 100644 --- a/__fixtures__/misc/output-proto-amino/amino-msg-no-func/misc/eval_request.ts +++ b/__fixtures__/misc/output-proto-amino/amino-msg-no-func/misc/eval_request.ts @@ -123,7 +123,7 @@ export interface EvalRequest { opt: FeatureSet_Utf8Validation; graph?: TestNest_Graph; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestProtoMsg { typeUrl: "/misc.EvalRequest"; @@ -173,7 +173,7 @@ export interface EvalRequestSDKType { test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; } export interface AccessConfig { sender: string; @@ -424,7 +424,7 @@ function createBaseEvalRequest(): EvalRequest { testArray: [], opt: 0, graph: undefined, - deprecated: "" + deprecated: undefined }; } export const EvalRequest = { @@ -469,7 +469,7 @@ export const EvalRequest = { if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -617,7 +617,7 @@ export const EvalRequest = { if (object.graph !== undefined && object.graph !== null) { message.graph = TestNest_Graph.fromPartial(object.graph); } - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -669,7 +669,7 @@ export const EvalRequest = { test_array: Array.isArray(object?.test_array) ? object.test_array.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromSDKJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toSDK(message: EvalRequest): EvalRequestSDKType { @@ -777,7 +777,7 @@ export const EvalRequest = { } obj.opt = message.opt ?? 0; obj.graph = message.graph ? TestNest_Graph.toAmino(message.graph) : undefined; - obj.deprecated = message.deprecated === "" ? undefined : message.deprecated; + obj.deprecated = message.deprecated === null ? undefined : message.deprecated; return obj; }, fromAminoMsg(object: EvalRequestAminoMsg): EvalRequest { diff --git a/__fixtures__/misc/output-proto-amino/amino-msg-with-func/misc/eval_request.ts b/__fixtures__/misc/output-proto-amino/amino-msg-with-func/misc/eval_request.ts index c21595a52..2201c5b6d 100644 --- a/__fixtures__/misc/output-proto-amino/amino-msg-with-func/misc/eval_request.ts +++ b/__fixtures__/misc/output-proto-amino/amino-msg-with-func/misc/eval_request.ts @@ -123,7 +123,7 @@ export interface EvalRequest { opt: FeatureSet_Utf8Validation; graph?: TestNest_Graph; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestProtoMsg { typeUrl: "/misc.EvalRequest"; @@ -173,7 +173,7 @@ export interface EvalRequestSDKType { test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; } export interface AccessConfig { sender: string; @@ -424,7 +424,7 @@ function createBaseEvalRequest(): EvalRequest { testArray: [], opt: -2, graph: undefined, - deprecated: "" + deprecated: undefined }; } export const EvalRequest = { @@ -469,7 +469,7 @@ export const EvalRequest = { if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -617,7 +617,7 @@ export const EvalRequest = { if (object.graph !== undefined && object.graph !== null) { message.graph = TestNest_Graph.fromPartial(object.graph); } - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -669,7 +669,7 @@ export const EvalRequest = { test_array: Array.isArray(object?.test_array) ? object.test_array.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromSDKJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toSDK(message: EvalRequest): EvalRequestSDKType { @@ -777,7 +777,7 @@ export const EvalRequest = { } obj.opt = message.opt ?? -2; obj.graph = message.graph ? TestNest_Graph.toAmino(message.graph) : undefined; - obj.deprecated = message.deprecated === "" ? undefined : message.deprecated; + obj.deprecated = message.deprecated === null ? undefined : message.deprecated; return obj; }, fromAminoMsg(object: EvalRequestAminoMsg): EvalRequest { diff --git a/__fixtures__/misc/output-proto-amino/amino-no-msg-with-func/misc/eval_request.ts b/__fixtures__/misc/output-proto-amino/amino-no-msg-with-func/misc/eval_request.ts index 6dff6f2c2..c66a66d7e 100644 --- a/__fixtures__/misc/output-proto-amino/amino-no-msg-with-func/misc/eval_request.ts +++ b/__fixtures__/misc/output-proto-amino/amino-no-msg-with-func/misc/eval_request.ts @@ -115,7 +115,7 @@ export interface EvalRequest { opt: FeatureSet_Utf8Validation; graph?: TestNest_Graph; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestProtoMsg { typeUrl: "/misc.EvalRequest"; @@ -161,7 +161,7 @@ export interface EvalRequestSDKType { test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; } export interface AccessConfig { sender: string; @@ -398,7 +398,7 @@ function createBaseEvalRequest(): EvalRequest { testArray: [], opt: 0, graph: undefined, - deprecated: "" + deprecated: undefined }; } export const EvalRequest = { @@ -443,7 +443,7 @@ export const EvalRequest = { if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -591,7 +591,7 @@ export const EvalRequest = { if (object.graph !== undefined && object.graph !== null) { message.graph = TestNest_Graph.fromPartial(object.graph); } - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -643,7 +643,7 @@ export const EvalRequest = { test_array: Array.isArray(object?.test_array) ? object.test_array.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromSDKJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toSDK(message: EvalRequest): EvalRequestSDKType { @@ -751,7 +751,7 @@ export const EvalRequest = { } obj.opt = message.opt ?? 0; obj.graph = message.graph ? TestNest_Graph.toAmino(message.graph) : undefined; - obj.deprecated = message.deprecated === "" ? undefined : message.deprecated; + obj.deprecated = message.deprecated === null ? undefined : message.deprecated; return obj; }, fromProtoMsg(message: EvalRequestProtoMsg): EvalRequest { diff --git a/__fixtures__/misc/output-proto-amino/no-amino-legacy-no-proto/misc/eval_request.ts b/__fixtures__/misc/output-proto-amino/no-amino-legacy-no-proto/misc/eval_request.ts index b67de10f1..25ffcc212 100644 --- a/__fixtures__/misc/output-proto-amino/no-amino-legacy-no-proto/misc/eval_request.ts +++ b/__fixtures__/misc/output-proto-amino/no-amino-legacy-no-proto/misc/eval_request.ts @@ -98,7 +98,7 @@ export interface EvalRequest { opt: FeatureSet_Utf8Validation; graph?: TestNest_Graph; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestSDKType { bindings: { @@ -116,7 +116,7 @@ export interface EvalRequestSDKType { test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; } export interface AccessConfig { sender: string; @@ -294,7 +294,7 @@ function createBaseEvalRequest(): EvalRequest { testArray: [], opt: 0, graph: undefined, - deprecated: "" + deprecated: undefined }; } export const EvalRequest = { @@ -339,7 +339,7 @@ export const EvalRequest = { if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -487,7 +487,7 @@ export const EvalRequest = { if (object.graph !== undefined && object.graph !== null) { message.graph = TestNest_Graph.fromPartial(object.graph); } - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -539,7 +539,7 @@ export const EvalRequest = { test_array: Array.isArray(object?.test_array) ? object.test_array.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromSDKJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toSDK(message: EvalRequest): EvalRequestSDKType { diff --git a/__fixtures__/misc/output-proto-amino/no-amino-legacy/misc/eval_request.ts b/__fixtures__/misc/output-proto-amino/no-amino-legacy/misc/eval_request.ts index 842859c8c..6f53d88c6 100644 --- a/__fixtures__/misc/output-proto-amino/no-amino-legacy/misc/eval_request.ts +++ b/__fixtures__/misc/output-proto-amino/no-amino-legacy/misc/eval_request.ts @@ -106,7 +106,7 @@ export interface EvalRequest { opt: FeatureSet_Utf8Validation; graph?: TestNest_Graph; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestProtoMsg { typeUrl: "/misc.EvalRequest"; @@ -128,7 +128,7 @@ export interface EvalRequestSDKType { test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; } export interface AccessConfig { sender: string; @@ -364,7 +364,7 @@ function createBaseEvalRequest(): EvalRequest { testArray: [], opt: 0, graph: undefined, - deprecated: "" + deprecated: undefined }; } export const EvalRequest = { @@ -409,7 +409,7 @@ export const EvalRequest = { if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -557,7 +557,7 @@ export const EvalRequest = { if (object.graph !== undefined && object.graph !== null) { message.graph = TestNest_Graph.fromPartial(object.graph); } - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -609,7 +609,7 @@ export const EvalRequest = { test_array: Array.isArray(object?.test_array) ? object.test_array.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromSDKJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toSDK(message: EvalRequest): EvalRequestSDKType { @@ -717,7 +717,7 @@ export const EvalRequest = { } obj.opt = message.opt ?? 0; obj.graph = message.graph ? TestNest_Graph.toAmino(message.graph) : undefined; - obj.deprecated = message.deprecated === "" ? undefined : message.deprecated; + obj.deprecated = message.deprecated === null ? undefined : message.deprecated; return obj; }, fromAminoMsg(object: EvalRequestAminoMsg): EvalRequest { diff --git a/__fixtures__/misc/output-proto-amino/no-amino-no-proto/misc/eval_request.ts b/__fixtures__/misc/output-proto-amino/no-amino-no-proto/misc/eval_request.ts index b67de10f1..25ffcc212 100644 --- a/__fixtures__/misc/output-proto-amino/no-amino-no-proto/misc/eval_request.ts +++ b/__fixtures__/misc/output-proto-amino/no-amino-no-proto/misc/eval_request.ts @@ -98,7 +98,7 @@ export interface EvalRequest { opt: FeatureSet_Utf8Validation; graph?: TestNest_Graph; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestSDKType { bindings: { @@ -116,7 +116,7 @@ export interface EvalRequestSDKType { test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; } export interface AccessConfig { sender: string; @@ -294,7 +294,7 @@ function createBaseEvalRequest(): EvalRequest { testArray: [], opt: 0, graph: undefined, - deprecated: "" + deprecated: undefined }; } export const EvalRequest = { @@ -339,7 +339,7 @@ export const EvalRequest = { if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -487,7 +487,7 @@ export const EvalRequest = { if (object.graph !== undefined && object.graph !== null) { message.graph = TestNest_Graph.fromPartial(object.graph); } - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -539,7 +539,7 @@ export const EvalRequest = { test_array: Array.isArray(object?.test_array) ? object.test_array.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromSDKJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toSDK(message: EvalRequest): EvalRequestSDKType { diff --git a/__fixtures__/misc/output-proto-amino/no-amino/misc/eval_request.ts b/__fixtures__/misc/output-proto-amino/no-amino/misc/eval_request.ts index 842859c8c..6f53d88c6 100644 --- a/__fixtures__/misc/output-proto-amino/no-amino/misc/eval_request.ts +++ b/__fixtures__/misc/output-proto-amino/no-amino/misc/eval_request.ts @@ -106,7 +106,7 @@ export interface EvalRequest { opt: FeatureSet_Utf8Validation; graph?: TestNest_Graph; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestProtoMsg { typeUrl: "/misc.EvalRequest"; @@ -128,7 +128,7 @@ export interface EvalRequestSDKType { test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; } export interface AccessConfig { sender: string; @@ -364,7 +364,7 @@ function createBaseEvalRequest(): EvalRequest { testArray: [], opt: 0, graph: undefined, - deprecated: "" + deprecated: undefined }; } export const EvalRequest = { @@ -409,7 +409,7 @@ export const EvalRequest = { if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -557,7 +557,7 @@ export const EvalRequest = { if (object.graph !== undefined && object.graph !== null) { message.graph = TestNest_Graph.fromPartial(object.graph); } - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -609,7 +609,7 @@ export const EvalRequest = { test_array: Array.isArray(object?.test_array) ? object.test_array.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromSDKJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toSDK(message: EvalRequest): EvalRequestSDKType { @@ -717,7 +717,7 @@ export const EvalRequest = { } obj.opt = message.opt ?? 0; obj.graph = message.graph ? TestNest_Graph.toAmino(message.graph) : undefined; - obj.deprecated = message.deprecated === "" ? undefined : message.deprecated; + obj.deprecated = message.deprecated === null ? undefined : message.deprecated; return obj; }, fromAminoMsg(object: EvalRequestAminoMsg): EvalRequest { diff --git a/__fixtures__/misc/output-proto-amino/proto-only-legacy/misc/eval_request.ts b/__fixtures__/misc/output-proto-amino/proto-only-legacy/misc/eval_request.ts index aae9bbf0e..f736b6f53 100644 --- a/__fixtures__/misc/output-proto-amino/proto-only-legacy/misc/eval_request.ts +++ b/__fixtures__/misc/output-proto-amino/proto-only-legacy/misc/eval_request.ts @@ -106,7 +106,7 @@ export interface EvalRequest { opt: FeatureSet_Utf8Validation; graph?: TestNest_Graph; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestProtoMsg { typeUrl: "/misc.EvalRequest"; @@ -128,7 +128,7 @@ export interface EvalRequestSDKType { test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; } export interface AccessConfig { sender: string; @@ -326,7 +326,7 @@ function createBaseEvalRequest(): EvalRequest { testArray: [], opt: 0, graph: undefined, - deprecated: "" + deprecated: undefined }; } export const EvalRequest = { @@ -371,7 +371,7 @@ export const EvalRequest = { if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -519,7 +519,7 @@ export const EvalRequest = { if (object.graph !== undefined && object.graph !== null) { message.graph = TestNest_Graph.fromPartial(object.graph); } - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -571,7 +571,7 @@ export const EvalRequest = { test_array: Array.isArray(object?.test_array) ? object.test_array.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromSDKJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toSDK(message: EvalRequest): EvalRequestSDKType { diff --git a/__fixtures__/misc/output-proto-amino/proto-only/misc/eval_request.ts b/__fixtures__/misc/output-proto-amino/proto-only/misc/eval_request.ts index aae9bbf0e..f736b6f53 100644 --- a/__fixtures__/misc/output-proto-amino/proto-only/misc/eval_request.ts +++ b/__fixtures__/misc/output-proto-amino/proto-only/misc/eval_request.ts @@ -106,7 +106,7 @@ export interface EvalRequest { opt: FeatureSet_Utf8Validation; graph?: TestNest_Graph; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestProtoMsg { typeUrl: "/misc.EvalRequest"; @@ -128,7 +128,7 @@ export interface EvalRequestSDKType { test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; } export interface AccessConfig { sender: string; @@ -326,7 +326,7 @@ function createBaseEvalRequest(): EvalRequest { testArray: [], opt: 0, graph: undefined, - deprecated: "" + deprecated: undefined }; } export const EvalRequest = { @@ -371,7 +371,7 @@ export const EvalRequest = { if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -519,7 +519,7 @@ export const EvalRequest = { if (object.graph !== undefined && object.graph !== null) { message.graph = TestNest_Graph.fromPartial(object.graph); } - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -571,7 +571,7 @@ export const EvalRequest = { test_array: Array.isArray(object?.test_array) ? object.test_array.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromSDKJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toSDK(message: EvalRequest): EvalRequestSDKType { diff --git a/__fixtures__/misc/output/misc/eval_request.ts b/__fixtures__/misc/output/misc/eval_request.ts index 881c09e02..711589138 100644 --- a/__fixtures__/misc/output/misc/eval_request.ts +++ b/__fixtures__/misc/output/misc/eval_request.ts @@ -123,7 +123,7 @@ export interface EvalRequest { opt: FeatureSet_Utf8Validation; graph?: TestNest_Graph; /** deprecated option */ - deprecated: string; + deprecated?: string; } export interface EvalRequestProtoMsg { typeUrl: "/misc.EvalRequest"; @@ -173,7 +173,7 @@ export interface EvalRequestSDKType { test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; } export interface AccessConfig { sender: string; @@ -424,7 +424,7 @@ function createBaseEvalRequest(): EvalRequest { testArray: [], opt: 0, graph: undefined, - deprecated: "" + deprecated: undefined }; } export const EvalRequest = { @@ -469,7 +469,7 @@ export const EvalRequest = { if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -617,7 +617,7 @@ export const EvalRequest = { if (object.graph !== undefined && object.graph !== null) { message.graph = TestNest_Graph.fromPartial(object.graph); } - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -669,7 +669,7 @@ export const EvalRequest = { test_array: Array.isArray(object?.test_array) ? object.test_array.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromSDKJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toSDK(message: EvalRequest): EvalRequestSDKType { @@ -777,7 +777,7 @@ export const EvalRequest = { } obj.opt = message.opt ?? 0; obj.graph = message.graph ? TestNest_Graph.toAmino(message.graph) : undefined; - obj.deprecated = message.deprecated === "" ? undefined : message.deprecated; + obj.deprecated = message.deprecated === null ? undefined : message.deprecated; return obj; }, fromAminoMsg(object: EvalRequestAminoMsg): EvalRequest { diff --git a/packages/ast/src/encoding/__tests__/__snapshots__/misc.overall.test.ts.snap b/packages/ast/src/encoding/__tests__/__snapshots__/misc.overall.test.ts.snap index 3eaf921d9..d328866cf 100644 --- a/packages/ast/src/encoding/__tests__/__snapshots__/misc.overall.test.ts.snap +++ b/packages/ast/src/encoding/__tests__/__snapshots__/misc.overall.test.ts.snap @@ -4,13 +4,13 @@ exports[`misc/eval_request date 1`] = ` "export const EvalRequest = { typeUrl: "/misc.EvalRequest", is(o: any): o is EvalRequest { - return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.testNum === "number" && typeof o.testString === "string" && typeof o.testBool === "boolean" && Array.isArray(o.testArray) && (!o.testArray.length || typeof o.testArray[0] === "string") && isSet(o.opt) && typeof o.deprecated === "string"); + return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.testNum === "number" && typeof o.testString === "string" && typeof o.testBool === "boolean" && Array.isArray(o.testArray) && (!o.testArray.length || typeof o.testArray[0] === "string") && isSet(o.opt)); }, isSDK(o: any): o is EvalRequestSDKType { - return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt) && typeof o.deprecated === "string"); + return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt)); }, isAmino(o: any): o is EvalRequestAmino { - return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt) && typeof o.deprecated === "string"); + return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt)); }, encode(message: EvalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { Object.entries(message.bindings).forEach(([key, value]) => { @@ -52,7 +52,7 @@ exports[`misc/eval_request date 1`] = ` if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -136,7 +136,7 @@ exports[`misc/eval_request date 1`] = ` testArray: Array.isArray(object?.testArray) ? object.testArray.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toJSON(message: EvalRequest): JsonSafe { @@ -196,7 +196,7 @@ exports[`misc/eval_request date 1`] = ` message.testArray = object.testArray?.map(e => e) || []; message.opt = object.opt ?? 0; message.graph = object.graph !== undefined && object.graph !== null ? TestNest_Graph.fromPartial(object.graph) : undefined; - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -330,7 +330,7 @@ exports[`misc/eval_request date 1`] = ` } obj.opt = message.opt ?? 0; obj.graph = message.graph ? TestNest_Graph.toAmino(message.graph) : undefined; - obj.deprecated = message.deprecated === "" ? undefined : message.deprecated; + obj.deprecated = message.deprecated === null ? undefined : message.deprecated; return obj; }, fromAminoMsg(object: EvalRequestAminoMsg): EvalRequest { @@ -355,13 +355,13 @@ exports[`misc/eval_request timestamp 1`] = ` "export const EvalRequest = { typeUrl: "/misc.EvalRequest", is(o: any): o is EvalRequest { - return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.testNum === "number" && typeof o.testString === "string" && typeof o.testBool === "boolean" && Array.isArray(o.testArray) && (!o.testArray.length || typeof o.testArray[0] === "string") && isSet(o.opt) && typeof o.deprecated === "string"); + return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.testNum === "number" && typeof o.testString === "string" && typeof o.testBool === "boolean" && Array.isArray(o.testArray) && (!o.testArray.length || typeof o.testArray[0] === "string") && isSet(o.opt)); }, isSDK(o: any): o is EvalRequestSDKType { - return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt) && typeof o.deprecated === "string"); + return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt)); }, isAmino(o: any): o is EvalRequestAmino { - return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt) && typeof o.deprecated === "string"); + return o && (o.$typeUrl === EvalRequest.typeUrl || isSet(o.bindings) && isSet(o.refs) && typeof o.test_num === "number" && typeof o.test_string === "string" && typeof o.test_bool === "boolean" && Array.isArray(o.test_array) && (!o.test_array.length || typeof o.test_array[0] === "string") && isSet(o.opt)); }, encode(message: EvalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { Object.entries(message.bindings).forEach(([key, value]) => { @@ -403,7 +403,7 @@ exports[`misc/eval_request timestamp 1`] = ` if (message.graph !== undefined) { TestNest_Graph.encode(message.graph, writer.uint32(130).fork()).ldelim(); } - if (message.deprecated !== "") { + if (message.deprecated !== undefined) { writer.uint32(138).string(message.deprecated); } return writer; @@ -487,7 +487,7 @@ exports[`misc/eval_request timestamp 1`] = ` testArray: Array.isArray(object?.testArray) ? object.testArray.map((e: any) => String(e)) : [], opt: isSet(object.opt) ? featureSet_Utf8ValidationFromJSON(object.opt) : -1, graph: isSet(object.graph) ? TestNest_Graph.fromJSON(object.graph) : undefined, - deprecated: isSet(object.deprecated) ? String(object.deprecated) : "" + deprecated: isSet(object.deprecated) ? String(object.deprecated) : undefined }; }, toJSON(message: EvalRequest): JsonSafe { @@ -547,7 +547,7 @@ exports[`misc/eval_request timestamp 1`] = ` message.testArray = object.testArray?.map(e => e) || []; message.opt = object.opt ?? 0; message.graph = object.graph !== undefined && object.graph !== null ? TestNest_Graph.fromPartial(object.graph) : undefined; - message.deprecated = object.deprecated ?? ""; + message.deprecated = object.deprecated ?? undefined; return message; }, fromSDK(object: EvalRequestSDKType): EvalRequest { @@ -681,7 +681,7 @@ exports[`misc/eval_request timestamp 1`] = ` } obj.opt = message.opt ?? 0; obj.graph = message.graph ? TestNest_Graph.toAmino(message.graph) : undefined; - obj.deprecated = message.deprecated === "" ? undefined : message.deprecated; + obj.deprecated = message.deprecated === null ? undefined : message.deprecated; return obj; }, fromAminoMsg(object: EvalRequestAminoMsg): EvalRequest { diff --git a/packages/ast/src/encoding/proto/__snapshots__/proto.type.spec.ts.snap b/packages/ast/src/encoding/proto/__snapshots__/proto.type.spec.ts.snap index da90a6afb..eeb850df7 100644 --- a/packages/ast/src/encoding/proto/__snapshots__/proto.type.spec.ts.snap +++ b/packages/ast/src/encoding/proto/__snapshots__/proto.type.spec.ts.snap @@ -280,7 +280,7 @@ exports[`traversed misc/eval_request SDKType 1`] = ` test_array: string[]; opt: FeatureSet_Utf8Validation; graph?: TestNest_GraphSDKType; - deprecated: string; + deprecated?: string; }" `; diff --git a/packages/ast/src/encoding/proto/types.ts b/packages/ast/src/encoding/proto/types.ts index 187ccaa32..aa4d1f6a6 100644 --- a/packages/ast/src/encoding/proto/types.ts +++ b/packages/ast/src/encoding/proto/types.ts @@ -170,8 +170,8 @@ export const getFieldOptionality = ( ) => { const isScalarDefaultToNullable = context.pluginValue('prototypes.isScalarDefaultToNullable'); - if(field?.options?.['(gogoproto.moretags)'] && getOptionDeprecated(field?.options?.['(gogoproto.moretags)']) === 'false'){ - return false + if(field?.options?.['(gogoproto.moretags)'] && getOptionDeprecated(field?.options?.['(gogoproto.moretags)']) === 'true'){ + return true } if (isArrayField(field) || isEnumField(field) || (!isScalarDefaultToNullable && isScalarField(field))) { @@ -191,9 +191,8 @@ export const getFieldOptionalityForAmino = ( isOneOf: boolean ) => { const useProtoOptionality = context.pluginValue('aminoEncoding.useProtoOptionality'); - - if(field?.options?.['(gogoproto.moretags)'] && getOptionDeprecated(field?.options?.['(gogoproto.moretags)']) === 'false'){ - return false + if(field?.options?.['(gogoproto.moretags)'] && getOptionDeprecated(field?.options?.['(gogoproto.moretags)']) === 'true'){ + return true } if(useProtoOptionality){ @@ -240,8 +239,8 @@ export const getFieldOptionalityForDefaults = ( const useOptionalNullable = context.pluginValue('prototypes.useOptionalNullable'); const isScalarDefaultToNullable = !field?.options?.['(gogoproto.nullable)'] && context.pluginValue('prototypes.isScalarDefaultToNullable'); - if(field?.options?.['(gogoproto.moretags)'] && getOptionDeprecated(field?.options?.['(gogoproto.moretags)']) === 'false'){ - return false + if(field?.options?.['(gogoproto.moretags)'] && getOptionDeprecated(field?.options?.['(gogoproto.moretags)']) === 'true'){ + return true } if (isArrayField(field) || isEnumField(field) || !isScalarDefaultToNullable && isScalarField(field) || isMapField(field)) { @@ -277,7 +276,7 @@ export const getFieldOptionalityForDefaults = ( */ export const getOptionDeprecated = (input: string) =>{ // Regular expression to match deprecated value with optional spaces - const deprecatedRegex = /deprecated:\s*"(true|false)"/; + const deprecatedRegex = /\s*deprecated:\s*(true|false)\s*/; // Extract the deprecated value const match = input.match(deprecatedRegex);