MCPcopy
hub / github.com/wandb/openui / asArrayBuffer

Function asArrayBuffer

frontend/src/api/openui.ts:97–101  ·  view source on GitHub ↗
(v: string)

Source from the content-addressed store, hash-verified

95}
96
97const asArrayBuffer = (v: string) =>
98 Uint8Array.from(
99 atob(v.replaceAll('_', '/').replaceAll('-', '+')),
100 c => c.codePointAt(0) ?? 0
101 )
102const asBase64 = (ab: ArrayBuffer | undefined) =>
103 btoa(String.fromCodePoint(...new Uint8Array(ab ?? [])))
104 .replaceAll('+', '-')

Callers 2

registerFunction · 0.85
authFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected