{"version":3,"file":"mapValues.mjs","names":[],"sources":["../../src/object/mapValues.ts"],"sourcesContent":["/**\n * Creates an object with the same keys as object and values generated by running each own enumerable string keyed property through iteratee\n * @param obj - The object to iterate over\n * @param iteratee - The function invoked per iteration\n * @returns Returns the new mapped object\n * @example\n * mapValues({ a: 1, b: 2 }, (value) => value * 2); // { a: 2, b: 4 }\n */\nexport function mapValues<T extends object, U>(\n  obj: T,\n  iteratee: (value: T[keyof T], key: keyof T, obj: T) => U,\n): Record<keyof T, U> {\n  if (obj == null) {\n    return {} as Record<keyof T, U>;\n  }\n\n  const result = {} as Record<keyof T, U>;\n\n  for (const key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\n      result[key as keyof T] = iteratee(obj[key], key as keyof T, obj);\n    }\n  }\n\n  return result;\n}\n"],"mappings":";;;;;;;;;AAQA,SAAgB,UACd,KACA,UACoB;CACpB,IAAI,OAAO,MACT,OAAO,CAAC;CAGV,MAAM,SAAS,CAAC;CAEhB,KAAK,MAAM,OAAO,KAChB,IAAI,OAAO,UAAU,eAAe,KAAK,KAAK,GAAG,GAC/C,OAAO,OAAkB,SAAS,IAAI,MAAM,KAAgB,GAAG;CAInE,OAAO;AACT"}