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

Function asString

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

Source from the content-addressed store, hash-verified

258}
259
260function asString(x: unknown): string {
261 if (typeof x === 'string') {
262 return x;
263 }
264 throw new Error('String expected, but got ' + typeof x);
265}
266
267function asBytestring(x: unknown): Uint8Array {
268 if (x instanceof Uint8Array) {

Callers 3

constructorMethod · 0.85
manifestURLMethod · 0.85
primaryURLMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected