UNPKG
@warp-works/warpjs-map-plugin
Version:
latest (2.0.2)
node14 (2.0.1)
2.0.2
2.0.1
2.0.0
2.0.0-rc.1
1.2.12
1.2.11
1.2.10
1.2.9
1.2.8
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
0.2.1
0.2.0
0.1.2
0.1.0
WarpJS map browser plugin
github.com/WarpWorks/warpjs-map-plugin
WarpWorks/warpjs-map-plugin
@warp-works/warpjs-map-plugin
/
server
/
controllers
/
transform-collection-documents.js
8 lines
(5 loc)
•
246 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
const
_ =
require
(
'lodash'
);
const
transformDocument =
require
(
'./transform-document'
);
module
.
exports
=
(
collection
) =>
{
return
_.
reduce
(collection,
(
memo, doc, entityID
) =>
_.
extend
(memo, { [entityID]:
transformDocument
(doc) }), {}); };