Skip to content

Commit 5881b1a

Browse files
committed
Update README
1 parent dc22c68 commit 5881b1a

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,39 @@ export class BookServiceClient extends grpc.Client implements IBookServiceClient
357357
}
358358
```
359359

360+
## Gotchas
361+
362+
JavaScript can safely handle numbers below `Number.MAX_SAFE_INTEGER`. Beyond the
363+
limit, it begins to overflow:
364+
365+
```
366+
> 90071992547409912131 + 1
367+
90071992547409920000
368+
```
369+
370+
If you are expecting large, 64bit fields consider using a `jstype` option to
371+
override the field type.
372+
373+
```proto
374+
# example.proto
375+
message Example {
376+
fixed64 id = 1 [jstype = JS_STRING];
377+
}
378+
```
379+
380+
```typescript
381+
// example_pb.d.ts
382+
export namespace Example {
383+
export type AsObject = {
384+
id: string
385+
}
386+
}
387+
```
388+
360389
## Changes
390+
### 2.4.3
391+
Add support for `[jstype = JS_STRING]` overrides
392+
361393
### 2.4.2
362394
Update grpc version in package.json of examples, to keep consistent.
363395
Update handlebars-helpers version to 0.10.0 to fix vulnerability version of randomatic.

0 commit comments

Comments
 (0)