Skip to content

Commit

Permalink
use browser ready TextEncoder instead of Buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjah committed Oct 3, 2024
1 parent aec048a commit f8491cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/basicElements/serializers/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function strToBytes(str: string): Uint8Array {
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
return new Uint8Array(0)
}
return new Uint8Array(Buffer.from(str, 'utf-8'))
return new TextEncoder().encode(str)
}

/**
Expand Down

1 comment on commit f8491cd

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report for experimental massa-web3

St.
Category Percentage Covered / Total
🟡 Statements 63.28% 1134/1792
🔴 Branches 43.41% 191/440
🔴 Functions 46.44% 209/450
🟡 Lines 63.62% 1128/1773

Test suite run success

129 tests passing in 13 suites.

Report generated by 🧪jest coverage report action from f8491cd

Please sign in to comment.