MCPcopy
hub / github.com/prettier/prettier / isMethodValue

Function isMethodValue

src/language-js/print/function.js:22–31  ·  view source on GitHub ↗
({ node, key, parent })

Source from the content-addressed store, hash-verified

20 */
21
22const isMethodValue = ({ node, key, parent }) =>
23 key === "value" &&
24 node.type === "FunctionExpression" &&
25 (parent.type === "ObjectMethod" ||
26 parent.type === "ClassMethod" ||
27 parent.type === "ClassPrivateMethod" ||
28 parent.type === "MethodDefinition" ||
29 parent.type === "TSAbstractMethodDefinition" ||
30 parent.type === "TSDeclareMethod" ||
31 (parent.type === "Property" && isMethod(parent)));
32
33/*
34- `FunctionDeclaration`

Callers 1

printFunctionFunction · 0.85

Calls 1

isMethodFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…