Skip to content

Commit

Permalink
Docs: Documented that Type#encode respectively Message.encode do not …
Browse files Browse the repository at this point in the history
…implicitly .verify, see #696 [ci-skip]
  • Loading branch information
dcodeIO committed Mar 5, 2017
1 parent e7e123a commit 7502dd2
Show file tree
Hide file tree
Showing 8 changed files with 276 additions and 276 deletions.
4 changes: 2 additions & 2 deletions cli/targets/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ function buildType(ref, type) {
if (config.encode) {
push("");
pushComment([
"Encodes the specified " + type.name + " message.",
"Encodes the specified " + type.name + " message. Does not implicitly {@link " + fullName + ".verify|verify} messages.",
"@param {" + fullName + "|Object} " + (config.beautify ? "message" : "m") + " " + type.name + " message or plain object to encode",
"@param {$protobuf.Writer} [" + (config.beautify ? "writer" : "w") + "] Writer to encode to",
"@returns {$protobuf.Writer} Writer"
Expand All @@ -403,7 +403,7 @@ function buildType(ref, type) {
if (config.delimited) {
push("");
pushComment([
"Encodes the specified " + type.name + " message, length delimited.",
"Encodes the specified " + type.name + " message, length delimited. Does not implicitly {@link " + fullName + ".verify|verify} messages.",
"@param {" + fullName + "|Object} message " + type.name + " message or plain object to encode",
"@param {$protobuf.Writer} [writer] Writer to encode to",
"@returns {$protobuf.Writer} Writer"
Expand Down
4 changes: 2 additions & 2 deletions src/type.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ Type.prototype.setup = function setup() {
};

/**
* Encodes a message of this type.
* Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.
* @param {Message|Object} message Message instance or plain object
* @param {Writer} [writer] Writer to encode to
* @returns {Writer} writer
Expand All @@ -407,7 +407,7 @@ Type.prototype.encode = function encode_setup(message, writer) {
};

/**
* Encodes a message of this type preceeded by its byte length as a varint.
* Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.
* @param {Message|Object} message Message instance or plain object
* @param {Writer} [writer] Writer to encode to
* @returns {Writer} writer
Expand Down
16 changes: 8 additions & 8 deletions tests/data/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ $root.Test1 = (function() {
};

/**
* Encodes the specified Test1 message.
* Encodes the specified Test1 message. Does not implicitly {@link Test1.verify|verify} messages.
* @param {Test1|Object} message Test1 message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
Expand All @@ -76,7 +76,7 @@ $root.Test1 = (function() {
};

/**
* Encodes the specified Test1 message, length delimited.
* Encodes the specified Test1 message, length delimited. Does not implicitly {@link Test1.verify|verify} messages.
* @param {Test1|Object} message Test1 message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
Expand All @@ -90,7 +90,7 @@ $root.Test1 = (function() {
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {Test1} Test1
* @throws {Error} If the payload is invalid or missing required fields
* @throws {Error} If the payload is not a reader or valid buffer or required fields are missing
*/
Test1.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
Expand Down Expand Up @@ -120,7 +120,7 @@ $root.Test1 = (function() {
* Decodes a Test1 message from the specified reader or buffer, length delimited.
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {Test1} Test1
* @throws {Error} If the payload is invalid or missing required fields
* @throws {Error} If the payload is not a reader or valid buffer or required fields are missing
*/
Test1.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
Expand Down Expand Up @@ -243,7 +243,7 @@ $root.Test2 = (function() {
};

/**
* Encodes the specified Test2 message.
* Encodes the specified Test2 message. Does not implicitly {@link Test2.verify|verify} messages.
* @param {Test2|Object} message Test2 message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
Expand All @@ -255,7 +255,7 @@ $root.Test2 = (function() {
};

/**
* Encodes the specified Test2 message, length delimited.
* Encodes the specified Test2 message, length delimited. Does not implicitly {@link Test2.verify|verify} messages.
* @param {Test2|Object} message Test2 message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
Expand All @@ -269,7 +269,7 @@ $root.Test2 = (function() {
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {Test2} Test2
* @throws {Error} If the payload is invalid or missing required fields
* @throws {Error} If the payload is not a reader or valid buffer or required fields are missing
*/
Test2.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
Expand All @@ -290,7 +290,7 @@ $root.Test2 = (function() {
* Decodes a Test2 message from the specified reader or buffer, length delimited.
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {Test2} Test2
* @throws {Error} If the payload is invalid or missing required fields
* @throws {Error} If the payload is not a reader or valid buffer or required fields are missing
*/
Test2.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
Expand Down
8 changes: 4 additions & 4 deletions tests/data/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ $root.Message = (function() {
};

/**
* Encodes the specified Message message.
* Encodes the specified Message message. Does not implicitly {@link Message.verify|verify} messages.
* @param {Message|Object} message Message message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
Expand Down Expand Up @@ -137,7 +137,7 @@ $root.Message = (function() {
};

/**
* Encodes the specified Message message, length delimited.
* Encodes the specified Message message, length delimited. Does not implicitly {@link Message.verify|verify} messages.
* @param {Message|Object} message Message message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
Expand All @@ -151,7 +151,7 @@ $root.Message = (function() {
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {Message} Message
* @throws {Error} If the payload is invalid or missing required fields
* @throws {Error} If the payload is not a reader or valid buffer or required fields are missing
*/
Message.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
Expand Down Expand Up @@ -222,7 +222,7 @@ $root.Message = (function() {
* Decodes a Message message from the specified reader or buffer, length delimited.
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {Message} Message
* @throws {Error} If the payload is invalid or missing required fields
* @throws {Error} If the payload is not a reader or valid buffer or required fields are missing
*/
Message.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
Expand Down
32 changes: 16 additions & 16 deletions tests/data/mapbox/vector_tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ $root.vector_tile = (function() {
};

/**
* Encodes the specified Tile message.
* Encodes the specified Tile message. Does not implicitly {@link vector_tile.Tile.verify|verify} messages.
* @param {vector_tile.Tile|Object} message Tile message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
Expand All @@ -71,7 +71,7 @@ $root.vector_tile = (function() {
};

/**
* Encodes the specified Tile message, length delimited.
* Encodes the specified Tile message, length delimited. Does not implicitly {@link vector_tile.Tile.verify|verify} messages.
* @param {vector_tile.Tile|Object} message Tile message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
Expand All @@ -85,7 +85,7 @@ $root.vector_tile = (function() {
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {vector_tile.Tile} Tile
* @throws {Error} If the payload is invalid or missing required fields
* @throws {Error} If the payload is not a reader or valid buffer or required fields are missing
*/
Tile.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
Expand All @@ -111,7 +111,7 @@ $root.vector_tile = (function() {
* Decodes a Tile message from the specified reader or buffer, length delimited.
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {vector_tile.Tile} Tile
* @throws {Error} If the payload is invalid or missing required fields
* @throws {Error} If the payload is not a reader or valid buffer or required fields are missing
*/
Tile.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
Expand Down Expand Up @@ -292,7 +292,7 @@ $root.vector_tile = (function() {
};

/**
* Encodes the specified Value message.
* Encodes the specified Value message. Does not implicitly {@link vector_tile.Tile.Value.verify|verify} messages.
* @param {vector_tile.Tile.Value|Object} message Value message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
Expand All @@ -318,7 +318,7 @@ $root.vector_tile = (function() {
};

/**
* Encodes the specified Value message, length delimited.
* Encodes the specified Value message, length delimited. Does not implicitly {@link vector_tile.Tile.Value.verify|verify} messages.
* @param {vector_tile.Tile.Value|Object} message Value message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
Expand All @@ -332,7 +332,7 @@ $root.vector_tile = (function() {
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {vector_tile.Tile.Value} Value
* @throws {Error} If the payload is invalid or missing required fields
* @throws {Error} If the payload is not a reader or valid buffer or required fields are missing
*/
Value.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
Expand Down Expand Up @@ -374,7 +374,7 @@ $root.vector_tile = (function() {
* Decodes a Value message from the specified reader or buffer, length delimited.
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {vector_tile.Tile.Value} Value
* @throws {Error} If the payload is invalid or missing required fields
* @throws {Error} If the payload is not a reader or valid buffer or required fields are missing
*/
Value.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
Expand Down Expand Up @@ -600,7 +600,7 @@ $root.vector_tile = (function() {
};

/**
* Encodes the specified Feature message.
* Encodes the specified Feature message. Does not implicitly {@link vector_tile.Tile.Feature.verify|verify} messages.
* @param {vector_tile.Tile.Feature|Object} message Feature message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
Expand Down Expand Up @@ -628,7 +628,7 @@ $root.vector_tile = (function() {
};

/**
* Encodes the specified Feature message, length delimited.
* Encodes the specified Feature message, length delimited. Does not implicitly {@link vector_tile.Tile.Feature.verify|verify} messages.
* @param {vector_tile.Tile.Feature|Object} message Feature message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
Expand All @@ -642,7 +642,7 @@ $root.vector_tile = (function() {
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {vector_tile.Tile.Feature} Feature
* @throws {Error} If the payload is invalid or missing required fields
* @throws {Error} If the payload is not a reader or valid buffer or required fields are missing
*/
Feature.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
Expand Down Expand Up @@ -689,7 +689,7 @@ $root.vector_tile = (function() {
* Decodes a Feature message from the specified reader or buffer, length delimited.
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {vector_tile.Tile.Feature} Feature
* @throws {Error} If the payload is invalid or missing required fields
* @throws {Error} If the payload is not a reader or valid buffer or required fields are missing
*/
Feature.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
Expand Down Expand Up @@ -925,7 +925,7 @@ $root.vector_tile = (function() {
};

/**
* Encodes the specified Layer message.
* Encodes the specified Layer message. Does not implicitly {@link vector_tile.Tile.Layer.verify|verify} messages.
* @param {vector_tile.Tile.Layer|Object} message Layer message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
Expand All @@ -950,7 +950,7 @@ $root.vector_tile = (function() {
};

/**
* Encodes the specified Layer message, length delimited.
* Encodes the specified Layer message, length delimited. Does not implicitly {@link vector_tile.Tile.Layer.verify|verify} messages.
* @param {vector_tile.Tile.Layer|Object} message Layer message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
Expand All @@ -964,7 +964,7 @@ $root.vector_tile = (function() {
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {vector_tile.Tile.Layer} Layer
* @throws {Error} If the payload is invalid or missing required fields
* @throws {Error} If the payload is not a reader or valid buffer or required fields are missing
*/
Layer.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
Expand Down Expand Up @@ -1013,7 +1013,7 @@ $root.vector_tile = (function() {
* Decodes a Layer message from the specified reader or buffer, length delimited.
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {vector_tile.Tile.Layer} Layer
* @throws {Error} If the payload is invalid or missing required fields
* @throws {Error} If the payload is not a reader or valid buffer or required fields are missing
*/
Layer.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
Expand Down
Loading

0 comments on commit 7502dd2

Please sign in to comment.