Skip to content

Commit

Permalink
Format main.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
akrennmair committed Dec 2, 2024
1 parent 1a15e45 commit 7ef264e
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,11 @@ export function generateFile(ctx: Context, fileDesc: FileDescriptorProto): [stri

// Only decode, fromPartial, and wrap use the createBase method
if (
(
options.outputEncodeMethods &&
(options.outputEncodeMethods &&
options.outputEncodeMethods !== "encode-no-creation" &&
options.outputEncodeMethods !== "encode-only" &&
(options.outputDecodeIncludeTypes === "" || new RegExp(options.outputDecodeIncludeTypes).test(fullTypeName))
) ||
(options.outputDecodeIncludeTypes === "" ||
new RegExp(options.outputDecodeIncludeTypes).test(fullTypeName))) ||
options.outputPartialMethods ||
outputWrapAndUnwrap
) {
Expand All @@ -239,11 +238,14 @@ export function generateFile(ctx: Context, fileDesc: FileDescriptorProto): [stri

if (options.outputEncodeMethods) {
if (
(options.outputEncodeMethods === true ||
options.outputEncodeMethods === "encode-only" ||
options.outputEncodeMethods === "encode-no-creation")
options.outputEncodeMethods === true ||
options.outputEncodeMethods === "encode-only" ||
options.outputEncodeMethods === "encode-no-creation"
) {
if (options.outputEncodeIncludeTypes === "" || new RegExp(options.outputEncodeIncludeTypes).test(fullTypeName)) {
if (
options.outputEncodeIncludeTypes === "" ||
new RegExp(options.outputEncodeIncludeTypes).test(fullTypeName)
) {
staticMembers.push(generateEncode(ctx, fullName, message));

if (options.outputExtensions && options.unknownFields && message.extensionRange.length) {
Expand All @@ -255,7 +257,10 @@ export function generateFile(ctx: Context, fileDesc: FileDescriptorProto): [stri
}

if (options.outputEncodeMethods === true || options.outputEncodeMethods === "decode-only") {
if (options.outputDecodeIncludeTypes === "" || new RegExp(options.outputDecodeIncludeTypes).test(fullTypeName)) {
if (
options.outputDecodeIncludeTypes === "" ||
new RegExp(options.outputDecodeIncludeTypes).test(fullTypeName)
) {
staticMembers.push(generateDecode(ctx, fullName, message));

if (options.outputExtensions && options.unknownFields && message.extensionRange.length) {
Expand Down

0 comments on commit 7ef264e

Please sign in to comment.