Skip to content

Commit 85caac5

Browse files
authored
Merge pull request #87 from agreatfool/fix-indentation
Fix indentation.
2 parents ad29ce4 + 54fcb7d commit 85caac5

File tree

8 files changed

+26
-144
lines changed

8 files changed

+26
-144
lines changed

build/lib/template/partial/message.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
{{~/is~}}
4040
{{~/if~}}{{!-- repeat end --}}
4141
{{~/if~}}{{!-- map spec end --}}
42-
4342
{{/each}}{{!-- fields end --}}
4443
{{~#if message.oneofDeclList~}}{{!-- oneofDeclList start --}}
4544
{{#each message.oneofDeclList}}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
{{{indent}}}export enum {{{oneofName}}}Case {
33
{{{indent}}} {{{oneofNameUpper}}}_NOT_SET = 0,
4-
{{{indent}}}{{#each fields}}
5-
{{{indent}}} {{{@key}}} = {{{this}}},
6-
{{{indent}}}{{/each}}
4+
{{#each fields ~}}
5+
{{{../indent}}} {{{@key}}} = {{{this}}},
6+
{{/each ~}}
77
{{{indent}}}{{curlyRight}}

examples/build/grpc/proto/book_pb.d.ts

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ import * as jspb from "google-protobuf";
99
export class Book extends jspb.Message {
1010
getIsbn(): number;
1111
setIsbn(value: number): Book;
12-
1312
getTitle(): string;
1413
setTitle(value: string): Book;
15-
1614
getAuthor(): string;
1715
setAuthor(value: string): Book;
1816

19-
2017
serializeBinary(): Uint8Array;
2118
toObject(includeInstance?: boolean): Book.AsObject;
2219
static toObject(includeInstance: boolean, msg: Book): Book.AsObject;
@@ -39,7 +36,6 @@ export class GetBookRequest extends jspb.Message {
3936
getIsbn(): number;
4037
setIsbn(value: number): GetBookRequest;
4138

42-
4339
serializeBinary(): Uint8Array;
4440
toObject(includeInstance?: boolean): GetBookRequest.AsObject;
4541
static toObject(includeInstance: boolean, msg: GetBookRequest): GetBookRequest.AsObject;
@@ -60,7 +56,6 @@ export class GetBookViaAuthor extends jspb.Message {
6056
getAuthor(): string;
6157
setAuthor(value: string): GetBookViaAuthor;
6258

63-
6459
serializeBinary(): Uint8Array;
6560
toObject(includeInstance?: boolean): GetBookViaAuthor.AsObject;
6661
static toObject(includeInstance: boolean, msg: GetBookViaAuthor): GetBookViaAuthor.AsObject;
@@ -81,11 +76,9 @@ export class BookStore extends jspb.Message {
8176
getName(): string;
8277
setName(value: string): BookStore;
8378

84-
8579
getBooksMap(): jspb.Map<number, string>;
8680
clearBooksMap(): void;
8781

88-
8982
serializeBinary(): Uint8Array;
9083
toObject(includeInstance?: boolean): BookStore.AsObject;
9184
static toObject(includeInstance: boolean, msg: BookStore): BookStore.AsObject;
@@ -107,17 +100,13 @@ export namespace BookStore {
107100
export class SpecialCases extends jspb.Message {
108101
getNormal(): string;
109102
setNormal(value: string): SpecialCases;
110-
111103
getDefault(): string;
112104
setDefault(value: string): SpecialCases;
113-
114105
getFunction(): string;
115106
setFunction(value: string): SpecialCases;
116-
117107
getVar(): string;
118108
setVar(value: string): SpecialCases;
119109

120-
121110
serializeBinary(): Uint8Array;
122111
toObject(includeInstance?: boolean): SpecialCases.AsObject;
123112
static toObject(includeInstance: boolean, msg: SpecialCases): SpecialCases.AsObject;
@@ -144,25 +133,21 @@ export class OneOfSample extends jspb.Message {
144133
getA1(): boolean;
145134
setA1(value: boolean): OneOfSample;
146135

147-
148136
hasB1(): boolean;
149137
clearB1(): void;
150138
getB1(): boolean;
151139
setB1(value: boolean): OneOfSample;
152140

153-
154141
hasA2(): boolean;
155142
clearA2(): void;
156143
getA2(): boolean;
157144
setA2(value: boolean): OneOfSample;
158145

159-
160146
hasB2(): boolean;
161147
clearB2(): void;
162148
getB2(): boolean;
163149
setB2(value: boolean): OneOfSample;
164150

165-
166151
getSinglewordCase(): OneOfSample.SinglewordCase;
167152
getTwoWordsCase(): OneOfSample.TwoWordsCase;
168153

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

187172
export enum SinglewordCase {
188173
SINGLEWORD_NOT_SET = 0,
189-
190-
A1 = 1,
191-
192-
B1 = 2,
193-
174+
A1 = 1,
175+
B1 = 2,
194176
}
195177

196178
export enum TwoWordsCase {
197179
TWO_WORDS_NOT_SET = 0,
198-
199-
A_2 = 3,
200-
201-
B_2 = 4,
202-
180+
A_2 = 3,
181+
B_2 = 4,
203182
}
204183

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

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

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

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

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

304-
305279
serializeBinary(): Uint8Array;
306280
toObject(includeInstance?: boolean): ExtMsgMap.AsObject;
307281
static toObject(includeInstance: boolean, msg: ExtMsgMap): ExtMsgMap.AsObject;
@@ -326,7 +300,6 @@ export class ExtMsgOneOf extends jspb.Message {
326300
getExtension$(): string;
327301
setExtension$(value: string): ExtMsgOneOf;
328302

329-
330303
getExtCase(): ExtMsgOneOf.ExtCase;
331304

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

347320
export enum ExtCase {
348321
EXT_NOT_SET = 0,
349-
350-
EXTENSION = 1,
351-
322+
EXTENSION = 1,
352323
}
353324

354325
}

examples/build/grpcjs/proto/book_pb.d.ts

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ import * as jspb from "google-protobuf";
99
export class Book extends jspb.Message {
1010
getIsbn(): number;
1111
setIsbn(value: number): Book;
12-
1312
getTitle(): string;
1413
setTitle(value: string): Book;
15-
1614
getAuthor(): string;
1715
setAuthor(value: string): Book;
1816

19-
2017
serializeBinary(): Uint8Array;
2118
toObject(includeInstance?: boolean): Book.AsObject;
2219
static toObject(includeInstance: boolean, msg: Book): Book.AsObject;
@@ -39,7 +36,6 @@ export class GetBookRequest extends jspb.Message {
3936
getIsbn(): number;
4037
setIsbn(value: number): GetBookRequest;
4138

42-
4339
serializeBinary(): Uint8Array;
4440
toObject(includeInstance?: boolean): GetBookRequest.AsObject;
4541
static toObject(includeInstance: boolean, msg: GetBookRequest): GetBookRequest.AsObject;
@@ -60,7 +56,6 @@ export class GetBookViaAuthor extends jspb.Message {
6056
getAuthor(): string;
6157
setAuthor(value: string): GetBookViaAuthor;
6258

63-
6459
serializeBinary(): Uint8Array;
6560
toObject(includeInstance?: boolean): GetBookViaAuthor.AsObject;
6661
static toObject(includeInstance: boolean, msg: GetBookViaAuthor): GetBookViaAuthor.AsObject;
@@ -81,11 +76,9 @@ export class BookStore extends jspb.Message {
8176
getName(): string;
8277
setName(value: string): BookStore;
8378

84-
8579
getBooksMap(): jspb.Map<number, string>;
8680
clearBooksMap(): void;
8781

88-
8982
serializeBinary(): Uint8Array;
9083
toObject(includeInstance?: boolean): BookStore.AsObject;
9184
static toObject(includeInstance: boolean, msg: BookStore): BookStore.AsObject;
@@ -107,17 +100,13 @@ export namespace BookStore {
107100
export class SpecialCases extends jspb.Message {
108101
getNormal(): string;
109102
setNormal(value: string): SpecialCases;
110-
111103
getDefault(): string;
112104
setDefault(value: string): SpecialCases;
113-
114105
getFunction(): string;
115106
setFunction(value: string): SpecialCases;
116-
117107
getVar(): string;
118108
setVar(value: string): SpecialCases;
119109

120-
121110
serializeBinary(): Uint8Array;
122111
toObject(includeInstance?: boolean): SpecialCases.AsObject;
123112
static toObject(includeInstance: boolean, msg: SpecialCases): SpecialCases.AsObject;
@@ -144,25 +133,21 @@ export class OneOfSample extends jspb.Message {
144133
getA1(): boolean;
145134
setA1(value: boolean): OneOfSample;
146135

147-
148136
hasB1(): boolean;
149137
clearB1(): void;
150138
getB1(): boolean;
151139
setB1(value: boolean): OneOfSample;
152140

153-
154141
hasA2(): boolean;
155142
clearA2(): void;
156143
getA2(): boolean;
157144
setA2(value: boolean): OneOfSample;
158145

159-
160146
hasB2(): boolean;
161147
clearB2(): void;
162148
getB2(): boolean;
163149
setB2(value: boolean): OneOfSample;
164150

165-
166151
getSinglewordCase(): OneOfSample.SinglewordCase;
167152
getTwoWordsCase(): OneOfSample.TwoWordsCase;
168153

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

187172
export enum SinglewordCase {
188173
SINGLEWORD_NOT_SET = 0,
189-
190-
A1 = 1,
191-
192-
B1 = 2,
193-
174+
A1 = 1,
175+
B1 = 2,
194176
}
195177

196178
export enum TwoWordsCase {
197179
TWO_WORDS_NOT_SET = 0,
198-
199-
A_2 = 3,
200-
201-
B_2 = 4,
202-
180+
A_2 = 3,
181+
B_2 = 4,
203182
}
204183

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

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

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

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

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

304-
305279
serializeBinary(): Uint8Array;
306280
toObject(includeInstance?: boolean): ExtMsgMap.AsObject;
307281
static toObject(includeInstance: boolean, msg: ExtMsgMap): ExtMsgMap.AsObject;
@@ -326,7 +300,6 @@ export class ExtMsgOneOf extends jspb.Message {
326300
getExtension$(): string;
327301
setExtension$(value: string): ExtMsgOneOf;
328302

329-
330303
getExtCase(): ExtMsgOneOf.ExtCase;
331304

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

347320
export enum ExtCase {
348321
EXT_NOT_SET = 0,
349-
350-
EXTENSION = 1,
351-
322+
EXTENSION = 1,
352323
}
353324

354325
}

0 commit comments

Comments
 (0)