(encodeStr: string, urlSafe?: boolean, encoding?: BufferEncoding | 'buffer')
| 136 | * @return {String|Buffer} plain text. |
| 137 | */ |
| 138 | export 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 | |
| 149 | function sortObject(o: any) { |
| 150 | if (!o || Array.isArray(o) || typeof o !== 'object') { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…