is-valid-app
Advanced tools
Comparing version 0.1.0 to 0.1.1
15
index.js
@@ -10,4 +10,3 @@ /*! | ||
var isRegistered = require('is-registered'); | ||
var isValid = require('is-valid-instance'); | ||
var utils = require('./utils'); | ||
@@ -18,9 +17,17 @@ module.exports = function(app, name, types) { | ||
} | ||
if (!isValid(app, types)) { | ||
// if `app` is not a valid instance of `Base`, or if `app` is a valid | ||
// instance of Base by not one of the given `types` return false | ||
if (!utils.isValid(app, types)) { | ||
return false; | ||
} | ||
if (isRegistered(app, name)) { | ||
// if the `name` has already been registered as a plugin, return false | ||
if (utils.isRegistered(app, name)) { | ||
return false; | ||
} | ||
var debug = utils.debug('base:generate:' + name); | ||
debug('initializing from <%s>', module.parent.id); | ||
return true; | ||
}; |
{ | ||
"name": "is-valid-app", | ||
"description": "Wrapper around is-valid-instance and is-registered for validating `base` plugins. Returns true if `app` is a valid instance of base and a plugin is not registered yet.", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"homepage": "https://github.com/jonschlinkert/is-valid-app", | ||
@@ -13,3 +13,4 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"files": [ | ||
"index.js" | ||
"index.js", | ||
"utils.js" | ||
], | ||
@@ -24,4 +25,6 @@ "main": "index.js", | ||
"dependencies": { | ||
"is-registered": "^0.1.4", | ||
"is-valid-instance": "^0.1.0" | ||
"debug": "^2.2.0", | ||
"is-registered": "^0.1.5", | ||
"is-valid-instance": "^0.1.0", | ||
"lazy-cache": "^2.0.1" | ||
}, | ||
@@ -45,10 +48,11 @@ "devDependencies": { | ||
"list": [ | ||
"base", | ||
"is-registered", | ||
"is-valid-instance", | ||
"base" | ||
"is-valid-instance" | ||
] | ||
}, | ||
"reflinks": [ | ||
"base", | ||
"verb", | ||
"base" | ||
"verb-readme-generator" | ||
], | ||
@@ -55,0 +59,0 @@ "lint": { |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
3508
4
40
4
2
+ Addeddebug@^2.2.0
+ Addedlazy-cache@^2.0.1
+ Addeddebug@2.6.9(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedkind-of@3.2.2(transitive)
+ Addedlazy-cache@2.0.2(transitive)
+ Addedms@2.0.0(transitive)
+ Addedset-getter@0.1.1(transitive)
+ Addedto-object-path@0.3.0(transitive)
Updatedis-registered@^0.1.5