How to use the isArrayPattern function from @babel/types

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

78
79
80
81
82
83
84
85
86
87
Identifier(_path) {
  if (
    _path.node.name === identifierName
    && (
      (t.isObjectProperty(_path.parent) && _path.parent.value === _path.node)
      || t.isArrayPattern(_path.parent)
    )
  ) {
    targetPath = _path;
    // Note: 这里不能停止遍历,要找出可能的最后一个标识符
fork icon13
star icon88
watch icon4

+ 3 other calls in file

280
281
282
283
284
285
286
287
288
289
for (let node of statements) {
  // Hoist all declarations out of the function wrapper
  // so that they can be referenced by other modules directly.
  if (t.isVariableDeclaration(node)) {
    for (let decl of node.declarations) {
      if (t.isObjectPattern(decl.id) || t.isArrayPattern(decl.id)) {
        for (let prop of Object.values(t.getBindingIdentifiers(decl.id))) {
          decls.push(t.variableDeclarator(prop));
        }
        if (decl.init) {
fork icon1
star icon1
watch icon2

Other functions in @babel/types

Sorted by popularity

function icon

@babel/types.identifier is the most popular function in @babel/types (20936 examples)