-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.js
44 lines (44 loc) · 904 Bytes
/
map.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module.exports = {
name: "map",
ns: "array",
async: true,
description: "Creates new array output with the results of calling the provided function on every element in this array",
phrases: {
active: "Mapping array"
},
ports: {
input: {
"in": {
title: "Value",
type: "array",
async: true,
fn: function __IN__(data, source, state, input, $, output) {
var r = function() {
output({
out: $.write('in', $.in.map($.fn))
});
}.call(this);
return {
state: state,
return: r
};
}
},
fn: {
title: "Function",
type: "function",
args: ["val",
"index",
"array"
]
}
},
output: {
out: {
title: "Output",
type: "array"
}
}
},
state: {}
}