diff --git a/src/ReadonlyRecord.ts b/src/ReadonlyRecord.ts index a7af5d0fe8..13b24eb582 100644 --- a/src/ReadonlyRecord.ts +++ b/src/ReadonlyRecord.ts @@ -1120,8 +1120,8 @@ export const toEntries = toReadonlyArray * @since 2.12.0 * @category conversions */ -export const fromEntries = (fa: ReadonlyArray): ReadonlyRecord => { - const out: Record = {} +export const fromEntries = (fa: ReadonlyArray): ReadonlyRecord => { + const out: Record = Object.create(null) for (const a of fa) { out[a[0]] = a[1] } diff --git a/src/Record.ts b/src/Record.ts index 8a86f9396f..882002b852 100644 --- a/src/Record.ts +++ b/src/Record.ts @@ -808,7 +808,7 @@ export const toEntries = toArray * @since 2.12.0 * @category conversions */ -export const fromEntries = (fa: Array<[string, A]>): Record => fromFoldable(Se.last(), A.Foldable)(fa) +export const fromEntries = (fa: Array<[K, A]>): Record => fromFoldable(Se.last(), A.Foldable)(fa) /** * Create a `Record` from a foldable collection using the specified functions to