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

Function pack

src/cli/cli-utils.ts:3–7  ·  view source on GitHub ↗
(x: Array<string> | string)

Source from the content-addressed store, hash-verified

1import { toBase64, fromBase64, isString } from '../utils';
2
3export const pack = (x: Array<string> | string): string => {
4 // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
5 // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
6 return isString(x) ? toBase64(x) : toBase64(x.join('+++'));
7};
8
9export const unpack = (str: string): Array<string> => fromBase64(str).split('+++');

Callers

nothing calls this directly

Calls 2

isStringFunction · 0.90
toBase64Function · 0.90

Tested by

no test coverage detected