-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstringify.js
More file actions
51 lines (51 loc) · 1.35 KB
/
stringify.js
File metadata and controls
51 lines (51 loc) · 1.35 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
module.exports = {
name: "stringify",
ns: "json",
title: "JSON Stringify",
description: "Stringify a javascript object",
expose: ["JSON"],
async: true,
phrases: {
active: "JSON Stringifying Object"
},
ports: {
input: {
"in": {
type: "any",
title: "Input Object",
async: true,
required: true,
fn: function __IN__(data, source, state, input, $, output) {
var r = function() {
output({
out: $.write('in', JSON.stringify($.in, $.replacer, $.space))
});
}.call(this);
return {
state: state,
return: r
};
}
},
replacer: {
type: "any",
title: "Replacer",
description: "A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string.",
"default": null
},
space: {
type: "number",
title: "Indentation length",
"default": 0
}
},
output: {
out: {
type: "string",
title: "The JSON string"
}
}
},
state: {},
on: {}
}