deep-core
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -41,2 +41,4 @@ /** | ||
value: function proxyOverride(handler) { | ||
var _this = this; | ||
for (var _len = arguments.length, explMethods = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
@@ -53,16 +55,22 @@ explMethods[_key - 1] = arguments[_key]; | ||
try { | ||
for (var _iterator = methods[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var _loop = function () { | ||
var prop = _step.value; | ||
if (!handler.hasOwnProperty(prop) && explMethods.indexOf(prop) === -1) { | ||
continue; | ||
return 'continue'; | ||
} | ||
var func = handler[prop]; | ||
if (typeof func === 'function') { | ||
func.bind(handler); // avoid scope issues | ||
Object.defineProperty(_this._target, prop, { | ||
value: function value() { | ||
return handler[prop].apply(handler, arguments); | ||
} | ||
}); | ||
} | ||
}; | ||
Object.defineProperty(this._target, prop, { value: func }); | ||
} | ||
for (var _iterator = methods[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var _ret = _loop(); | ||
if (_ret === 'continue') continue; | ||
} | ||
@@ -97,3 +105,3 @@ } catch (err) { | ||
value: function proxy(handler) { | ||
var _this = this; | ||
var _this2 = this; | ||
@@ -105,3 +113,3 @@ for (var _len2 = arguments.length, explMethods = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
return this.proxyOverride.apply(this, [handler].concat(_toConsumableArray(explMethods.filter(function (prop) { | ||
return typeof _this._target[prop] === 'undefined'; | ||
return typeof _this2._target[prop] === 'undefined'; | ||
})))); | ||
@@ -108,0 +116,0 @@ } |
{ | ||
"name": "deep-core", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "DEEP Core Library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93079
1887