"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const typescript_1 = require("typescript");
function findNode(predicate, sourceNodes) {
    return new Promise((resolve, reject) => {
        for (const node of sourceNodes) {
            visitChildren(node);
        }
        function visitChildren(node) {
            if (predicate(node)) {
                return resolve(node);
            }
            typescript_1.forEachChild(node, visitChildren);
        }
        reject(new Error('Unable to find Node'));
    });
}
exports.findNode = findNode;
//# sourceMappingURL=findNode.js.map