How to use the isArrayExpression function from babel-types

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

127
128
129
130
131
132
133
134
135
136
ObjectProperty (astPath) {
  const node = astPath.node
  const key = node.key
  const value = node.value
  // if (key.name !== 'pages' || !t.isArrayExpression(value)) return
  if (key.name === 'pages' && t.isArrayExpression(value)) {
    value.elements.forEach(v => {
      pages.push(v.value)
    })
  } else if (key.name === 'tabBar' && t.isObjectExpression(value)) {
fork icon0
star icon2
watch icon2

+ 13 other calls in file

66
67
68
69
70
71
72
73
74
75
  layoutImported = false;
},
VariableDeclarator({ node }) {
  if (
    t.isIdentifier(node.id, { name: ROUTER_CONFIG }) &&
    t.isArrayExpression(node.init)
  ) {
    // 针对 ROUTER_CONFIG 变量做处理
    let pageIndex = -1;
    const hasPage = node.init.elements.some((oe, index) => {
fork icon0
star icon2
watch icon2

432
433
434
435
436
437
438
439
440
441
switch (astConvert_1.convertAstExpressionToVariable(node.key)) {
    case 'position':
        tabbarPos = astConvert_1.convertAstExpressionToVariable(node.value);
        break;
    case 'list':
        t.isArrayExpression(node.value) && node.value.elements.forEach(v => {
            if (!t.isObjectExpression(v))
                return;
            v.properties.forEach(property => {
                if (!t.isObjectProperty(property))
fork icon0
star icon0
watch icon0

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