MCPcopy Index your code
hub / github.com/nodejs/node / shouldWriteTypeOfFunctionSymbol

Function shouldWriteTypeOfFunctionSymbol

test/fixtures/snapshot/typescript.js:52750–52764  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52748 return createTypeNodeFromObjectType(type);
52749 }
52750 function shouldWriteTypeOfFunctionSymbol() {
52751 var _a;
52752 var isStaticMethodSymbol = !!(symbol.flags & 8192 /* SymbolFlags.Method */) && // typeof static method
52753 ts.some(symbol.declarations, function (declaration) { return ts.isStatic(declaration); });
52754 var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* SymbolFlags.Function */) &&
52755 (symbol.parent || // is exported function symbol
52756 ts.forEach(symbol.declarations, function (declaration) {
52757 return declaration.parent.kind === 305 /* SyntaxKind.SourceFile */ || declaration.parent.kind === 262 /* SyntaxKind.ModuleBlock */;
52758 }));
52759 if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
52760 // typeof is allowed only for static/non local functions
52761 return (!!(context.flags & 4096 /* NodeBuilderFlags.UseTypeOfFunction */) || ((_a = context.visitedTypes) === null || _a === void 0 ? void 0 : _a.has(typeId))) && // it is type of the symbol uses itself recursively
52762 (!(context.flags & 8 /* NodeBuilderFlags.UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration)); // And the build is going to succeed without visibility error or there is no structural fallback allowed
52763 }
52764 }
52765 }
52766 function visitAndTransformType(type, transform) {
52767 var _a, _b;

Callers 1

createAnonymousTypeNodeFunction · 0.85

Calls 4

isValueSymbolAccessibleFunction · 0.85
someMethod · 0.80
forEachMethod · 0.65
hasMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…