MCPcopy Create free account
hub / github.com/WICG/webpackage / asBytestring

Function asBytestring

js/bundle/src/decoder.ts:267–272  ·  view source on GitHub ↗
(x: unknown)

Source from the content-addressed store, hash-verified

265}
266
267function asBytestring(x: unknown): Uint8Array {
268 if (x instanceof Uint8Array) {
269 return x;
270 }
271 throw new Error('Bytestring expected, but got ' + typeof x);
272}
273
274function bytestringToString(bstr: unknown): string {
275 if (!(bstr instanceof Uint8Array)) {

Callers 3

constructorMethod · 0.85
getResponseMethod · 0.85
constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected