objectEntries.js.flow 380 B

123456789101112
  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 workaround for: https://github.com/facebook/flow/issues/5838
  6. const objectEntries =
  7. Object.entries || ((obj) => Object.keys(obj).map((key) => [key, obj[key]]));
  8. export default objectEntries;