objectEntries.js.flow 399 B

1234567891011
  1. // @flow strict
  2. import type { ObjMap } from '../jsutils/ObjMap';
  3. declare function objectEntries<T>(obj: ObjMap<T>): Array<[string, T]>;
  4. /* eslint-disable no-redeclare */
  5. // $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441
  6. const objectEntries =
  7. Object.entries || ((obj) => Object.keys(obj).map((key) => [key, obj[key]]));
  8. export default objectEntries;