base-options
Advanced tools
Comparing version 0.1.0 to 0.1.2
@@ -10,2 +10,4 @@ /*! | ||
var utils = require('./utils'); | ||
module.exports = function(key, value) { | ||
@@ -16,8 +18,9 @@ this.options = this.options || {}; | ||
if (arguments.length === 1) { | ||
return this.get('options.' + key); | ||
return utils.get(this.options, key); | ||
} | ||
this.set('options.' + key, value); | ||
utils.set(this.options, key, value); | ||
this.emit('option', key, value); | ||
return this; | ||
} | ||
if (typeof key !== 'object') { | ||
@@ -24,0 +27,0 @@ throw new TypeError('expected a string or object.'); |
{ | ||
"name": "base-options", | ||
"description": "Adds an `option` method to base-methods.", | ||
"version": "0.1.0", | ||
"version": "0.1.2", | ||
"homepage": "https://github.com/jonschlinkert/base-options", | ||
@@ -23,3 +23,6 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"dependencies": { | ||
"base-methods": "^0.2.10" | ||
"base-methods": "^0.2.10", | ||
"get-value": "^1.2.1", | ||
"lazy-cache": "^0.2.3", | ||
"set-value": "^0.2.0" | ||
}, | ||
@@ -29,6 +32,15 @@ "devDependencies": { | ||
}, | ||
"keywords": [], | ||
"keywords": [ | ||
"app", | ||
"base", | ||
"base-methods", | ||
"data", | ||
"extend", | ||
"merge", | ||
"methods" | ||
], | ||
"verb": { | ||
"related": { | ||
"list": [ | ||
"base-data", | ||
"base-methods", | ||
@@ -39,2 +51,2 @@ "class-utils" | ||
} | ||
} | ||
} |
@@ -37,2 +37,3 @@ # base-options [![NPM version](https://badge.fury.io/js/base-options.svg)](http://badge.fury.io/js/base-options) | ||
* [base-data](https://www.npmjs.com/package/base-data): adds a `data` method to base-methods. | [homepage](https://github.com/jonschlinkert/base-data) | ||
* [base-methods](https://www.npmjs.com/package/base-methods): Starter for creating a node.js application with a handful of common methods, like `set`, `get`,… [more](https://www.npmjs.com/package/base-methods) | [homepage](https://github.com/jonschlinkert/base-methods) | ||
@@ -39,0 +40,0 @@ * [class-utils](https://www.npmjs.com/package/class-utils): Utils for working with JavaScript classes and prototype methods. | [homepage](https://github.com/jonschlinkert/class-utils) |
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
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
4519
24
67
4
+ Addedget-value@^1.2.1
+ Addedlazy-cache@^0.2.3
+ Addedset-value@^0.2.0