-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpath.js
More file actions
54 lines (54 loc) · 1.23 KB
/
path.js
File metadata and controls
54 lines (54 loc) · 1.23 KB
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
47
48
49
50
51
52
53
54
module.exports = {
name: "path",
ns: "json",
title: "JSON Path",
description: "JSON-Path takes a specially formatted path statement and applies it to an object graph in order to select results. The results are returned as an array of data that matches the path.",
async: true,
phrases: {
active: "Performing JSON Path"
},
ports: {
input: {
"in": {
type: "object",
title: "Input JSON",
description: "Any JSON document",
required: true,
fn: function __IN__(data, source, state, input, $, output, jsonpath_plus) {
var r = function() {
output({
out: $.write('in', jsonpath_plus({
json: $.in,
path: $.path
}))
});
}.call(this);
return {
state: state,
return: r
};
}
},
path: {
type: "string",
title: "Path",
description: "",
required: true
}
},
output: {
out: {
type: "array",
title: "Selection Output",
description: ""
}
}
},
dependencies: {
npm: {
"jsonpath-plus": require('jsonpath-plus')
}
},
state: {},
on: {}
}