How to use the assertObjectExpression function from @babel/types
Find comprehensive JavaScript @babel/types.assertObjectExpression code examples handpicked from public code repositorys.
7 8 9 10 11 12 13 14 15 16
const testSingleProperty = (t, obj, expectedOptions, expectedType) => { const [ key ] = R.keys(obj); const ast = buildLiteralAst(obj); babelTypes.assertObjectExpression(ast); t.is(ast.properties.length, 1); babelTypes.assertStringLiteral(ast.properties[0].key, { value: key }); babelTypes[`assert${expectedType}Literal`](ast.properties[0].value, expectedOptions);
4
8
4
+ 5 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)