UNPKG
@ensdomains/unruggable-gateways
Version:
bold-unfinalized (0.0.0-bold-unfinalized.3)
latest (0.0.2)
scroll-new (0.0.0-scroll-new.0)
0.0.2
0.0.1
0.0.0-scroll-new.0
0.0.0-bold-unfinalized.3
0.0.0-bold-unfinalized.2
0.0.0-bold-unfinalized.0
Trustless Ethereum Multichain CCIP-Read Gateway
@ensdomains/unruggable-gateways
/
dist
/
esm
/
wrap.mjs
19 lines
(18 loc)
•
353 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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; } }