1
0
forked from Rowland/EG
EG/Cesium-1.132/node_modules/eslint-plugin-n/lib/util/has-parent-node.js
2025-08-25 17:48:13 +08:00

19 lines
452 B
JavaScript

"use strict"
/**
* @param {import('estree').Node} node
* @returns {node is (import('estree').Node & { parent: import('estree').Node })}
*/
function hasParentNode(node) {
return (
typeof node.type === "string" &&
"parent" in node &&
node.parent != null &&
typeof node.parent === "object" &&
"type" in node.parent &&
typeof node.parent.type === "string"
)
}
module.exports = { hasParentNode }