@azrico/webobject 1.5.28 → 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.
@@ -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(o: any): string;
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(o) {
1404
- if (o == null || o == undefined) return "";
1405
- switch (_typeof(o)) {
1403
+ value: function getID(obj) {
1404
+ if (obj == null || obj == undefined) return "";
1405
+ switch (_typeof(obj)) {
1406
1406
  case "object":
1407
- if (o._bsontype == "ObjectID" && typeof o.toString === "function") {
1408
- return o.toString();
1407
+ if (String(obj._bsontype).toLowerCase() == "objectid") {
1408
+ return String(obj);
1409
1409
  }
1410
- return String(o._id || o.insertedId || o.ID || o.id || o.__data_id || "");
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(o);
1413
+ return String(obj);
1414
1414
  }
1415
1415
  return "";
1416
1416
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.5.28",
3
+ "version": "1.5.30",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",