dom-render
Advanced tools
Comparing version 1.0.24 to 1.0.25
@@ -805,2 +805,12 @@ 'use strict'; | ||
} | ||
DomRenderProxy.final = function (obj) { | ||
return new Proxy(obj, { | ||
has: function (target, p) { | ||
return p === '_DomRender_isFinal' || p in target; | ||
} | ||
}); | ||
}; | ||
DomRenderProxy.isFinal = function (obj) { | ||
return '_DomRender_isFinal' in obj; | ||
}; | ||
DomRenderProxy.prototype.run = function (objProxy) { | ||
@@ -814,9 +824,7 @@ var _this = this; | ||
var target = obj[it]; | ||
if (target !== undefined && target !== null && typeof target === 'object') { | ||
if (target !== undefined && target !== null && typeof target === 'object' && !DomRenderProxy.isFinal(target) && !Object.isFrozen(target)) { | ||
var filter = (_c = (_b = (_a = _this.config) === null || _a === void 0 ? void 0 : _a.proxyExcludeTyps) === null || _b === void 0 ? void 0 : _b.filter(function (it) { return target instanceof it; })) !== null && _c !== void 0 ? _c : []; | ||
if (filter.length === 0) { | ||
if (!Object.isFrozen(obj)) { | ||
var proxyAfter = _this.proxy(objProxy, target, it); | ||
obj[it] = proxyAfter; | ||
} | ||
var proxyAfter = _this.proxy(objProxy, target, it); | ||
obj[it] = proxyAfter; | ||
} | ||
@@ -934,3 +942,3 @@ } | ||
DomRenderProxy.prototype.proxy = function (parentProxy, obj, p) { | ||
if (obj !== undefined && obj !== null && typeof obj === 'object' && !('_DomRender_isProxy' in obj)) { | ||
if (obj !== undefined && obj !== null && typeof obj === 'object' && !('_DomRender_isProxy' in obj) && !DomRenderProxy.isFinal(obj) && !Object.isFrozen(obj)) { | ||
var domRender = new DomRenderProxy(obj, undefined, this.config); | ||
@@ -942,3 +950,3 @@ domRender.addRef(parentProxy, p); | ||
} | ||
if (obj !== undefined && obj !== null && typeof obj === 'object' && ('_DomRender_isProxy' in obj)) { | ||
if (obj !== undefined && obj !== null && typeof obj === 'object' && ('_DomRender_isProxy' in obj) && !DomRenderProxy.isFinal(obj) && !Object.isFrozen(obj)) { | ||
var d = obj._DomRender_proxy; | ||
@@ -945,0 +953,0 @@ d.addRef(this._domRender_proxy, p); |
@@ -11,2 +11,4 @@ import { RawSet } from './RawSet'; | ||
constructor(_domRender_origin: T, target?: Node, config?: Config | undefined); | ||
static final<T = any>(obj: T): any; | ||
static isFinal<T = any>(obj: T): boolean; | ||
run(objProxy: T): void; | ||
@@ -13,0 +15,0 @@ initRender(target: Node): void; |
@@ -18,2 +18,12 @@ "use strict"; | ||
} | ||
DomRenderProxy.final = function (obj) { | ||
return new Proxy(obj, { | ||
has: function (target, p) { | ||
return p === '_DomRender_isFinal' || p in target; | ||
} | ||
}); | ||
}; | ||
DomRenderProxy.isFinal = function (obj) { | ||
return '_DomRender_isFinal' in obj; | ||
}; | ||
DomRenderProxy.prototype.run = function (objProxy) { | ||
@@ -27,9 +37,7 @@ var _this = this; | ||
var target = obj[it]; | ||
if (target !== undefined && target !== null && typeof target === 'object') { | ||
if (target !== undefined && target !== null && typeof target === 'object' && !DomRenderProxy.isFinal(target) && !Object.isFrozen(target)) { | ||
var filter = (_c = (_b = (_a = _this.config) === null || _a === void 0 ? void 0 : _a.proxyExcludeTyps) === null || _b === void 0 ? void 0 : _b.filter(function (it) { return target instanceof it; })) !== null && _c !== void 0 ? _c : []; | ||
if (filter.length === 0) { | ||
if (!Object.isFrozen(obj)) { | ||
var proxyAfter = _this.proxy(objProxy, target, it); | ||
obj[it] = proxyAfter; | ||
} | ||
var proxyAfter = _this.proxy(objProxy, target, it); | ||
obj[it] = proxyAfter; | ||
} | ||
@@ -147,3 +155,3 @@ } | ||
DomRenderProxy.prototype.proxy = function (parentProxy, obj, p) { | ||
if (obj !== undefined && obj !== null && typeof obj === 'object' && !('_DomRender_isProxy' in obj)) { | ||
if (obj !== undefined && obj !== null && typeof obj === 'object' && !('_DomRender_isProxy' in obj) && !DomRenderProxy.isFinal(obj) && !Object.isFrozen(obj)) { | ||
var domRender = new DomRenderProxy(obj, undefined, this.config); | ||
@@ -155,3 +163,3 @@ domRender.addRef(parentProxy, p); | ||
} | ||
if (obj !== undefined && obj !== null && typeof obj === 'object' && ('_DomRender_isProxy' in obj)) { | ||
if (obj !== undefined && obj !== null && typeof obj === 'object' && ('_DomRender_isProxy' in obj) && !DomRenderProxy.isFinal(obj) && !Object.isFrozen(obj)) { | ||
var d = obj._DomRender_proxy; | ||
@@ -158,0 +166,0 @@ d.addRef(this._domRender_proxy, p); |
{ | ||
"name": "dom-render", | ||
"version": "1.0.24", | ||
"version": "1.0.25", | ||
"main": "DomRender.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
114828
2325