How to use the ObjectExpression function from babel-types

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

232
233
234
235
236
237
238
239
240
241
```js
// 生成一个变量申明的AST节点 值包含了函数的行数,列数,和函数名
let infoDeclarator = types.variableDeclaration('var', [
    types.variableDeclarator(
      types.identifier('info'),
      types.ObjectExpression([
        types.objectProperty(types.identifier('line'), types.numericLiteral(node.loc.start.line)),
        types.objectProperty(types.identifier('row'), types.numericLiteral(node.loc.start.column)),
        types.objectProperty(types.identifier('function'), types.stringLiteral(funcName))
      ]))
fork icon6
star icon14
watch icon2

+ 23 other calls in file

102
103
104
105
106
107
108
109
110
111
var body = t.BlockStatement([
  t.ReturnStatement(
    t.NewExpression(
      t.Identifier('AjaxPipe'),
      [
        t.ObjectExpression(objectProperties)
      ]
    )
  )
])
fork icon4
star icon9
watch icon2

+ 29 other calls in file

169
170
171
172
173
174
175
176
177
    )
  })

  const ast = t.ObjectProperty(
    t.Identifier('components'),
    t.ObjectExpression(components)
  )
  properties.unshift(ast)
}
fork icon2
star icon13
watch icon1

+ 13 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)