@azrico/webobject 1.5.27 → 1.5.30
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.
|
@@ -754,7 +754,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
754
754
|
final_object["_deleted"] = this.isDeleted;
|
|
755
755
|
}
|
|
756
756
|
/* ---------------------------- add id properties --------------------------- */
|
|
757
|
-
if (p.allProperties || p.needId) {
|
|
757
|
+
if (p.allProperties || p.needId || p.isChild) {
|
|
758
758
|
if (this["_index_key"]) final_object["_index_key"] = this["_index_key"];
|
|
759
759
|
gotIndex = this.getIndex();
|
|
760
760
|
gotId = this.getID();
|
|
@@ -259,7 +259,7 @@ export declare class SimpleObject extends MapableObject {
|
|
|
259
259
|
getID(): string;
|
|
260
260
|
static getIndexOrID(o: any): number;
|
|
261
261
|
static getIndex(o: any): number;
|
|
262
|
-
static getID(
|
|
262
|
+
static getID(obj: any): string;
|
|
263
263
|
event_run(eventName: string, ...params: any): Promise<any[] | undefined>;
|
|
264
264
|
event_use(name: string, runEvent: (...inputdata: any) => any, onlyOn?: any, runOnce?: boolean): any;
|
|
265
265
|
event_remove(name: string, uname: string): boolean | undefined;
|
|
@@ -1400,17 +1400,17 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
1400
1400
|
}
|
|
1401
1401
|
}, {
|
|
1402
1402
|
key: "getID",
|
|
1403
|
-
value: function getID(
|
|
1404
|
-
if (
|
|
1405
|
-
switch (_typeof(
|
|
1403
|
+
value: function getID(obj) {
|
|
1404
|
+
if (obj == null || obj == undefined) return "";
|
|
1405
|
+
switch (_typeof(obj)) {
|
|
1406
1406
|
case "object":
|
|
1407
|
-
if (
|
|
1408
|
-
return
|
|
1407
|
+
if (String(obj._bsontype).toLowerCase() == "objectid") {
|
|
1408
|
+
return String(obj);
|
|
1409
1409
|
}
|
|
1410
|
-
return String(
|
|
1410
|
+
return String(obj._id || obj.insertedId || obj.ID || obj.id || obj.__data_id || "");
|
|
1411
1411
|
case "string":
|
|
1412
1412
|
case "number":
|
|
1413
|
-
return String(
|
|
1413
|
+
return String(obj);
|
|
1414
1414
|
}
|
|
1415
1415
|
return "";
|
|
1416
1416
|
}
|