@angular/core
Version:
Angular - the core framework
24 lines (20 loc) • 510 B
JavaScript
/**
* @license Angular v19.2.8
* (c) 2010-2025 Google LLC. https://angular.io/
* License: MIT
*/
;
var ts = require('typescript');
/** Find the closest parent node of a particular kind. */
function closestNode(node, predicate) {
let current = node.parent;
while (current && !ts.isSourceFile(current)) {
if (predicate(current)) {
return current;
}
current = current.parent;
}
return null;
}
exports.closestNode = closestNode;
;