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

base-options

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base-options - npm Package Compare versions

Comparing version 0.1.3 to 0.3.0

30

index.js

@@ -12,20 +12,22 @@ /*!

module.exports = function(key, value) {
this.options = this.options || {};
module.exports = function option(app) {
app.mixin('option', function(key, value) {
this.options = this.options || {};
if (typeof key === 'string') {
if (arguments.length === 1) {
return utils.get(this.options, key);
if (typeof key === 'string') {
if (arguments.length === 1) {
return utils.get(this.options, key);
}
utils.set(this.options, key, value);
this.emit('option', key, value);
return this;
}
utils.set(this.options, key, value);
this.emit('option', key, value);
return this;
}
if (typeof key !== 'object') {
throw new TypeError('expected a string or object.');
}
if (key == null || typeof key !== 'object') {
throw new TypeError('expected a string or object.');
}
this.visit('option', key);
return this;
this.visit('option', key);
return this;
});
};
{
"name": "base-options",
"description": "Adds an `option` method to base-methods.",
"version": "0.1.3",
"version": "0.3.0",
"homepage": "https://github.com/jonschlinkert/base-options",

@@ -24,3 +24,2 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"dependencies": {
"base-methods": "^0.2.10",
"get-value": "^1.2.1",

@@ -31,2 +30,8 @@ "lazy-cache": "^0.2.3",

"devDependencies": {
"base-methods": "^0.2.11",
"gulp": "^3.9.0",
"gulp-istanbul": "^0.10.1",
"gulp-jshint": "^1.11.2",
"gulp-mocha": "^2.1.3",
"jshint-stylish": "^2.0.1",
"mocha": "*"

@@ -33,0 +38,0 @@ },

@@ -1,2 +0,2 @@

# base-options [![NPM version](https://badge.fury.io/js/base-options.svg)](http://badge.fury.io/js/base-options)
# base-options [![NPM version](https://badge.fury.io/js/base-options.svg)](http://badge.fury.io/js/base-options) [![Build Status](https://travis-ci.org/jonschlinkert/base-options.svg)](https://travis-ci.org/jonschlinkert/base-options)

@@ -15,16 +15,11 @@ > Adds an `option` method to base-methods.

Use as a plugin with with your `base` application:
```js
var Base = require('base-methods');
var option = require('base-options');
var options = require('base-options');
// create your application and inherit `Base`
function App() {
Base.call(this);
}
Base.extend(App);
var app = new App();
var base = new Base();
base.use(options); // plugin
// add the `option` method to `App`
app.mixin('option', option);
// set/get options

@@ -68,2 +63,2 @@ app.option('foo', 'bar');

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 02, 2015._
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 06, 2015._
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