Son CV dans un terminal web en Javascript!
https://terminal-cv.gregandev.fr
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
586 B
28 lines
586 B
1 year ago
|
"use strict";
|
||
|
|
||
|
Object.defineProperty(exports, "__esModule", {
|
||
|
value: true
|
||
|
});
|
||
|
exports.default = traverseFast;
|
||
|
|
||
|
var _definitions = require("../definitions");
|
||
|
|
||
|
function traverseFast(node, enter, opts) {
|
||
|
if (!node) return;
|
||
|
const keys = _definitions.VISITOR_KEYS[node.type];
|
||
|
if (!keys) return;
|
||
|
opts = opts || {};
|
||
|
enter(node, opts);
|
||
|
|
||
|
for (const key of keys) {
|
||
|
const subNode = node[key];
|
||
|
|
||
|
if (Array.isArray(subNode)) {
|
||
|
for (const node of subNode) {
|
||
|
traverseFast(node, enter, opts);
|
||
|
}
|
||
|
} else {
|
||
|
traverseFast(subNode, enter, opts);
|
||
|
}
|
||
|
}
|
||
|
}
|