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

Function hasObjectRest

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

* Test if an ObjectPattern's properties contain any RestElements.

(pattern: t.ObjectPattern)

Source from the content-addressed store, hash-verified

42 */
43
44function hasObjectRest(pattern: t.ObjectPattern) {
45 return pattern.properties.some(prop => t.isRestElement(prop));
46}
47
48interface UnpackableArrayExpression extends t.ArrayExpression {
49 elements: (null | t.Expression)[];

Callers 1

pushObjectPatternMethod · 0.85

Calls 1

isRestElementMethod · 0.80

Tested by

no test coverage detected