File size: 382 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import { AST_NODE_TYPES } from '@typescript-eslint/utils'
import type { TSESTree } from '@typescript-eslint/utils'

export const NoRestDestructuringUtils = {
  isObjectRestDestructuring(node: TSESTree.Node): boolean {
    if (node.type !== AST_NODE_TYPES.ObjectPattern) {
      return false
    }
    return node.properties.some((p) => p.type === AST_NODE_TYPES.RestElement)
  },
}