MCPcopy Create free account
hub / github.com/estools/esquery / isNode

Function isNode

esquery.js:423–426  ·  view source on GitHub ↗

* Check whether the given value is an ASTNode or not. * @param {any} node The value to check. * @param {ESQueryOptions|undefined} options The options to use. * @returns {boolean} `true` if the value is an ASTNode.

(node, options)

Source from the content-addressed store, hash-verified

421 * @returns {boolean} `true` if the value is an ASTNode.
422 */
423function isNode(node, options) {
424 const nodeTypeKey = (options && options.nodeTypeKey) || 'type';
425 return node !== null && typeof node === 'object' && typeof node[nodeTypeKey] === 'string';
426}
427
428/**
429 * Determines if the given node has a sibling that matches the

Callers 2

siblingFunction · 0.85
adjacentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected