From 99c1d9af689e5325f3cf535c4007b3aeb8325229 Mon Sep 17 00:00:00 2001 From: Minteck Date: Tue, 10 Jan 2023 14:54:04 +0100 Subject: Update - This is an automated commit --- school/node_modules/graphql/jsutils/mapValue.js.flow | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 school/node_modules/graphql/jsutils/mapValue.js.flow (limited to 'school/node_modules/graphql/jsutils/mapValue.js.flow') diff --git a/school/node_modules/graphql/jsutils/mapValue.js.flow b/school/node_modules/graphql/jsutils/mapValue.js.flow new file mode 100644 index 0000000..d6b5da4 --- /dev/null +++ b/school/node_modules/graphql/jsutils/mapValue.js.flow @@ -0,0 +1,20 @@ +// @flow strict +import objectEntries from '../polyfills/objectEntries'; + +import type { ObjMap } from './ObjMap'; + +/** + * Creates an object map with the same keys as `map` and values generated by + * running each value of `map` thru `fn`. + */ +export default function mapValue( + map: ObjMap, + fn: (value: T, key: string) => V, +): ObjMap { + const result = Object.create(null); + + for (const [key, value] of objectEntries(map)) { + result[key] = fn(value, key); + } + return result; +} -- cgit