MCPcopy
hub / github.com/alan2207/bulletproof-react / encode

Function encode

apps/nextjs-app/src/testing/mocks/utils.ts:6–12  ·  view source on GitHub ↗
(obj: any)

Source from the content-addressed store, hash-verified

4import { db } from './db';
5
6export const encode = (obj: any) => {
7 const btoa =
8 typeof window === 'undefined'
9 ? (str: string) => Buffer.from(str, 'binary').toString('base64')
10 : window.btoa;
11 return btoa(JSON.stringify(obj));
12};
13
14export const decode = (str: string) => {
15 const atob =

Callers 1

authenticateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected