Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix indentation. #87

Merged
merged 1 commit into from
Feb 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build/lib/template/partial/message.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
{{~/is~}}
{{~/if~}}{{!-- repeat end --}}
{{~/if~}}{{!-- map spec end --}}

{{/each}}{{!-- fields end --}}
{{~#if message.oneofDeclList~}}{{!-- oneofDeclList start --}}
{{#each message.oneofDeclList}}
Expand Down
6 changes: 3 additions & 3 deletions build/lib/template/partial/oneof.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

{{{indent}}}export enum {{{oneofName}}}Case {
{{{indent}}} {{{oneofNameUpper}}}_NOT_SET = 0,
{{{indent}}}{{#each fields}}
{{{indent}}} {{{@key}}} = {{{this}}},
{{{indent}}}{{/each}}
{{#each fields ~}}
{{{../indent}}} {{{@key}}} = {{{this}}},
{{/each ~}}
{{{indent}}}{{curlyRight}}
39 changes: 5 additions & 34 deletions examples/build/grpc/proto/book_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ import * as jspb from "google-protobuf";
export class Book extends jspb.Message {
getIsbn(): number;
setIsbn(value: number): Book;

getTitle(): string;
setTitle(value: string): Book;

getAuthor(): string;
setAuthor(value: string): Book;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Book.AsObject;
static toObject(includeInstance: boolean, msg: Book): Book.AsObject;
Expand All @@ -39,7 +36,6 @@ export class GetBookRequest extends jspb.Message {
getIsbn(): number;
setIsbn(value: number): GetBookRequest;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetBookRequest.AsObject;
static toObject(includeInstance: boolean, msg: GetBookRequest): GetBookRequest.AsObject;
Expand All @@ -60,7 +56,6 @@ export class GetBookViaAuthor extends jspb.Message {
getAuthor(): string;
setAuthor(value: string): GetBookViaAuthor;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetBookViaAuthor.AsObject;
static toObject(includeInstance: boolean, msg: GetBookViaAuthor): GetBookViaAuthor.AsObject;
Expand All @@ -81,11 +76,9 @@ export class BookStore extends jspb.Message {
getName(): string;
setName(value: string): BookStore;


getBooksMap(): jspb.Map<number, string>;
clearBooksMap(): void;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): BookStore.AsObject;
static toObject(includeInstance: boolean, msg: BookStore): BookStore.AsObject;
Expand All @@ -107,17 +100,13 @@ export namespace BookStore {
export class SpecialCases extends jspb.Message {
getNormal(): string;
setNormal(value: string): SpecialCases;

getDefault(): string;
setDefault(value: string): SpecialCases;

getFunction(): string;
setFunction(value: string): SpecialCases;

getVar(): string;
setVar(value: string): SpecialCases;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): SpecialCases.AsObject;
static toObject(includeInstance: boolean, msg: SpecialCases): SpecialCases.AsObject;
Expand All @@ -144,25 +133,21 @@ export class OneOfSample extends jspb.Message {
getA1(): boolean;
setA1(value: boolean): OneOfSample;


hasB1(): boolean;
clearB1(): void;
getB1(): boolean;
setB1(value: boolean): OneOfSample;


hasA2(): boolean;
clearA2(): void;
getA2(): boolean;
setA2(value: boolean): OneOfSample;


hasB2(): boolean;
clearB2(): void;
getB2(): boolean;
setB2(value: boolean): OneOfSample;


getSinglewordCase(): OneOfSample.SinglewordCase;
getTwoWordsCase(): OneOfSample.TwoWordsCase;

Expand All @@ -186,20 +171,14 @@ export namespace OneOfSample {

export enum SinglewordCase {
SINGLEWORD_NOT_SET = 0,

A1 = 1,

B1 = 2,

A1 = 1,
B1 = 2,
}

export enum TwoWordsCase {
TWO_WORDS_NOT_SET = 0,

A_2 = 3,

B_2 = 4,

A_2 = 3,
B_2 = 4,
}

}
Expand All @@ -208,7 +187,6 @@ export class ExtMsgString extends jspb.Message {
getExtension$(): string;
setExtension$(value: string): ExtMsgString;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ExtMsgString.AsObject;
static toObject(includeInstance: boolean, msg: ExtMsgString): ExtMsgString.AsObject;
Expand All @@ -231,7 +209,6 @@ export class ExtMsgList extends jspb.Message {
setExtensionList(value: Array<string>): ExtMsgList;
addExtension$(value: string, index?: number): string;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ExtMsgList.AsObject;
static toObject(includeInstance: boolean, msg: ExtMsgList): ExtMsgList.AsObject;
Expand All @@ -254,7 +231,6 @@ export class ExtMsgByte extends jspb.Message {
getExtension_asB64(): string;
setExtension$(value: Uint8Array | string): ExtMsgByte;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ExtMsgByte.AsObject;
static toObject(includeInstance: boolean, msg: ExtMsgByte): ExtMsgByte.AsObject;
Expand All @@ -279,7 +255,6 @@ export class ExtMsgByteList extends jspb.Message {
setExtensionList(value: Array<Uint8Array | string>): ExtMsgByteList;
addExtension$(value: Uint8Array | string, index?: number): Uint8Array | string;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ExtMsgByteList.AsObject;
static toObject(includeInstance: boolean, msg: ExtMsgByteList): ExtMsgByteList.AsObject;
Expand All @@ -301,7 +276,6 @@ export class ExtMsgMap extends jspb.Message {
getExtensionMap(): jspb.Map<string, string>;
clearExtensionMap(): void;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ExtMsgMap.AsObject;
static toObject(includeInstance: boolean, msg: ExtMsgMap): ExtMsgMap.AsObject;
Expand All @@ -326,7 +300,6 @@ export class ExtMsgOneOf extends jspb.Message {
getExtension$(): string;
setExtension$(value: string): ExtMsgOneOf;


getExtCase(): ExtMsgOneOf.ExtCase;

serializeBinary(): Uint8Array;
Expand All @@ -346,9 +319,7 @@ export namespace ExtMsgOneOf {

export enum ExtCase {
EXT_NOT_SET = 0,

EXTENSION = 1,

EXTENSION = 1,
}

}
Expand Down
39 changes: 5 additions & 34 deletions examples/build/grpcjs/proto/book_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ import * as jspb from "google-protobuf";
export class Book extends jspb.Message {
getIsbn(): number;
setIsbn(value: number): Book;

getTitle(): string;
setTitle(value: string): Book;

getAuthor(): string;
setAuthor(value: string): Book;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Book.AsObject;
static toObject(includeInstance: boolean, msg: Book): Book.AsObject;
Expand All @@ -39,7 +36,6 @@ export class GetBookRequest extends jspb.Message {
getIsbn(): number;
setIsbn(value: number): GetBookRequest;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetBookRequest.AsObject;
static toObject(includeInstance: boolean, msg: GetBookRequest): GetBookRequest.AsObject;
Expand All @@ -60,7 +56,6 @@ export class GetBookViaAuthor extends jspb.Message {
getAuthor(): string;
setAuthor(value: string): GetBookViaAuthor;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetBookViaAuthor.AsObject;
static toObject(includeInstance: boolean, msg: GetBookViaAuthor): GetBookViaAuthor.AsObject;
Expand All @@ -81,11 +76,9 @@ export class BookStore extends jspb.Message {
getName(): string;
setName(value: string): BookStore;


getBooksMap(): jspb.Map<number, string>;
clearBooksMap(): void;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): BookStore.AsObject;
static toObject(includeInstance: boolean, msg: BookStore): BookStore.AsObject;
Expand All @@ -107,17 +100,13 @@ export namespace BookStore {
export class SpecialCases extends jspb.Message {
getNormal(): string;
setNormal(value: string): SpecialCases;

getDefault(): string;
setDefault(value: string): SpecialCases;

getFunction(): string;
setFunction(value: string): SpecialCases;

getVar(): string;
setVar(value: string): SpecialCases;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): SpecialCases.AsObject;
static toObject(includeInstance: boolean, msg: SpecialCases): SpecialCases.AsObject;
Expand All @@ -144,25 +133,21 @@ export class OneOfSample extends jspb.Message {
getA1(): boolean;
setA1(value: boolean): OneOfSample;


hasB1(): boolean;
clearB1(): void;
getB1(): boolean;
setB1(value: boolean): OneOfSample;


hasA2(): boolean;
clearA2(): void;
getA2(): boolean;
setA2(value: boolean): OneOfSample;


hasB2(): boolean;
clearB2(): void;
getB2(): boolean;
setB2(value: boolean): OneOfSample;


getSinglewordCase(): OneOfSample.SinglewordCase;
getTwoWordsCase(): OneOfSample.TwoWordsCase;

Expand All @@ -186,20 +171,14 @@ export namespace OneOfSample {

export enum SinglewordCase {
SINGLEWORD_NOT_SET = 0,

A1 = 1,

B1 = 2,

A1 = 1,
B1 = 2,
}

export enum TwoWordsCase {
TWO_WORDS_NOT_SET = 0,

A_2 = 3,

B_2 = 4,

A_2 = 3,
B_2 = 4,
}

}
Expand All @@ -208,7 +187,6 @@ export class ExtMsgString extends jspb.Message {
getExtension$(): string;
setExtension$(value: string): ExtMsgString;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ExtMsgString.AsObject;
static toObject(includeInstance: boolean, msg: ExtMsgString): ExtMsgString.AsObject;
Expand All @@ -231,7 +209,6 @@ export class ExtMsgList extends jspb.Message {
setExtensionList(value: Array<string>): ExtMsgList;
addExtension$(value: string, index?: number): string;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ExtMsgList.AsObject;
static toObject(includeInstance: boolean, msg: ExtMsgList): ExtMsgList.AsObject;
Expand All @@ -254,7 +231,6 @@ export class ExtMsgByte extends jspb.Message {
getExtension_asB64(): string;
setExtension$(value: Uint8Array | string): ExtMsgByte;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ExtMsgByte.AsObject;
static toObject(includeInstance: boolean, msg: ExtMsgByte): ExtMsgByte.AsObject;
Expand All @@ -279,7 +255,6 @@ export class ExtMsgByteList extends jspb.Message {
setExtensionList(value: Array<Uint8Array | string>): ExtMsgByteList;
addExtension$(value: Uint8Array | string, index?: number): Uint8Array | string;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ExtMsgByteList.AsObject;
static toObject(includeInstance: boolean, msg: ExtMsgByteList): ExtMsgByteList.AsObject;
Expand All @@ -301,7 +276,6 @@ export class ExtMsgMap extends jspb.Message {
getExtensionMap(): jspb.Map<string, string>;
clearExtensionMap(): void;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ExtMsgMap.AsObject;
static toObject(includeInstance: boolean, msg: ExtMsgMap): ExtMsgMap.AsObject;
Expand All @@ -326,7 +300,6 @@ export class ExtMsgOneOf extends jspb.Message {
getExtension$(): string;
setExtension$(value: string): ExtMsgOneOf;


getExtCase(): ExtMsgOneOf.ExtCase;

serializeBinary(): Uint8Array;
Expand All @@ -346,9 +319,7 @@ export namespace ExtMsgOneOf {

export enum ExtCase {
EXT_NOT_SET = 0,

EXTENSION = 1,

EXTENSION = 1,
}

}
Expand Down
Loading