How to use the isRestElement function from @babel/types

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

104
105
106
107
108
109
110
111
112
113
} else if (t.isObjectPattern(props)) {
  /**
   * Add property
   */

  const restProps = props.properties.find(p => t.isRestElement(p))

  if (restProps) {
    ARG = restProps.argument.name
    CURR_ID = `${ARG}['${PROP_NAME}']`
fork icon10
star icon44
watch icon10

+ 9 other calls in file

14
15
16
17
18
19
20
21
22
const params = node.params;

for (let i = 0; i < params.length; i++) {
  const param = params[i];

  if (t.isAssignmentPattern(param) || t.isRestElement(param)) {
    return i;
  }
}
fork icon0
star icon0
watch icon0

Other functions in @babel/types

Sorted by popularity

function icon

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