{"version":3,"file":"mapValues.cjs","names":["createMergeTarget","isUnsafeKey"],"sources":["../../src/object/mapValues.ts"],"sourcesContent":["import isUnsafeKey from './isUnsafeKey';\nimport { createMergeTarget } from './merge';\n\n/**\n * Creates an object with the same keys and values generated by running each\n * own enumerable string keyed property of object through the callback.\n *\n * `__proto__`, `constructor` and `prototype` are skipped, as they are\n * everywhere in this module.\n *\n * @example\n * mapValues({ a: 1, b: 2 }, (v) => v * 2) //=> { a: 2, b: 4 }\n */\nexport default function mapValues<T extends object, R>(\n  obj: T,\n  fn: (value: T[keyof T], key: string | symbol) => R,\n): Record<keyof T, R> {\n  const result: any = createMergeTarget(obj);\n  const keys = [\n    ...Object.keys(obj),\n    ...Object.getOwnPropertySymbols(obj).filter((sym) =>\n      Object.prototype.propertyIsEnumerable.call(obj, sym),\n    ),\n  ] as (string | symbol)[];\n\n  for (const key of keys) {\n    if (isUnsafeKey(key)) {\n      continue;\n    }\n\n    result[key as keyof T] = fn(obj[key as keyof T], key);\n  }\n\n  return result;\n}\n"],"mappings":"6JAaA,SAAwB,EACtB,EACA,EACoB,CACpB,IAAM,EAAcA,EAAAA,kBAAkB,CAAG,EACnC,EAAO,CACX,GAAG,OAAO,KAAK,CAAG,EAClB,GAAG,OAAO,sBAAsB,CAAG,CAAC,CAAC,OAAQ,GAC3C,OAAO,UAAU,qBAAqB,KAAK,EAAK,CAAG,CACrD,CACF,EAEA,IAAK,IAAM,KAAO,EACZC,EAAAA,QAAY,CAAG,IAInB,EAAO,GAAkB,EAAG,EAAI,GAAiB,CAAG,GAGtD,OAAO,CACT"}