@azrico/webobject 1.4.19 → 1.4.20
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.
|
@@ -10,6 +10,7 @@ export declare class ObjectManager<ObjType extends SimpleObject> {
|
|
|
10
10
|
__sendEvents: boolean;
|
|
11
11
|
__currentObject?: ObjType | null;
|
|
12
12
|
__options?: object;
|
|
13
|
+
__object_nullable: boolean;
|
|
13
14
|
notifyChanged(type: string, key: PropOf<ObjType> | string, value?: any, subvalue?: string): Promise<false | any[] | undefined>;
|
|
14
15
|
get obj(): ObjType | undefined;
|
|
15
16
|
/**
|
|
@@ -31,6 +31,7 @@ var ObjectManager = /*#__PURE__*/function () {
|
|
|
31
31
|
_defineProperty(this, "__sendEvents", true);
|
|
32
32
|
_defineProperty(this, "__currentObject", void 0);
|
|
33
33
|
_defineProperty(this, "__options", void 0);
|
|
34
|
+
_defineProperty(this, "__object_nullable", false);
|
|
34
35
|
_defineProperty(this, "get", this.getValue);
|
|
35
36
|
}
|
|
36
37
|
_createClass(ObjectManager, [{
|
|
@@ -92,7 +93,7 @@ var ObjectManager = /*#__PURE__*/function () {
|
|
|
92
93
|
if (this.__currentObject) {
|
|
93
94
|
this.__currentObject.set_managerClass(this);
|
|
94
95
|
}
|
|
95
|
-
if (toObj == null) {
|
|
96
|
+
if (toObj == null && !this.__object_nullable) {
|
|
96
97
|
console.warn("setObject was used to set null. try to use empty objects instead of null");
|
|
97
98
|
}
|
|
98
99
|
return true;
|
|
@@ -169,7 +170,7 @@ var ObjectManager = /*#__PURE__*/function () {
|
|
|
169
170
|
var original = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
170
171
|
var thisobj = this.obj;
|
|
171
172
|
if (thisobj == null || typeof thisobj.getValue != "function") {
|
|
172
|
-
console.error("cant use getValue when object is not defined. maybe you have to use New() ?");
|
|
173
|
+
if (!this.__object_nullable) console.error("cant use getValue when object is not defined. maybe you have to use New() ?");
|
|
173
174
|
return null;
|
|
174
175
|
}
|
|
175
176
|
return thisobj.getValue(key, original);
|
|
@@ -194,7 +195,7 @@ var ObjectManager = /*#__PURE__*/function () {
|
|
|
194
195
|
_context2.next = 4;
|
|
195
196
|
break;
|
|
196
197
|
}
|
|
197
|
-
console.error("cant use setValue when object is not defined. maybe you have to use New() ?");
|
|
198
|
+
if (!this.__object_nullable) console.error("cant use setValue when object is not defined. maybe you have to use New() ?");
|
|
198
199
|
return _context2.abrupt("return", false);
|
|
199
200
|
case 4:
|
|
200
201
|
_context2.next = 6;
|