@@ -30,7 +30,7 @@ function logDetails(result) {
30
30
31
31
function logModule ( result ) {
32
32
if ( outputFormat === "json" ) {
33
- console . log ( JSON . stringify ( result , ' ' , 4 ) ) ;
33
+ console . log ( JSON . stringify ( result , null , 4 ) ) ;
34
34
return ;
35
35
}
36
36
var table = plainTable ( { plain :true } ) ;
@@ -43,7 +43,7 @@ function logModule(result) {
43
43
44
44
function logList ( result ) {
45
45
if ( outputFormat === "json" ) {
46
- console . log ( JSON . stringify ( result , ' ' , 4 ) ) ;
46
+ console . log ( JSON . stringify ( result , null , 4 ) ) ;
47
47
return ;
48
48
}
49
49
if ( result . nodes ) { // summary of node-module
@@ -55,7 +55,7 @@ function logList(result) {
55
55
56
56
function logNodeSet ( node ) {
57
57
if ( outputFormat === "json" ) {
58
- console . log ( JSON . stringify ( node , ' ' , 4 ) ) ;
58
+ console . log ( JSON . stringify ( node , null , 4 ) ) ;
59
59
return ;
60
60
}
61
61
if ( Array . isArray ( node ) ) {
@@ -76,7 +76,7 @@ function logNodeSet(node) {
76
76
77
77
function logNodeList ( nodes ) {
78
78
if ( outputFormat === "json" ) {
79
- console . log ( JSON . stringify ( nodes , ' ' , 4 ) ) ;
79
+ console . log ( JSON . stringify ( nodes , null , 4 ) ) ;
80
80
return ;
81
81
}
82
82
if ( ! Array . isArray ( nodes ) ) {
@@ -120,7 +120,7 @@ function logNodeList(nodes) {
120
120
121
121
function logProjectList ( projects ) {
122
122
if ( outputFormat === "json" ) {
123
- console . log ( JSON . stringify ( projects , ' ' , 4 ) ) ;
123
+ console . log ( JSON . stringify ( projects , null , 4 ) ) ;
124
124
return ;
125
125
}
126
126
var projectList = projects . projects || [ ] ;
@@ -156,27 +156,27 @@ module.exports = {
156
156
if ( msg . response ) {
157
157
if ( msg . response . status === 401 ) {
158
158
if ( outputFormat === "json" ) {
159
- console . log ( JSON . stringify ( { error :"Not logged in. Use 'login' to log in." , status : 401 } , " " , 4 ) ) ;
159
+ console . log ( JSON . stringify ( { error :"Not logged in. Use 'login' to log in." , status : 401 } , null , 4 ) ) ;
160
160
} else {
161
161
console . warn ( "Not logged in. Use 'login' to log in." ) ;
162
162
}
163
163
} else if ( msg . response . data ) {
164
164
if ( msg . response . status === 404 && ! msg . response . data . message ) {
165
165
if ( outputFormat === "json" ) {
166
- console . log ( JSON . stringify ( { error :"Node-RED Admin API not found. Use 'target' to set API location" , status : 404 } , " " , 4 ) ) ;
166
+ console . log ( JSON . stringify ( { error :"Node-RED Admin API not found. Use 'target' to set API location" , status : 404 } , null , 4 ) ) ;
167
167
} else {
168
168
console . warn ( "Node-RED Admin API not found. Use 'target' to set API location" ) ;
169
169
}
170
170
} else {
171
171
if ( outputFormat === "json" ) {
172
- console . log ( JSON . stringify ( { error :msg . response . data . message , status : msg . response . status } , " " , 4 ) ) ;
172
+ console . log ( JSON . stringify ( { error :msg . response . data . message , status : msg . response . status } , null , 4 ) ) ;
173
173
} else {
174
174
console . warn ( msg . response . status + ": " + msg . response . data . message ) ;
175
175
}
176
176
}
177
177
} else {
178
178
if ( outputFormat === "json" ) {
179
- console . log ( JSON . stringify ( { error :msg . toString ( ) , status : msg . response . status } , " " , 4 ) ) ;
179
+ console . log ( JSON . stringify ( { error :msg . toString ( ) , status : msg . response . status } , null , 4 ) ) ;
180
180
} else {
181
181
console . warn ( msg . response . status + ": " + msg . toString ( ) ) ;
182
182
}
0 commit comments