Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F8929185
map-reduce.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
672 B
Referenced Files
None
Subscribers
None
map-reduce.js
View Options
const
Promise
=
require
(
"bluebird"
);
module
.
exports
=
function
(
App
){
return
{
name
:
"map-reduce"
,
calculate
:
function
(
context
,
params
,
item
){
const
action_arguments
=
[
context
,
params
.
source
.
subject_path
,
params
.
source
.
action_name
,
params
.
source
.
params
,
].
map
(
function
(
element
){
if
(
element
instanceof
Function
){
return
element
(
context
,
params
,
item
);
}
else
{
return
element
;
}
});
return
Promise
.
all
(
action_arguments
)
.
then
(
function
(
fulfilled_action_arguments
){
return
App
.
run_action
.
apply
(
App
,
fulfilled_action_arguments
);
})
.
map
(
params
.
map
)
.
reduce
(
params
.
reduce
[
0
],
params
.
reduce
[
1
]);
}
};
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Sep 20, 21:58 (7 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
924412
Default Alt Text
map-reduce.js (672 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment