"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deepFind = void 0;
const deepFind = (tree, callback) => {
    for (const item of tree) {
        if (callback(item)) {
            return item;
        }
        if (item.children) {
            const result = (0, exports.deepFind)(item.children, callback);
            if (result) {
                return result;
            }
        }
    }
    return undefined;
};
exports.deepFind = deepFind;
