Skip to content

Commit

Permalink
docs: update base64url function descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Feb 23, 2025
1 parent d18f7f8 commit 03d72c8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
2 changes: 2 additions & 0 deletions docs/util/base64url/functions/decode.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Support from the community to continue maintaining and improving this module is

**decode**(`input`): [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)

Decodes a Base64URL encoded input.

## Parameters

| Parameter | Type |
Expand Down
2 changes: 2 additions & 0 deletions docs/util/base64url/functions/encode.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Support from the community to continue maintaining and improving this module is

**encode**(`input`): `string`

Encodes an input using Base64URL with no padding.

## Parameters

| Parameter | Type |
Expand Down
22 changes: 1 addition & 21 deletions src/util/base64url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,4 @@
* @module
*/

import * as base64url from '../lib/base64url.js'

/**
* Utility function to encode a string or {@link !Uint8Array} as a base64url string.
*
* @param input Value that will be base64url-encoded.
*/
interface Base64UrlEncode {
(input: Uint8Array | string): string
}
/**
* Utility function to decode a base64url encoded string.
*
* @param input Value that will be base64url-decoded.
*/
interface Base64UrlDecode {
(input: Uint8Array | string): Uint8Array
}

export const encode: Base64UrlEncode = base64url.encode
export const decode: Base64UrlDecode = base64url.decode
export { encode, decode } from '../lib/base64url.js'

0 comments on commit 03d72c8

Please sign in to comment.