UNPKG

@technobuddha/library

Version:
17 lines 1.36 kB
import { base64UrlConfig, decode } from "./base64.js"; /** * Decodes a string of data which has been encoded using * [Base64Url](https://developer.mozilla.org/en-US/docs/Glossary/Base64) encoding. * * You can use the {@link encodeBase64Url} method to encode and transmit data which may otherwise cause * communication problems, then transmit it and use the `decodeBase64Url` method to decode the data again. * For example, you can encode, transmit, and decode control characters. * @remarks Whitespace within the Base64 encoded string is ignored. * @throws `TypeError` If the input string is not correctly encoded. * @group Binary * @category Encoding */ export function decodeBase64Url(input, encoding) { return encoding ? decode(base64UrlConfig, input, encoding) : decode(base64UrlConfig, input); } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjb2RlLWJhc2UtNjQtdXJsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2RlY29kZS1iYXNlLTY0LXVybC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sRUFBRSxNQUFNLGFBQWEsQ0FBQztBQTRCdEQ7Ozs7Ozs7Ozs7O0dBV0c7QUFDSCxNQUFNLFVBQVUsZUFBZSxDQUFDLEtBQWEsRUFBRSxRQUF1QjtJQUNwRSxPQUFPLFFBQVEsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLGVBQWUsRUFBRSxLQUFLLEVBQUUsUUFBUSxDQUFDLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxlQUFlLEVBQUUsS0FBSyxDQUFDLENBQUM7QUFDOUYsQ0FBQyJ9