UNPKG

872 BSource Map (JSON)View Raw
1{"version":3,"names":["fromEntries","entries","reduce","acc","k","v","hasOwnProperty","Error"],"sources":["fromEntries.tsx"],"sourcesContent":["// Object.fromEntries is not available in older iOS versions\nexport default function fromEntries<K extends string, V>(\n entries: (readonly [K, V])[]\n) {\n return entries.reduce((acc, [k, v]) => {\n if (acc.hasOwnProperty(k)) {\n throw new Error(`A value for key '${k}' already exists in the object.`);\n }\n\n acc[k] = v;\n return acc;\n }, {} as Record<K, V>);\n}\n"],"mappings":"AAAA;AACA,eAAe,SAASA,WAAT,CACbC,OADa,EAEb;EACA,OAAOA,OAAO,CAACC,MAAR,CAAe,CAACC,GAAD,WAAiB;IAAA,IAAX,CAACC,CAAD,EAAIC,CAAJ,CAAW;;IACrC,IAAIF,GAAG,CAACG,cAAJ,CAAmBF,CAAnB,CAAJ,EAA2B;MACzB,MAAM,IAAIG,KAAJ,CAAW,oBAAmBH,CAAE,iCAAhC,CAAN;IACD;;IAEDD,GAAG,CAACC,CAAD,CAAH,GAASC,CAAT;IACA,OAAOF,GAAP;EACD,CAPM,EAOJ,EAPI,CAAP;AAQD"}
\No newline at end of file