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

Function asNumber

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

Source from the content-addressed store, hash-verified

251}
252
253function asNumber(x: unknown): number {
254 if (typeof x === 'number') {
255 return x;
256 }
257 throw new Error('Number expected, but got ' + typeof x);
258}
259
260function asString(x: unknown): string {
261 if (typeof x === 'string') {

Callers 1

getResponseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected