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

pang

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pang - npm Package Compare versions

Comparing version 0.5.5 to 0.5.6

index.d.ts

32

index.js

@@ -43,3 +43,2 @@ /*--------------------------------------------------------------------------

}
return null;

@@ -67,11 +66,13 @@ });

Domain.prototype.factory = function (name, initializer) {
if (!this.isfunction(initializer)) {
throw Error('pang: initializer should be a function.');
}
if (this.isfunction(initializer)) {
var names = this.extractargs(initializer);
var names = this.extractargs(initializer);
this.dependencies.push(new Dependency(this, name, names, initializer, false, null));
var dependency = new Dependency(this, name, names, initializer, false, null);
return this;
}
this.dependencies.push(dependency);
this.dependencies.push(new Dependency(this, name, [], function () {
return initializer;
}, false, null));

@@ -103,5 +104,3 @@ return this;

for (var i = 0; i < this.dependencies.length; i++) {
var dependency = new Dependency(domain, this.dependencies[i].name, this.dependencies[i].names, this.dependencies[i].initializer, false, null);
domain.dependencies.push(dependency);
domain.dependencies.push(new Dependency(domain, this.dependencies[i].name, this.dependencies[i].names, this.dependencies[i].initializer, false, null));
}

@@ -167,11 +166,8 @@

if (!match) {
return [];
if (match) {
if (match[1]) {
return match[1].split(/\s*,\s*/);
}
}
if (match[1]) {
var arguments = match[1].split(/\s*,\s*/);
}
return arguments;
return [];
};

@@ -178,0 +174,0 @@ return Domain;

{
"name": "pang",
"version": "0.5.5",
"version": "0.5.6",
"description": "A simple dependency injection library for node",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -9,3 +9,3 @@ # pang

The following example illustates setting up a pang domain/kernel.
The following example illustates setting up a pang domain/kernel.

@@ -18,6 +18,3 @@ ```javascript

domain.factory('configuration', function() {
return new Configuration()
})
domain.factory('http', require('http'))

@@ -29,5 +26,5 @@ domain.factory('repository', function(configuration) {

domain.factory('server', function(configuration, repository) {
domain.factory('server', function(configuration, http, repository) {
return new Server(configuration, repository)
return new Server(configuration, http, repository)
})

@@ -45,3 +42,3 @@ ```

var instance = domain.singleton('server')
var instance = domain.singleton('repository')

@@ -52,2 +49,2 @@ ### domain.transient()

var instance = domain.transient('server')
var instance = domain.transient('repository')
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