@azrico/webobject 1.5.34 → 1.5.35

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.
@@ -1474,14 +1474,11 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
1474
1474
  var sub = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1475
1475
  if ((0, _object.object_isEmpty)(result_object)) return false;
1476
1476
  switch (_typeof(result_object)) {
1477
- case "string":
1478
- try {
1479
- result_object = JSON.parse(result_object);
1480
- return this.isResultValid(result_object);
1481
- } catch (_unused) {
1477
+ case "object":
1478
+ /* ----------------------------- result is error ---------------------------- */
1479
+ if (result_object instanceof Error) {
1482
1480
  return false;
1483
1481
  }
1484
- case "object":
1485
1482
  /* --------- maybe website sends the result as array with 1 element --------- */
1486
1483
  if (Array.isArray(result_object)) {
1487
1484
  if (sub) return false; //avoid going too deep
@@ -1495,6 +1492,13 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
1495
1492
  return (0, _object.object_equals)(result_object.expected, result_object.result);
1496
1493
  }
1497
1494
  return !(0, _string.string_isEmpty)(this.getID(result_object));
1495
+ case "string":
1496
+ try {
1497
+ result_object = JSON.parse(result_object);
1498
+ return this.isResultValid(result_object);
1499
+ } catch (_unused) {
1500
+ return false;
1501
+ }
1498
1502
  case "number":
1499
1503
  return result_object > 0;
1500
1504
  case "boolean":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.5.34",
3
+ "version": "1.5.35",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",