Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@knowark/injectarkjs

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@knowark/injectarkjs - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

tests/factory.spec.js

26

lib/injectark.js

@@ -51,28 +51,2 @@ import { Factory } from './factory.js' // eslint-disable-line

/** @param {string} resource @param {boolean} persist */
t_dependencyBuild (resource, persist = true) {
let instance = null
const rule = this.strategy[resource] || { 'method': '' }
const builder = this.factory.extract(rule['method'])
if (!builder) {
const parent = this.parent
return parent ? parent._dependencyBuild(resource, persist) : instance
}
const dependencies = builder['dependencies'] || []
const dependencyInstances = []
for (const dependency of dependencies) {
const dependencyInstance = this.resolve(dependency)
dependencyInstances.push(dependencyInstance)
}
instance = builder(...dependencyInstances)
if (persist) {
this.registry[resource] = instance
}
return instance
}
_dependencyBuild (resource, persistent = true) {

@@ -79,0 +53,0 @@ let instance = null

14

package.json
{
"name": "@knowark/injectarkjs",
"version": "0.1.0",
"version": "0.2.0",
"description": "Dependency Injector for Javascript",

@@ -8,4 +8,3 @@ "main": "index.js",

"clear": "rm -rf node_modules/",
"test": "babel-node tests/run.js",
"coverage": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text jasmine tests/*.js"
"test": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text babel-node tests/run.js"
},

@@ -25,2 +24,9 @@ "repository": {

},
"nyc": {
"exclude": [
"**/*.spec.js",
"**/run.js",
"build"
]
},
"author": "Nubark",

@@ -45,2 +51,2 @@ "license": "MIT",

}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc