export function geoFireGetKey()

in packages/geofire/src/databaseUtils.ts [38:51]


export function geoFireGetKey(snapshot: DataSnapshot): string {
  let key;
  if (typeof snapshot.key === 'string' || snapshot.key === null) {
    key = snapshot.key;
  } else if (typeof snapshot.key === 'function') {
    // @ts-ignore
    key = snapshot.key();
  } else {
    // @ts-ignore
    key = snapshot.name();
  }

  return key;
}