UNPKG

@unruggable/gateways

Version:

Trustless Ethereum Multichain CCIP-Read Gateway

19 lines (18 loc) 353 B
export function unwrap(x) { return x instanceof Wrapped ? x.get() : x; } export class Wrapped { payload; init; value; constructor(payload, init) { this.payload = payload; this.init = init; } get() { if (!this.value) { this.value = this.init(); } return this.value; } }