@azrico/webobject 1.5.28 → 1.5.31
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.
|
@@ -19,7 +19,7 @@ export declare class WebObjectPathHelper {
|
|
|
19
19
|
* @param action
|
|
20
20
|
* @returns
|
|
21
21
|
*/
|
|
22
|
-
static get_path
|
|
22
|
+
static get_path<T extends WebObject | typeof WebObject>(obj: T, action: string): Promise<string>;
|
|
23
23
|
/**
|
|
24
24
|
* clear all paths that are override by `override_path`
|
|
25
25
|
*/
|
|
@@ -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
|
}
|