All files / dist/src traverse.js

0% Statements 0/16
0% Branches 0/14
0% Functions 0/4
0% Lines 0/15

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25                                                 
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Dependencies:
var typescript_1 = require("typescript");
function traverse(node, options) {
    node.kindName = typescript_1.SyntaxKind[node.kind];
    if (!node.text) {
        node.text = node.getText();
    }
    if (node.kind === typescript_1.SyntaxKind.Identifier && !node.name) {
        node.name = node.text;
    }
    options.enter(node, node.parent || null);
    node.forEachChild(function (child) { return traverse(child, options); });
    options.leave(node, node.parent || null);
}
exports.traverse = traverse;
function getVisitorKeys(node) {
    return !!node ? Object.keys(node).filter(function (key) {
        var value = node[key];
        return Array.isArray(value) || typeof value === 'object';
    }) : [];
}
exports.getVisitorKeys = getVisitorKeys;
//# sourceMappingURL=traverse.js.map