UNPKG

@sudoo/marked

Version:

JavaScript & TypeScript code runner in JavaScript, safe with marked territory, asynchronous

20 lines (19 loc) 510 B
"use strict"; /** * @author WMXPY * @namespace Analysis * @description Find All */ Object.defineProperty(exports, "__esModule", { value: true }); exports.findAllESTNodes = void 0; const acorn_walk_1 = require("acorn-walk"); const findAllESTNodes = (estree, type) => { const results = []; (0, acorn_walk_1.full)(estree, (node, _state, nodeType) => { if (nodeType === type) { results.push(node); } }); return results; }; exports.findAllESTNodes = findAllESTNodes;