lib/utils/utils.js
function collectObjectPatternBindings(node, initialObjToBinding) {
  if (!isObjectPattern(node.id)) return [];

  const identifiers = Object.keys(initialObjToBinding);
  const objBindingName = node.init.name;
  const bindingIndex = identifiers.indexOf(objBindingName);
  if (bindingIndex === -1) return [];

  const binding = identifiers[bindingIndex];

  return node.id.properties
    .filter(props => initialObjToBinding[binding].indexOf(props.key.name) > -1)
    .map(props => props.value.name);
}
function collectObjectPatternBindings(node, initialObjToBinding) {
  if (!isObjectPattern(node.id)) return [];

  const identifiers = Object.keys(initialObjToBinding);
  const objBindingName = node.init.name;
  const bindingIndex = identifiers.indexOf(objBindingName);
  if (bindingIndex === -1) return [];

  const binding = identifiers[bindingIndex];

  return node.id.properties
    .filter(props => initialObjToBinding[binding].indexOf(props.key.name) > -1)
    .map(props => props.value.name);
}
function collectObjectPatternBindings ( node , initialObjToBinding ) { if ( ! isObjectPattern ( node . id ) ) return [ ] ; const identifiers = Object . keys ( initialObjToBinding ) ; const objBindingName = node . init . name ; const bindingIndex = identifiers . indexOf ( objBindingName ) ; if ( bindingIndex === - 1 ) return [ ] ; const binding = identifiers [ bindingIndex ] ; return node . id . properties . filter ( props => initialObjToBinding [ binding ] . indexOf ( props . key . name ) > - 1 ) . map ( props => props . value . name ) ; }
Find deconstructed bindings based on the initialObjToBinding hash.

Extracts the names of destructured properties, even if they are aliased.
`initialObjToBinding` should should have variable names as keys and bindings array as values.
Given `const { $: foo } = Ember` it will return `['foo']`.

@param  {VariableDeclarator} node node to parse
@param  {Object}             initialObjToBinding relevant bindings
@return {String[]}           list of object pattern bindings
Find deconstructed bindings based on the initialObjToBinding hash .