Skip to content

Commit

Permalink
Match typeUrls with leading slash
Browse files Browse the repository at this point in the history
  • Loading branch information
grod220 committed Nov 16, 2023
1 parent fd56d4c commit a384375
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/protobuf-test/src/google/protobuf/any.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ describe("google.protobuf.Any", () => {
expect(got.is("type.googleapis.com/google.protobuf.Value")).toBe(false);
});

test(`matches type name with leading slash`, () => {
const any = new Any({ typeUrl: "/google.protobuf.Value" });
expect(any.is(Value)).toBe(true);
});

test(`is returns false for an empty Any`, () => {
const got = new Any();

Expand Down
2 changes: 1 addition & 1 deletion packages/protobuf/src/google/protobuf/any_pb.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a384375

Please sign in to comment.