@azrico/webobject 1.2.23 → 1.2.25

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.
@@ -104,7 +104,7 @@ export declare class SimpleObject extends MapableObject {
104
104
  * @param result_object
105
105
  * @returns
106
106
  */
107
- static isResultValid(result_object: any): any;
107
+ static isResultValid(result_object: any, sub?: boolean): any;
108
108
  /**
109
109
  * set the response of last save from site
110
110
  * and its type
@@ -697,7 +697,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
697
697
  } //check if the given object is a valid save result
698
698
 
699
699
 
700
- this.__saveResultIsSuccess = Boolean(type === "nothing" || this.constructor["isResultValid"](toObj));
700
+ if (type === "error") this.__saveResultIsSuccess = false;else this.__saveResultIsSuccess = Boolean(type === "nothing" || this.constructor["isResultValid"](toObj));
701
701
 
702
702
  if (type === "auto") {
703
703
  type = this.__saveResultIsSuccess ? "normal" : "error";
@@ -856,7 +856,11 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
856
856
 
857
857
  switch (_typeof(o)) {
858
858
  case "object":
859
- return o.__data_id || o._id || o.id || o.ID || "";
859
+ if (o._bsontype == "ObjectID" && typeof o.toString === "function") {
860
+ return o.toString();
861
+ }
862
+
863
+ return String(o._id || o.ID || o.id || o.__data_id || "");
860
864
 
861
865
  case "string":
862
866
  case "number":
@@ -938,6 +942,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
938
942
  }, {
939
943
  key: "isResultValid",
940
944
  value: function isResultValid(result_object) {
945
+ var sub = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
941
946
  if ((0, _object.object_isEmpty)(result_object)) return false;
942
947
 
943
948
  switch (_typeof(result_object)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.2.23",
3
+ "version": "1.2.25",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",