Skip to content

Commit d4df567

Browse files
committed
adjust comments
1 parent 6eb04a8 commit d4df567

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

base64.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ export function toBase64url(arr) {
4040

4141
// Unlike Buffer.from(), throws on invalid input (non-base64 symbols and incomplete chunks)
4242
// Unlike Buffer.from() and Uint8Array.fromBase64(), does not allow spaces
43-
// Unlike Uint8Array.fromBase64(), accepts both base64 and base64url
4443
// NOTE: Always operates in strict mode for last chunk
4544

45+
// Accepts both padded and non-padded variants, only strict base64
4646
export function fromBase64(str, format = 'uint8') {
4747
if (typeof str !== 'string') throw new TypeError('Input is not a string')
4848

@@ -57,6 +57,7 @@ export function fromBase64(str, format = 'uint8') {
5757
return fromTypedArray(fromBase64common(str, false), format)
5858
}
5959

60+
// Accepts both only non-padded strict base64url
6061
export function fromBase64url(str, format = 'uint8') {
6162
if (typeof str !== 'string') throw new TypeError('Input is not a string')
6263

0 commit comments

Comments
 (0)