Comparing version 1.0.7 to 1.0.8
10
index.ts
@@ -117,5 +117,9 @@ class DeboratorOptions { | ||
// - trying to avoid decorating sub-class or other decorators such as mobx functions | ||
for (const prop in c.prototype) { | ||
if (c.prototype.hasOwnProperty(prop)) { | ||
const protoPropNames = Object.getOwnPropertyNames(c.prototype); | ||
const propsDone: string[] = []; | ||
for (let prop in protoPropNames) { | ||
prop = protoPropNames[prop]; | ||
if (prop !== "constructor" && c.prototype.hasOwnProperty(prop)) { | ||
decorateFunction(instance, prop); | ||
propsDone.push(prop); | ||
} | ||
@@ -126,3 +130,3 @@ } | ||
for (const prop in instance) { | ||
if (instance.hasOwnProperty(prop) && !c.prototype.hasOwnProperty(prop)) { | ||
if (propsDone.indexOf(prop) < 0 && instance.hasOwnProperty(prop)) { //} && !c.prototype.hasOwnProperty(prop)) { | ||
decorateFunction(instance, prop); | ||
@@ -129,0 +133,0 @@ } |
{ | ||
"name": "deborator", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "a TypeScript decorator, to add console.log() to all methods and properties of a class.", | ||
@@ -5,0 +5,0 @@ "main": "deborator.ts", |
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
8082
120