UNPKG
held
Version:
latest (1.2.0)
1.2.0
1.1.1
1.1.0
1.0.2
1.0.1
Detect paths within an object which held external references.
github.com/rhalff/held
rhalff/held
held
/
examples
/
held.js
20 lines
(11 loc)
•
216 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import
held
from
'../src'
let
obj = {
a
:
1
}
let
b = {} obj.
b
= b
const
heldObj =
held
(obj) obj =
null
console
.
log
(
JSON
.
stringify
(heldObj.
destroy
())) b =
null
console
.
log
(
JSON
.
stringify
(heldObj.
destroy
()))