Skip to content

Commit

Permalink
fix: Add brand check on deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
petarvujovic98 committed Sep 21, 2022
1 parent 6afa6c1 commit ee7e0f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/utils.js

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

3 changes: 2 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ export function deserialize(valueToDeserialize: string): unknown {
value !== null &&
typeof value === "object" &&
Object.keys(value).length === 2 &&
Object.keys(value).every((key) => ["value", BIGINT_KEY].includes(key))
Object.keys(value).every((key) => ["value", BIGINT_KEY].includes(key)) &&
value[BIGINT_KEY] === BIGINT_BRAND
) {
return BigInt(value["value"]);
}
Expand Down

0 comments on commit ee7e0f6

Please sign in to comment.