Skip to content

Commit

Permalink
account for typeof number as well
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoobes committed Sep 25, 2023
1 parent 9f461bb commit 3331f8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/create-publish.mts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ const makeDescription = (type: number, desc: string) => {
return desc;
};
const serialize = (permissions: unknown) => {
if(typeof permissions === 'bigint') {
if(typeof permissions === 'bigint' || typeof permissions === 'number') {
return permissions.toString();
}

if(Array.isArray(permissions)) {
return permissions
.reduce((acc, cur) => acc | cur, BigInt(0))
Expand Down

0 comments on commit 3331f8a

Please sign in to comment.