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

billy

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

billy - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

4

HISTORY.md
# Change History
## 1.2.0 (2014-05-27)
* Added default implicit sets when getting a config key.
## 1.1.0 (2014-05-20)

@@ -4,0 +8,0 @@

10

lib/ConfigStore.js

@@ -21,10 +21,15 @@ module.exports = ConfigStore;

/**
* Get a value from the store.
* @param {string} key
* @param {any} defaultValue Will write this value to the store if there is
* none already there.
* @return {any}
*/
ConfigStore.prototype.get = function(key)
ConfigStore.prototype.get = function(key, defaultValue)
{
var _ref = this._resolve(key);
if (_ref.root === undefined)
if (_ref.root === undefined && defaultValue === undefined)
return undefined;
else if (defaultValue !== undefined)
_ref.root[_ref.key] = defaultValue;
return _ref.root[_ref.key];

@@ -34,2 +39,3 @@ };

/**
* Set a value in the store.
* @param {string} key

@@ -36,0 +42,0 @@ * @param {any} value

{
"name": "billy",
"version": "1.1.0",
"version": "1.2.0",
"description": "A minimal application harness that stays out of your way and out of your code.",

@@ -5,0 +5,0 @@ "author": {

@@ -47,1 +47,8 @@ var test = require('tape');

});
test('default values', function(t) {
t.plan(2);
var config = new ConfigStore().getStore();
t.strictEqual(config('a.b.c', 1), 1, 'implicit set and return');
t.strictEqual(config('a.b.c'), 1, 'actually set');
});
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