MCPcopy Create free account
hub / github.com/babel/babel / hasArrayRest

Function hasArrayRest

packages/babel-plugin-transform-destructuring/src/util.ts:36–38  ·  view source on GitHub ↗

* Test if an ArrayPattern's elements contain any RestElements.

(pattern: t.ArrayPattern)

Source from the content-addressed store, hash-verified

34 */
35
36function hasArrayRest(pattern: t.ArrayPattern) {
37 return pattern.elements.some(elem => t.isRestElement(elem));
38}
39
40/**
41 * Test if an ObjectPattern's properties contain any RestElements.

Callers 2

canUnpackArrayPatternMethod · 0.85
pushArrayPatternMethod · 0.85

Calls 1

isRestElementMethod · 0.80

Tested by

no test coverage detected