Closed
Description
protobuf.js version: 7.3.0
Using @typedef
definitions on static code generates invalid type syntax.
Any property after the first declared property will be prefixed with let
/**
* @typedef {Object} MyType
* @property {string} prop1
* @property {number} prop2
* @property {number] prop3
*/
When running pbts
, this will be converted to:
type MyType = {
prop1: string;
let prop2: number;
let prop3: number;
}
This isn't valid type syntax.
The problem occurs here:
protobuf.js/cli/lib/tsd-jsdoc/publish.js
Lines 394 to 396 in 0a0cdb6
forEach
passes (value, index)
, and writeProperty
s second argument declare
will then be populated with index
.
protobuf.js/cli/lib/tsd-jsdoc/publish.js
Lines 400 to 404 in 0a0cdb6
Thus, the declare
condition will be true for every element past array index 0.
Metadata
Metadata
Assignees
Labels
No labels