UNPKG
imma
Version:
latest (0.0.1)
0.0.1
A collection of functions for dealing with native arrays and objects immutably
imma
/
lib
/
object
/
mapKeys.js
9 lines
(8 loc)
•
197 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
'use strict'
const
mapKeys =
module
.
exports
=
(
object
, fn
) =>
{
const
result = {}
for
(
let
key
in
object
) { result[
fn
(key,
object
[key],
object
)] =
object
[key] }
return
result }