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

Function getContainingObjectLiteral

test/fixtures/snapshot/typescript.js:72324–72330  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

72322 }
72323 }
72324 function getContainingObjectLiteral(func) {
72325 return (func.kind === 169 /* SyntaxKind.MethodDeclaration */ ||
72326 func.kind === 172 /* SyntaxKind.GetAccessor */ ||
72327 func.kind === 173 /* SyntaxKind.SetAccessor */) && func.parent.kind === 205 /* SyntaxKind.ObjectLiteralExpression */ ? func.parent :
72328 func.kind === 213 /* SyntaxKind.FunctionExpression */ && func.parent.kind === 296 /* SyntaxKind.PropertyAssignment */ ? func.parent.parent :
72329 undefined;
72330 }
72331 function getThisTypeArgument(type) {
72332 return ts.getObjectFlags(type) & 4 /* ObjectFlags.Reference */ && type.target === globalThisType ? getTypeArguments(type)[0] : undefined;
72333 }

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected