Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/nodejs/node
/ isTopLevel
Function
isTopLevel
tools/eslint-rules/no-duplicate-requires.js:19–25 ·
view source on GitHub ↗
(node)
Source
from the content-addressed store, hash-verified
17
]);
18
19
const
isTopLevel = (node) => {
20
while
(node) {
21
if
(topLevelTypes.has(node.
type
))
return
false;
22
node = node.parent;
23
}
24
return
true;
25
};
26
27
module.exports = {
28
create(context) {
Callers
1
CallExpression
Function · 0.85
Calls
1
has
Method · 0.65
Tested by
no test coverage detected