You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> In other words: `verify` indicates that calling `create` or `encode` directly on the plain object will [result in a valid message respectively] succeed. `fromObject`, on the other hand, does conversion from a broader range of plain objects to create valid messages. ([ref](https://github.com/protobufjs/protobuf.js/issues/748#issuecomment-291925749))
200
+
> In other words: `verify` indicates that calling `create` or `encode` directly on the plain object will [result in a valid message respectively] succeed. `fromObject`, on the other hand, does conversion from a broader range of plain objects to create valid messages. ([ref](https://github.com/uncollapseco/protobuf.js/issues/748#issuecomment-291925749))
There is also an [example for streaming RPC](https://github.com/protobufjs/protobuf.js/blob/master/examples/streaming-rpc.js).
472
+
There is also an [example for streaming RPC](https://github.com/uncollapseco/protobuf.js/blob/master/examples/streaming-rpc.js).
473
473
474
474
Note that the service API is meant for clients. Implementing a server-side endpoint pretty much always requires transport channel (i.e. http, websocket, etc.) specific code with the only common denominator being that it decodes and encodes messages.
475
475
476
476
### Usage with TypeScript
477
477
478
-
The library ships with its own [type definitions](https://github.com/protobufjs/protobuf.js/blob/master/index.d.ts) and modern editors like [Visual Studio Code](https://code.visualstudio.com/) will automatically detect and use them for code completion.
478
+
The library ships with its own [type definitions](https://github.com/uncollapseco/protobuf.js/blob/master/index.d.ts) and modern editors like [Visual Studio Code](https://code.visualstudio.com/) will automatically detect and use them for code completion.
479
479
480
480
The npm package depends on [@types/node](https://www.npmjs.com/package/@types/node) because of `Buffer` and [@types/long](https://www.npmjs.com/package/@types/long) because of `Long`. If you are not building for node and/or not using long.js, it should be safe to exclude them manually.
481
481
@@ -484,7 +484,7 @@ The npm package depends on [@types/node](https://www.npmjs.com/package/@types/no
484
484
The API shown above works pretty much the same with TypeScript. However, because everything is typed, accessing fields on instances of dynamically generated message classes requires either using bracket-notation (i.e. `message["awesomeField"]`) or explicit casts. Alternatively, it is possible to use a [typings file generated for its static counterpart](#pbts-for-typescript).
@@ -524,7 +524,7 @@ The library also includes an early implementation of [decorators](https://www.ty
524
524
**Note** that decorators are an experimental feature in TypeScript and that declaration order is important depending on the JS target. For example, `@Field.d(2, AwesomeArrayMessage)` requires that `AwesomeArrayMessage` has been defined earlier when targeting `ES5`.
*[Frequently asked questions](https://github.com/uncollapseco/protobuf.js/wiki) on our wiki
597
597
598
598
#### Community
599
599
*[Questions and answers](http://stackoverflow.com/search?tab=newest&q=protobuf.js) on StackOverflow
@@ -653,13 +653,13 @@ These results are achieved by
653
653
* using node-specific functionality where beneficial and, of course
654
654
* avoiding unnecessary operations through splitting up [the toolset](#toolset).
655
655
656
-
You can also run [the benchmark](https://github.com/protobufjs/protobuf.js/blob/master/bench/index.js) ...
656
+
You can also run [the benchmark](https://github.com/uncollapseco/protobuf.js/blob/master/bench/index.js) ...
657
657
658
658
```
659
659
$> npm run bench
660
660
```
661
661
662
-
and [the profiler](https://github.com/protobufjs/protobuf.js/blob/master/bench/prof.js) yourself (the latter requires a recent version of node):
662
+
and [the profiler](https://github.com/uncollapseco/protobuf.js/blob/master/bench/prof.js) yourself (the latter requires a recent version of node):
663
663
664
664
```
665
665
$> npm run prof <encode|decode|encode-browser|decode-browser> [iterations=10000000]
@@ -673,18 +673,18 @@ Compatibility
673
673
* Works in all modern and not-so-modern browsers except IE8.
674
674
* Because the internals of this package do not rely on `google/protobuf/descriptor.proto`, options are parsed and presented literally.
675
675
* If typed arrays are not supported by the environment, plain arrays will be used instead.
676
-
* Support for pre-ES5 environments (except IE8) can be achieved by [using a polyfill](https://github.com/protobufjs/protobuf.js/blob/master/lib/polyfill.js).
676
+
* Support for pre-ES5 environments (except IE8) can be achieved by [using a polyfill](https://github.com/uncollapseco/protobuf.js/blob/master/lib/polyfill.js).
677
677
* Support for [Content Security Policy](https://w3c.github.io/webappsec-csp/)-restricted environments (like Chrome extensions without unsafe-eval) can be achieved by generating and using static code instead.
678
678
* If a proper way to work with 64 bit values (uint64, int64 etc.) is required, just install [long.js](https://github.com/dcodeIO/long.js) alongside this library. All 64 bit numbers will then be returned as a `Long` instance instead of a possibly unsafe JavaScript number ([see](https://github.com/dcodeIO/long.js)).
679
-
* For descriptor.proto interoperability, see [ext/descriptor](https://github.com/protobufjs/protobuf.js/tree/master/ext/descriptor)
679
+
* For descriptor.proto interoperability, see [ext/descriptor](https://github.com/uncollapseco/protobuf.js/tree/master/ext/descriptor)
680
680
681
681
Building
682
682
--------
683
683
684
684
To build the library or its components yourself, clone it from GitHub and install the development dependencies:
@@ -722,6 +722,6 @@ By default, protobuf.js integrates into any browserify build-process without req
722
722
protobuf.configure();
723
723
```
724
724
725
-
* If you have any special requirements, there is [the bundler](https://github.com/protobufjs/protobuf.js/blob/master/scripts/bundle.js) for reference.
725
+
* If you have any special requirements, there is [the bundler](https://github.com/uncollapseco/protobuf.js/blob/master/scripts/bundle.js) for reference.
0 commit comments