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

incarnate

Package Overview
Dependencies
Maintainers
2
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

incarnate - npm Package Compare versions

Comparing version 3.3.0 to 3.4.0

2

package.json
{
"name": "incarnate",
"version": "3.3.0",
"version": "3.4.0",
"description": "Dependency Injection (DI) with Lifecycle features for JavaScript.",

@@ -5,0 +5,0 @@ "main": "src/Incarnate.jsx",

@@ -6,3 +6,4 @@ import T from 'prop-types';

static INCARNATE_LABEL = 'Incarnate';
static DEPENDENCY_LABEL = 'Dependency';
static DEPENDENCY_DECLARATION_LABEL = 'Dependency Declaration';
static DEPENDENCY_DECLARATION_PROPERTY_LABEL = 'Dependency Declaration Property';
static DEFAULT_PATH_DELIMITER = '.';

@@ -20,20 +21,34 @@ static ERRORS = {

static validateDependencyDeclaration(dependencyDeclaration, dependencyName) {
const validatorShape = {
subMap: T.bool,
required: T.arrayOf(T.string),
optional: T.arrayOf(T.string),
getters: T.arrayOf(T.string),
setters: T.arrayOf(T.string),
invalidators: T.arrayOf(T.string),
listeners: T.arrayOf(T.string),
factory: T.func.isRequired
};
static validateDependencyDeclaration(dependencyDeclaration, dependencyName = Incarnate.DEPENDENCY_DECLARATION_LABEL) {
if (dependencyDeclaration instanceof Object) {
const validatorShape = {
subMap: T.bool,
required: T.arrayOf(T.string),
optional: T.arrayOf(T.string),
getters: T.arrayOf(T.string),
setters: T.arrayOf(T.string),
invalidators: T.arrayOf(T.string),
listeners: T.arrayOf(T.string),
factory: T.func.isRequired
};
const validPropList = Object.keys(validatorShape);
const dependencyPropList = Object.keys(dependencyDeclaration);
T.checkPropTypes(
validatorShape,
dependencyDeclaration,
Incarnate.DEPENDENCY_LABEL,
`${Incarnate.INCARNATE_LABEL}: ${dependencyName}`
);
dependencyPropList.forEach(key => {
if (validPropList.indexOf(key) === -1) {
console.warn(
`Warning: Invalid ${Incarnate.DEPENDENCY_DECLARATION_PROPERTY_LABEL} \`${key}\` in \`${Incarnate.INCARNATE_LABEL}: ${dependencyName}\`.`
);
}
});
T.checkPropTypes(
validatorShape,
dependencyDeclaration,
Incarnate.DEPENDENCY_DECLARATION_PROPERTY_LABEL,
`${Incarnate.INCARNATE_LABEL}: ${dependencyName}`
);
} else {
console.warn(`Warning: Invalid ${Incarnate.DEPENDENCY_DECLARATION_LABEL} \`${dependencyName}\`.`);
}
}

@@ -40,0 +55,0 @@

@@ -47,2 +47,3 @@ import expect from 'expect.js';

Incarnate.validateDependencyDeclaration({
junk: true,
subMap: 10,

@@ -49,0 +50,0 @@ required: 9,

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