base-option
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -12,5 +12,5 @@ /*! | ||
module.exports = function(options, types) { | ||
module.exports = function(options) { | ||
return function fn(app) { | ||
if (!utils.isValid(app, types)) return; | ||
if (!utils.isValid(app)) return; | ||
@@ -17,0 +17,0 @@ var Options = utils.Options; |
{ | ||
"name": "base-option", | ||
"description": "Adds a few options methods to base, like `option`, `enable` and `disable`. See the readme for the full API.", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"homepage": "https://github.com/node-base/base-option", | ||
@@ -27,3 +27,3 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"is-registered": "^0.1.4", | ||
"is-valid-instance": "^0.1.0", | ||
"isobject": "^2.1.0", | ||
"lazy-cache": "^2.0.1", | ||
@@ -30,0 +30,0 @@ "mixin-deep": "^1.1.3", |
11
utils.js
@@ -14,3 +14,3 @@ 'use strict'; | ||
require('is-registered'); | ||
require('is-valid-instance'); | ||
require('isobject', 'isObject'); | ||
require('mixin-deep', 'merge'); | ||
@@ -25,6 +25,11 @@ require('option-cache', 'Options'); | ||
utils.isValid = function(app, types) { | ||
if (!utils.isValidInstance(app, types || ['app', 'views', 'collection', 'list'])) { | ||
utils.isValid = function(app) { | ||
if (!utils.isObject(app)) { | ||
return false; | ||
} | ||
if (typeof app.get !== 'function' && typeof app.set !== 'function') { | ||
return false; | ||
} | ||
if (utils.isRegistered(app, 'base-option')) { | ||
@@ -31,0 +36,0 @@ return false; |
11949
127
+ Addedisobject@^2.1.0
- Removedis-valid-instance@^0.1.0
- Removedis-valid-instance@0.1.0(transitive)
- Removedpascalcase@0.1.1(transitive)