MCPcopy Create free account
hub / github.com/reactjs/react-docgen / printValue

Function printValue

packages/react-docgen/src/utils/printValue.ts:17–26  ·  view source on GitHub ↗
(path: NodePath)

Source from the content-addressed store, hash-verified

15 * Prints the given path without leading or trailing comments.
16 */
17export default function printValue(path: NodePath): string {
18 let source = path.getSource();
19
20 // variable declarations and interface/type/class members might end with one of these
21 if (source.endsWith(',') || source.endsWith(';')) {
22 source = source.slice(0, -1);
23 }
24
25 return deindent(source);
26}

Callers 15

handleTSQualifiedNameFunction · 0.85
handleTSLiteralTypeFunction · 0.85
handleTSArrayTypeFunction · 0.85
handleTSTypeReferenceFunction · 0.85
handleTSTypeLiteralFunction · 0.85
handleTSUnionTypeFunction · 0.85
handleTSIntersectionTypeFunction · 0.85
handleTSMappedTypeFunction · 0.85
handleTSFunctionTypeFunction · 0.85
handleTSTupleTypeFunction · 0.85
handleTSTypeQueryFunction · 0.85
handleTSTypeOperatorFunction · 0.85

Calls 1

deindentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…