How to use the assertExpressionStatement function from babel-types

Find comprehensive JavaScript babel-types.assertExpressionStatement code examples handpicked from public code repositorys.

53
54
55
56
57
58
59
60
61
62
  }
};

const parseJsExpr = (source, options = {}) => {
  const ast = parseJs(source, options = {});
  t.assertExpressionStatement(ast.program.body[0]);
  return ast.program.body[0].expression;
};

const pairs = (object) =>
fork icon111
star icon0
watch icon2

+ 11 other calls in file

142
143
144
145
146
147
148
149
150
151
// Add the entry into the entries file
let ast = astUtils.parse(this.fs.read(this.destinationPath('webpack/entries.js')));

// Check the consistency of the entries file so we dont break anything
types.assertProgram(ast.program);
types.assertExpressionStatement(ast.program.body[0]);

let expression = ast.program.body[0].expression;

types.assertAssignmentExpression(expression);
fork icon0
star icon2
watch icon1

+ 9 other calls in file

Other functions in babel-types

Sorted by popularity

function icon

babel-types.identifier is the most popular function in babel-types (4076 examples)