Skip to content

Commit

Permalink
chore: Format.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenh committed Oct 13, 2022
1 parent ec00589 commit 7d0a432
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
8 changes: 5 additions & 3 deletions integration/nestjs-simple-usedate/google/protobuf/empty.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable */
export const protobufPackage = 'google.protobuf';

export const protobufPackage = "google.protobuf";

/**
* A generic empty message that you can re-use to avoid defining duplicated
Expand All @@ -12,6 +13,7 @@ export const protobufPackage = 'google.protobuf';
*
* The JSON representation for `Empty` is empty JSON object `{}`.
*/
export interface Empty {}
export interface Empty {
}

export const GOOGLE_PROTOBUF_PACKAGE_NAME = 'google.protobuf';
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable */
export const protobufPackage = 'google.protobuf';

export const protobufPackage = "google.protobuf";

/**
* A Timestamp represents a point in time independent of any time zone or local
Expand Down Expand Up @@ -52,7 +53,6 @@ export const protobufPackage = 'google.protobuf';
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
* .setNanos((int) ((millis % 1000) * 1000000)).build();
*
*
* Example 5: Compute Timestamp from Java `Instant.now()`.
*
* Instant now = Instant.now();
Expand All @@ -61,7 +61,6 @@ export const protobufPackage = 'google.protobuf';
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
* .setNanos(now.getNano()).build();
*
*
* Example 6: Compute Timestamp from current time in Python.
*
* timestamp = Timestamp()
Expand Down Expand Up @@ -110,4 +109,4 @@ export interface Timestamp {
nanos: number;
}

export const GOOGLE_PROTOBUF_PACKAGE_NAME = 'google.protobuf';
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
29 changes: 13 additions & 16 deletions integration/nestjs-simple-usedate/hero.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable */
import { wrappers } from 'protobufjs';
import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
import { Observable } from 'rxjs';
import { Empty } from './google/protobuf/empty';
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
import { wrappers } from "protobufjs";
import { Observable } from "rxjs";
import { Empty } from "./google/protobuf/empty";

export const protobufPackage = 'hero';
export const protobufPackage = "hero";

export interface HeroById {
id: number;
Expand All @@ -25,14 +25,11 @@ export interface Villain {
name: string;
}

export const HERO_PACKAGE_NAME = 'hero';
export const HERO_PACKAGE_NAME = "hero";

wrappers['.google.protobuf.Timestamp'] = {
wrappers[".google.protobuf.Timestamp"] = {
fromObject(value: Date) {
return {
seconds: value.getTime() / 1000,
nanos: (value.getTime() % 1000) * 1e6,
};
return { seconds: value.getTime() / 1000, nanos: (value.getTime() % 1000) * 1e6 };
},
toObject(message: { seconds: number; nanos: number }) {
return new Date(message.seconds * 1000 + message.nanos / 1e6);
Expand Down Expand Up @@ -69,17 +66,17 @@ export interface HeroServiceController {

export function HeroServiceControllerMethods() {
return function (constructor: Function) {
const grpcMethods: string[] = ['addOneHero', 'findOneHero', 'findOneVillain', 'findManyVillainStreamOut'];
const grpcMethods: string[] = ["addOneHero", "findOneHero", "findOneVillain", "findManyVillainStreamOut"];
for (const method of grpcMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcMethod('HeroService', method)(constructor.prototype[method], method, descriptor);
GrpcMethod("HeroService", method)(constructor.prototype[method], method, descriptor);
}
const grpcStreamMethods: string[] = ['findManyVillain', 'findManyVillainStreamIn'];
const grpcStreamMethods: string[] = ["findManyVillain", "findManyVillainStreamIn"];
for (const method of grpcStreamMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcStreamMethod('HeroService', method)(constructor.prototype[method], method, descriptor);
GrpcStreamMethod("HeroService", method)(constructor.prototype[method], method, descriptor);
}
};
}

export const HERO_SERVICE_NAME = 'HeroService';
export const HERO_SERVICE_NAME = "HeroService";

0 comments on commit 7d0a432

Please sign in to comment.