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

Function asArray

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

Source from the content-addressed store, hash-verified

237// Type assertions and conversions for CBOR-decoded objects.
238
239function asArray(x: unknown): unknown[] {
240 if (x instanceof Array) {
241 return x;
242 }
243 throw new Error('Array expected, but got ' + typeof x);
244}
245
246function asMap(x: unknown): Map<string, unknown> {
247 if (x instanceof Map) {

Callers 2

constructorMethod · 0.85
getResponseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected