@schukai/monster 3.11.0 → 3.12.1
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -6,12 +6,22 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
import { internalSymbol, instanceSymbol } from "../../../constants.mjs";
|
9
|
-
import { isObject } from "../../../types/is.mjs";
|
9
|
+
import { isObject,isFunction } from "../../../types/is.mjs";
|
10
10
|
import { Server } from "../server.mjs";
|
11
11
|
import { WriteError } from "./restapi/writeerror.mjs";
|
12
12
|
|
13
13
|
export { RestAPI };
|
14
14
|
|
15
|
+
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @type {symbol}
|
19
|
+
* @memberOf Monster
|
20
|
+
* @license AGPLv3
|
21
|
+
* @since 3.12.0
|
22
|
+
*/
|
23
|
+
const rawDataSymbol = Symbol.for("@schukai/monster/data/datasource/server/restapi/rawdata");
|
24
|
+
|
15
25
|
/**
|
16
26
|
* The RestAPI is a class that enables a REST API server.
|
17
27
|
*
|
@@ -182,6 +192,9 @@ function fetchData(init, key, callback) {
|
|
182
192
|
|
183
193
|
try {
|
184
194
|
obj = JSON.parse(body);
|
195
|
+
|
196
|
+
response[rawDataSymbol] = obj;
|
197
|
+
|
185
198
|
} catch (e) {
|
186
199
|
if (body.length > 100) {
|
187
200
|
body = `${body.substring(0, 97)}...`;
|
@@ -193,6 +206,7 @@ function fetchData(init, key, callback) {
|
|
193
206
|
if (callback && isFunction(callback)) {
|
194
207
|
callback(obj);
|
195
208
|
}
|
209
|
+
|
196
210
|
return response;
|
197
211
|
});
|
198
212
|
}
|
package/source/types/version.mjs
CHANGED
package/test/cases/monster.mjs
CHANGED