function getReferencedDeclaration({ referencedIdentifierName, globalScopeBindings }) {
  // We go from referencedIdentifierName 'y' to binding (VariableDeclarator path) 'y';
  const identifierBinding = /** @type {SwcBinding} */ (
    globalScopeBindings[referencedIdentifierName]
  );

  // We provided a referencedIdentifierName that is not in the globalScopeBindings
  if (!identifierBinding) return null;

  const { type } = identifierBinding.path.node;
  const isNonRefDeclaration = type.endsWith('Declaration');
  if (isNonRefDeclaration && !containsIdentifier(identifierBinding.path.node)) {
    throw new Error('Make sure entries added to globalScopeBindings contains an identifier');
  }

  const isImportingSpecifier = ['ImportSpecifier', 'ImportDefaultSpecifier'].includes(type);
  if (isImportingSpecifier || isNonRefDeclaration) {
    return identifierBinding.path;
  }

  const isRefDeclarator = identifierBinding.path.node.init.type === 'Identifier';
  if (isRefDeclarator) {
    return getReferencedDeclaration({
      referencedIdentifierName: nameOf(identifierBinding.path.node.init),
      globalScopeBindings,
    });
  }

  return /** @type {SwcPath} */ (identifierBinding.path.get('init'));
}
Assume we had:
 ```js
 const x = 88;
 const y = x;
 export const myIdentifier = y;
 ```
 - We started in getSourceCodeFragmentOfDeclaration (looking for 'myIdentifier'), which found VariableDeclarator of export myIdentifier
 - getReferencedDeclaration is called with { referencedIdentifierName: 'y', globalScopeBindings: {x: SwcBinding; y: SwcBinding} }
 - now we will look in globalScopeBindings, till we find declaration of 'y'
   - Is it a ref? Call ourselves with referencedIdentifierName ('x' in example above)
   - is it a non ref declaration? Return the path of the node
@param {{ referencedIdentifierName:string, globalScopeBindings:{[key:string]:SwcBinding}; }} opts
@returns {SwcPath|null}