Skip to content

pbts generates incorrect .ts.d file for fields with 'prototype' in their name #998

Open
@mdouglass

Description

@mdouglass

protobuf.js version: 6.8.5

Using the proto file (see attached, it contains a single message with a field called prototypes_url), run the following commands to generate a .d.ts file. The generated test.d.ts (see attached) contains an interface with the field name prototypesUrl but in the class, the field name is incorrectly shortened to sUrl.

./node_modules/.bin/pbjs -t json -o test.json test.proto
./node_modules/.bin/pbjs -t static-module -w commonjs -o test.js test.proto
./node_modules/.bin/pbts -o test.d.ts test.js

test.proto.txt
test.d.ts.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions