MCPcopy Create free account
hub / github.com/node-modules/utility / base64decode

Function base64decode

src/crypto.ts:138–147  ·  view source on GitHub ↗
(encodeStr: string, urlSafe?: boolean, encoding?: BufferEncoding | 'buffer')

Source from the content-addressed store, hash-verified

136 * @return {String|Buffer} plain text.
137 */
138export function base64decode(encodeStr: string, urlSafe?: boolean, encoding?: BufferEncoding | 'buffer'): string | Buffer {
139 if (urlSafe) {
140 encodeStr = encodeStr.replace(/\-/g, '+').replace(/_/g, '/');
141 }
142 const buf = Buffer.from(encodeStr, 'base64');
143 if (encoding === 'buffer') {
144 return buf;
145 }
146 return buf.toString(encoding || 'utf8');
147}
148
149function sortObject(o: any) {
150 if (!o || Array.isArray(o) || typeof o !== 'object') {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…