How to use the ThisExpression function from @babel/types

Find comprehensive JavaScript @babel/types.ThisExpression code examples handpicked from public code repositorys.

33
34
35
36
37
38
39
40
41
42
  };
}

function objValueStr2AST(objValueStr, t) {
  const values = objValueStr.split('.');
  if (values.length === 1) return values[0] === 'this' ? t.ThisExpression() : t.identifier(values[0]);
  return t.memberExpression(
    objValueStr2AST(values.slice(0, values.length - 1).join('.'), t),
    objValueStr2AST(values[values.length - 1], t)
  );
fork icon3
star icon6
watch icon1

+ 8 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 (20936 examples)