mirror of
https://github.com/protobufjs/protobuf.js.git
synced 2025-12-08 20:58:55 +00:00
Other: Updated dependencies and dist files
This commit is contained in:
parent
e980e72ae3
commit
45356be81b
14
README.md
14
README.md
@ -3,7 +3,7 @@
|
||||
|
||||
**Protocol Buffers** are a language-neutral, platform-neutral, extensible way of serializing structured data for use in communications protocols, data storage, and more, originally designed at Google ([see](https://developers.google.com/protocol-buffers/)).
|
||||
|
||||
**protobuf.js** is a pure JavaScript implementation with [TypeScript](https://www.typescriptlang.org) support for [node.js](https://nodejs.org) and the browser. It's super easy to use, blazingly fast and works out of the box with [.proto](https://developers.google.com/protocol-buffers/docs/proto) files!
|
||||
**protobuf.js** is a pure JavaScript implementation with [TypeScript](https://www.typescriptlang.org) support for [node.js](https://nodejs.org) and the browser. It's easy to use, blazingly fast and works out of the box with [.proto](https://developers.google.com/protocol-buffers/docs/proto) files!
|
||||
|
||||
Contents
|
||||
--------
|
||||
@ -110,11 +110,11 @@ Because JavaScript is a dynamically typed language, protobuf.js introduces the c
|
||||
|
||||
### Valid message
|
||||
|
||||
> **A valid message is an object not missing any required fields and exclusively using JS types for its fields (properties) that are understood by the wire format writer.**
|
||||
> A valid message is an object a) not missing any required fields and b) exclusively composed of JS types understood by the wire format writer.
|
||||
|
||||
There are two possible types of valid messages and the encoder is able to work with both of these:
|
||||
There are two possible types of valid messages and the encoder is able to work with both of these for convenience:
|
||||
|
||||
* **Message instances** (explicit instances of message classes with default values on their prototype) always (have to) satisfy the requirements of a valid message and
|
||||
* **Message instances** (explicit instances of message classes with default values on their prototype) always (have to) satisfy the requirements of a valid message by design and
|
||||
* **Plain JavaScript objects** that just so happen to be composed in a way satisfying the requirements of a valid message as well.
|
||||
|
||||
In a nutshell, the wire format writer understands the following types:
|
||||
@ -137,7 +137,7 @@ In a nutshell, the wire format writer understands the following types:
|
||||
|
||||
### Toolset
|
||||
|
||||
With that in mind and again for performance reasons, each message class provides a distinct set of methods with each method doing just one thing. This avoids unnecessary assertions / operations where performance is a concern but also forces a user to perform verification (of plain JavaScript objects that *might* just so happen to be a valid message) explicitly where necessary - for example when dealing with user input.
|
||||
With that in mind and again for performance reasons, each message class provides a distinct set of methods with each method doing just one thing. This avoids unnecessary assertions / redundant operations where performance is a concern but also forces a user to perform verification (of plain JavaScript objects that *might* just so happen to be a valid message) explicitly where necessary - for example when dealing with user input.
|
||||
|
||||
**Note** that `Message` below refers to any message class.
|
||||
|
||||
@ -209,9 +209,9 @@ With that in mind and again for performance reasons, each message class provides
|
||||
});
|
||||
```
|
||||
|
||||
For reference, the following diagram aims to display the relationships between the different methods above and the concept of a valid message:
|
||||
For reference, the following diagram aims to display relationships between the different methods and the concept of a valid message:
|
||||
|
||||
<img alt="Toolset Diagram" src="http://dcode.io/protobuf.js/toolset.svg" />
|
||||
<p align="center"><img alt="Toolset Diagram" src="http://dcode.io/protobuf.js/toolset.svg" /></p>
|
||||
|
||||
> 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/dcodeIO/protobuf.js/issues/748#issuecomment-291925749))
|
||||
|
||||
|
||||
31
dist/light/protobuf.js
vendored
31
dist/light/protobuf.js
vendored
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* protobuf.js v6.7.1 (c) 2016, Daniel Wirtz
|
||||
* Compiled Wed, 05 Apr 2017 10:09:10 UTC
|
||||
* protobuf.js v6.7.2 (c) 2016, Daniel Wirtz
|
||||
* Compiled Fri, 07 Apr 2017 11:55:32 UTC
|
||||
* Licensed under the BSD-3-Clause License
|
||||
* see: https://github.com/dcodeIO/protobuf.js for details
|
||||
*/
|
||||
@ -2865,22 +2865,37 @@ Object.defineProperty(Namespace.prototype, "nestedArray", {
|
||||
});
|
||||
|
||||
/**
|
||||
* Any nested object descriptor.
|
||||
* @typedef AnyNestedDescriptor
|
||||
* @type {EnumDescriptor|TypeDescriptor|ServiceDescriptor|ExtensionFieldDescriptor|ExtensionMapFieldDescriptor}
|
||||
* Namespace descriptor.
|
||||
* @typedef NamespaceDescriptor
|
||||
* @type {Object}
|
||||
* @property {Object.<string,*>} [options] Namespace options
|
||||
* @property {Object.<string,AnyNestedDescriptor>} nested Nested object descriptors
|
||||
*/
|
||||
|
||||
/**
|
||||
* Namespace descriptor.
|
||||
* @typedef NamespaceDescriptor
|
||||
* Namespace base descriptor.
|
||||
* @typedef NamespaceBaseDescriptor
|
||||
* @type {Object}
|
||||
* @property {Object.<string,*>} [options] Namespace options
|
||||
* @property {Object.<string,AnyNestedDescriptor>} [nested] Nested object descriptors
|
||||
*/
|
||||
|
||||
/**
|
||||
* Any extension field descriptor.
|
||||
* @typedef AnyExtensionFieldDescriptor
|
||||
* @type {ExtensionFieldDescriptor|ExtensionMapFieldDescriptor}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Any nested object descriptor.
|
||||
* @typedef AnyNestedDescriptor
|
||||
* @type {EnumDescriptor|TypeDescriptor|ServiceDescriptor|AnyExtensionFieldDescriptor|NamespaceDescriptor}
|
||||
*/
|
||||
// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionFieldDescriptor exists in the first place)
|
||||
|
||||
/**
|
||||
* Converts this namespace to a namespace descriptor.
|
||||
* @returns {NamespaceDescriptor} Namespace descriptor
|
||||
* @returns {NamespaceBaseDescriptor} Namespace descriptor
|
||||
*/
|
||||
Namespace.prototype.toJSON = function toJSON() {
|
||||
return {
|
||||
|
||||
2
dist/light/protobuf.js.map
vendored
2
dist/light/protobuf.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/light/protobuf.min.js
vendored
4
dist/light/protobuf.min.js
vendored
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* protobuf.js v6.7.1 (c) 2016, Daniel Wirtz
|
||||
* Compiled Wed, 05 Apr 2017 10:09:11 UTC
|
||||
* protobuf.js v6.7.2 (c) 2016, Daniel Wirtz
|
||||
* Compiled Fri, 07 Apr 2017 11:55:34 UTC
|
||||
* Licensed under the BSD-3-Clause License
|
||||
* see: https://github.com/dcodeIO/protobuf.js for details
|
||||
*/
|
||||
|
||||
BIN
dist/light/protobuf.min.js.gz
vendored
BIN
dist/light/protobuf.min.js.gz
vendored
Binary file not shown.
2
dist/light/protobuf.min.js.map
vendored
2
dist/light/protobuf.min.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/minimal/protobuf.js
vendored
4
dist/minimal/protobuf.js
vendored
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* protobuf.js v6.7.1 (c) 2016, Daniel Wirtz
|
||||
* Compiled Wed, 05 Apr 2017 10:09:10 UTC
|
||||
* protobuf.js v6.7.2 (c) 2016, Daniel Wirtz
|
||||
* Compiled Fri, 07 Apr 2017 11:55:33 UTC
|
||||
* Licensed under the BSD-3-Clause License
|
||||
* see: https://github.com/dcodeIO/protobuf.js for details
|
||||
*/
|
||||
|
||||
4
dist/minimal/protobuf.min.js
vendored
4
dist/minimal/protobuf.min.js
vendored
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* protobuf.js v6.7.1 (c) 2016, Daniel Wirtz
|
||||
* Compiled Wed, 05 Apr 2017 10:09:11 UTC
|
||||
* protobuf.js v6.7.2 (c) 2016, Daniel Wirtz
|
||||
* Compiled Fri, 07 Apr 2017 11:55:34 UTC
|
||||
* Licensed under the BSD-3-Clause License
|
||||
* see: https://github.com/dcodeIO/protobuf.js for details
|
||||
*/
|
||||
|
||||
BIN
dist/minimal/protobuf.min.js.gz
vendored
BIN
dist/minimal/protobuf.min.js.gz
vendored
Binary file not shown.
31
dist/protobuf.js
vendored
31
dist/protobuf.js
vendored
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* protobuf.js v6.7.1 (c) 2016, Daniel Wirtz
|
||||
* Compiled Wed, 05 Apr 2017 10:09:10 UTC
|
||||
* protobuf.js v6.7.2 (c) 2016, Daniel Wirtz
|
||||
* Compiled Fri, 07 Apr 2017 11:55:32 UTC
|
||||
* Licensed under the BSD-3-Clause License
|
||||
* see: https://github.com/dcodeIO/protobuf.js for details
|
||||
*/
|
||||
@ -3105,22 +3105,37 @@ Object.defineProperty(Namespace.prototype, "nestedArray", {
|
||||
});
|
||||
|
||||
/**
|
||||
* Any nested object descriptor.
|
||||
* @typedef AnyNestedDescriptor
|
||||
* @type {EnumDescriptor|TypeDescriptor|ServiceDescriptor|ExtensionFieldDescriptor|ExtensionMapFieldDescriptor}
|
||||
* Namespace descriptor.
|
||||
* @typedef NamespaceDescriptor
|
||||
* @type {Object}
|
||||
* @property {Object.<string,*>} [options] Namespace options
|
||||
* @property {Object.<string,AnyNestedDescriptor>} nested Nested object descriptors
|
||||
*/
|
||||
|
||||
/**
|
||||
* Namespace descriptor.
|
||||
* @typedef NamespaceDescriptor
|
||||
* Namespace base descriptor.
|
||||
* @typedef NamespaceBaseDescriptor
|
||||
* @type {Object}
|
||||
* @property {Object.<string,*>} [options] Namespace options
|
||||
* @property {Object.<string,AnyNestedDescriptor>} [nested] Nested object descriptors
|
||||
*/
|
||||
|
||||
/**
|
||||
* Any extension field descriptor.
|
||||
* @typedef AnyExtensionFieldDescriptor
|
||||
* @type {ExtensionFieldDescriptor|ExtensionMapFieldDescriptor}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Any nested object descriptor.
|
||||
* @typedef AnyNestedDescriptor
|
||||
* @type {EnumDescriptor|TypeDescriptor|ServiceDescriptor|AnyExtensionFieldDescriptor|NamespaceDescriptor}
|
||||
*/
|
||||
// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionFieldDescriptor exists in the first place)
|
||||
|
||||
/**
|
||||
* Converts this namespace to a namespace descriptor.
|
||||
* @returns {NamespaceDescriptor} Namespace descriptor
|
||||
* @returns {NamespaceBaseDescriptor} Namespace descriptor
|
||||
*/
|
||||
Namespace.prototype.toJSON = function toJSON() {
|
||||
return {
|
||||
|
||||
2
dist/protobuf.js.map
vendored
2
dist/protobuf.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/protobuf.min.js
vendored
4
dist/protobuf.min.js
vendored
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* protobuf.js v6.7.1 (c) 2016, Daniel Wirtz
|
||||
* Compiled Wed, 05 Apr 2017 10:09:11 UTC
|
||||
* protobuf.js v6.7.2 (c) 2016, Daniel Wirtz
|
||||
* Compiled Fri, 07 Apr 2017 11:55:34 UTC
|
||||
* Licensed under the BSD-3-Clause License
|
||||
* see: https://github.com/dcodeIO/protobuf.js for details
|
||||
*/
|
||||
|
||||
BIN
dist/protobuf.min.js.gz
vendored
BIN
dist/protobuf.min.js.gz
vendored
Binary file not shown.
2
dist/protobuf.min.js.map
vendored
2
dist/protobuf.min.js.map
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "protobufjs",
|
||||
"version": "6.7.1",
|
||||
"version": "6.7.2",
|
||||
"versionScheme": "~",
|
||||
"description": "Protocol Buffers for JavaScript (& TypeScript).",
|
||||
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
|
||||
@ -62,7 +62,7 @@
|
||||
"@types/long": "^3.0.31",
|
||||
"@types/node": "7.0.12",
|
||||
"benchmark": "^2.1.4",
|
||||
"browserify": "^14.1.0",
|
||||
"browserify": "^14.3.0",
|
||||
"browserify-wrap": "^1.0.2",
|
||||
"bundle-collapser": "^1.2.1",
|
||||
"chalk": "^1.1.3",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user