MCPcopy Create free account
hub / github.com/teambit/bit / toBase64

Function toBase64

src/utils/string/to-base64.ts:12–15  ·  view source on GitHub ↗
(val: string | Buffer)

Source from the content-addressed store, hash-verified

10 * ```
11 */
12export default function toBase64(val: string | Buffer) {
13 if (val instanceof Buffer) return val.toString('base64');
14 return Buffer.from(val).toString('base64');
15}

Callers 3

packFunction · 0.90
buildCmdMethod · 0.90
pack-command.tsFile · 0.85

Calls 2

toStringMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected