-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathisEmpty.js
46 lines (46 loc) · 911 Bytes
/
isEmpty.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
45
46
module.exports = {
name: "isEmpty",
ns: "array",
async: true,
description: "Checks whether the array is empty.",
phrases: {
active: "Determining whether the array is empty"
},
ports: {
input: {
"in": {
title: "Array",
type: "array",
async: true,
fn: function __IN__(data, source, state, input, $, output) {
var r = function() {
if ($.in.length > 0) {
output({
yes: $.get('in')
});
} else {
output({
no: $.get('in')
});
}
}.call(this);
return {
state: state,
return: r
};
}
}
},
output: {
yes: {
title: "Yes",
type: "array"
},
no: {
title: "No",
type: "array"
}
}
},
state: {}
}