@knowark/injectarkjs
Advanced tools
Comparing version 0.10.1 to 0.10.2
@@ -70,6 +70,4 @@ import { Factory } from './factory.js' // eslint-disable-line | ||
} | ||
const dependencies = Object.getOwnPropertyNames( | ||
Object.getPrototypeOf(this.factory)).filter( | ||
method => (!['constructor', 'extract', ...lazy].includes(method) && ( | ||
typeof this.factory[method]) === 'function')) | ||
const dependencies = this._getAllMethodNames(this.factory).filter( | ||
method => !['constructor', 'extract', ...lazy].includes(method)) | ||
for (const dependency of dependencies) { | ||
@@ -81,2 +79,12 @@ const normalized = dependency[0].toUpperCase() + dependency.slice(1) | ||
_getAllMethodNames (instance) { | ||
const methods = new Set() | ||
while ((instance = Reflect.getPrototypeOf(instance)) && | ||
instance.constructor !== Object) { | ||
const keys = Reflect.ownKeys(instance) | ||
keys.forEach((key) => methods.add(key)) | ||
} | ||
return Array.from(methods) | ||
} | ||
/** @param {string} resource */ | ||
@@ -83,0 +91,0 @@ _registryFetch (resource) { |
{ | ||
"name": "@knowark/injectarkjs", | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"description": "Dependency Injector for Javascript", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
21066
591