ljharb/js-traverse
Vedi su GitHubDoes not work with builtin objects with internal slots (URL, Map, Set, etc)
Open
#10 aperta il 29 mag 2024
bughelp wanted
Metriche repository
- Star
- (61 star)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
For instance:
traverse({ url: new URL("https://example.com") }).map(function () {
if (this.node instanceof URL) {
this.update(this.node.toString());
}
});
TypeError: Receiver must be an instance of class URL
❯ Object.<anonymous> src/log-sanitizer.spec.ts:57:31
55| traverse({ url: new URL("https://example.com") }).map(function () {
56| if (this.node instanceof URL) {
57| this.update(this.node.toString());
| ^
58| }
59| });
❯ walker node_modules/traverse/index.js:169:16
❯ node_modules/traverse/index.js:190:17
❯ forEach node_modules/traverse/index.js:19:30
❯ walker node_modules/traverse/index.js:185:4
❯ walk node_modules/traverse/index.js:208:3
❯ Traverse.map node_modules/traverse/index.js:251:9