Skip to content

Commit

Permalink
Trim lodash down to just the two functions used.
Browse files Browse the repository at this point in the history
Update deps.
  • Loading branch information
ceejbot committed Jul 21, 2016
1 parent 2f4a668 commit ea7f477
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A pure JavaScript node client for [Hashicorp's Vault](https://hashicorp.com/blog

[![on npm](http://img.shields.io/npm/v/emancipation-grill.svg?style=flat)](https://www.npmjs.org/package/emancipation-grill) [![Tests](http://img.shields.io/travis/ceejbot/emancipation-grill.svg?style=flat)](http://travis-ci.org/ceejbot/emancipation-grill) [![Coverage](http://img.shields.io/coveralls/ceejbot/emancipation-grill.svg?style=flat)](https://coveralls.io/r/ceejbot/emancipation-grill) [![Dependencies](http://img.shields.io/david/ceejbot/emancipation-grill.svg?style=flat)](https://david-dm.org/ceejbot/emancipation-grill)

Tested against vault 0.5.2. Uses ES6 template strings, so it requires node 4 or newer.
Tested against vault 0.6.0. Uses ES6 template strings, so it requires node 4 or newer.

## Usage

Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var
_ = require('lodash'),
assert = require('assert'),
foreach = require('lodash.foreach'),
P = require('bluebird'),
Request = require('request'),
Secret = require('./lib/secret'),
Expand All @@ -22,13 +22,13 @@ var Grill = module.exports = function Grill(opts)

var self = this;

_.each(endpoints, function(v, k)
foreach(endpoints, function(v, k)
{
var func = self.makeCommand(k, v);
self[k] = P.promisify(func).bind(self);
});

_.each(Grill.functions, function(k)
foreach(Grill.functions, function(k)
{
self[k] = P.promisify(self['_' + k]).bind(self);
});
Expand Down
4 changes: 2 additions & 2 deletions lib/secret.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var
_ = require('lodash')
assign = require('lodash.assign')
;

var Secret = module.exports = function Secret(data)
{
_.assign(this, data);
assign(this, data);
};

Secret.prototype.lease_id = null;
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
},
"dependencies": {
"bluebird": "~3.4.1",
"lodash": "~4.11.0",
"lodash.assign": "~4.0.9",
"lodash.foreach": "~4.3.0",
"request": "~2.73.0",
"tough-cookie": "~2.2.1"
},
"devDependencies": {
"coveralls": "2.*",
"eslint": "~3.1.1",
"mocha": "2.*",
"must": "~0.13.1",
"mocha": "~2.5.3",
"must": "~0.13.2",
"node-env-file": "~0.1.8",
"nyc": "7.0.0"
},
Expand Down
7 changes: 3 additions & 4 deletions test/04-endpoints.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*global describe:true, it:true, before:true, after:true */

var
_ = require('lodash'),
demand = require('must'),
foreach = require('lodash.foreach'),
Endpoints = require('../lib/endpoints')
;

Expand All @@ -18,7 +18,7 @@ describe('endpoints', function()

it('each entry has an arity and a path', function()
{
_.each(Endpoints, function(v, k)
foreach(Endpoints, function(v, k)
{
var method = Endpoints[k];
method.must.have.property('arity');
Expand All @@ -30,10 +30,9 @@ describe('endpoints', function()

it('the path function returns a string', function()
{
_.each(Endpoints, function(method, k)
foreach(Endpoints, function(method, k)
{
method.path('foo').must.be.a.string();
});

});
});

0 comments on commit ea7f477

Please sign in to comment.