Comparing version 0.1.8 to 0.2.0
13
index.js
@@ -11,2 +11,3 @@ /*! | ||
var path = require('path'); | ||
var isValidInstance = require('is-valid-instance'); | ||
var isRegistered = require('is-registered'); | ||
@@ -16,3 +17,3 @@ | ||
return function plugin() { | ||
if (!isValidInstance(this, fn)) return; | ||
if (!isValid(this)) return; | ||
@@ -40,10 +41,10 @@ Object.defineProperty(this, 'cwd', { | ||
function isValidInstance(app, fn) { | ||
if (typeof fn === 'function') { | ||
return fn(app, 'base-cwd'); | ||
function isValid(app) { | ||
if (!isValidInstance(app)) { | ||
return false; | ||
} | ||
if (app && typeof app === 'object' && (app.isCollection || app.isView)) { | ||
if (isRegistered(app, 'base-cwd')) { | ||
return false; | ||
} | ||
return !isRegistered(app, 'base-cwd'); | ||
return true; | ||
} |
{ | ||
"name": "base-cwd", | ||
"description": "Base plugin that adds a getter/setter for the current working directory.", | ||
"version": "0.1.8", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/node-base/base-cwd", | ||
@@ -53,4 +53,5 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"dependencies": { | ||
"is-registered": "^0.1.3" | ||
"is-registered": "^0.1.3", | ||
"is-valid-instance": "^0.1.0" | ||
} | ||
} |
@@ -93,2 +93,2 @@ # base-cwd [](https://www.npmjs.com/package/base-cwd) [](https://npmjs.org/package/base-cwd) [](https://travis-ci.org/node-base/base-cwd) | ||
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 15, 2016._ | ||
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 17, 2016._ |
41
6614
2
+ Addedis-valid-instance@^0.1.0
+ Addedis-valid-instance@0.1.0(transitive)
+ Addedpascalcase@0.1.1(transitive)