weavedb-node-client 0.18.7 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +10 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -105,8 +105,13 @@ class SDK extends Base {
|
|
|
105
105
|
ret({ result: null, err })
|
|
106
106
|
} else {
|
|
107
107
|
if (response.err === "") {
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
try {
|
|
109
|
+
const result =
|
|
110
|
+
response.result === "" ? null : JSON.parse(response.result)
|
|
111
|
+
ret({ result, err: null })
|
|
112
|
+
} catch (e) {
|
|
113
|
+
ret({ result: null, err: e })
|
|
114
|
+
}
|
|
110
115
|
} else {
|
|
111
116
|
ret({ result: null, err: response.err })
|
|
112
117
|
}
|
|
@@ -136,6 +141,9 @@ class SDK extends Base {
|
|
|
136
141
|
async admin(op, opt) {
|
|
137
142
|
return this._write2("admin", op, opt)
|
|
138
143
|
}
|
|
144
|
+
async node(op, opt) {
|
|
145
|
+
return this.write("admin", op)
|
|
146
|
+
}
|
|
139
147
|
}
|
|
140
148
|
|
|
141
149
|
module.exports = SDK
|