MCPcopy Create free account
hub / github.com/cst/cst / parseAndGetExpression

Function parseAndGetExpression

test/utils.js:19–23  ·  view source on GitHub ↗
(code: string, options: CSTParserOptions)

Source from the content-addressed store, hash-verified

17}
18
19export function parseAndGetExpression(code: string, options: CSTParserOptions): Object {
20 let parser = new Parser(options);
21 let program = parser.parse('(' + code + ')');
22 return program.body[0].expression;
23}
24
25export function parseAndGetBindExpression(code: string, options: CSTParserOptions): Object {
26 return parseAndGetProgram(code, options).selectNodesByType('BindExpression')[0];

Callers 15

RestElement.jsFile · 0.90
MetaProperty.jsFile · 0.90
Identifier.jsFile · 0.90
RegExpLiteral.jsFile · 0.90
SpreadElement.jsFile · 0.90
ArrayExpression.jsFile · 0.90
NumericLiteral.jsFile · 0.90
baseCallExpressionFunction · 0.90
StringLiteral.jsFile · 0.90

Calls 1

parseMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…