You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
246 B

  1. // @flow
  2. export default function expandToHashMap<
  3. T: number | string | boolean,
  4. K: string
  5. >(value: T, keys: Array<K>): { [key: string]: T } {
  6. return keys.reduce((hashMap, key) => {
  7. hashMap[key] = value;
  8. return hashMap;
  9. }, {});
  10. }