Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F995842
transform-object.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
416 B
Referenced Files
None
Subscribers
None
transform-object.js
View Options
function
transformObject
(
obj
,
prop_tranformer
,
value_transformer
)
{
return
Object
.
keys
(
obj
).
reduce
((
new_obj
,
prop
)
=>
{
let
new_prop
=
prop_tranformer
(
prop
);
new_obj
[
new_prop
]
=
obj
[
prop
]
instanceof
Object
?
transformObject
(
obj
[
prop
],
prop_tranformer
,
value_transformer
)
:
value_transformer
(
prop
,
obj
[
prop
]);
return
new_obj
;
},
Array
.
isArray
(
obj
)
?
[]
:
{});
}
module
.
exports
=
transformObject
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 21:56 (23 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
556973
Default Alt Text
transform-object.js (416 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment