Skip to content

Commit

Permalink
Remove lodash dep and update package
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Sliwinski committed Mar 5, 2014
1 parent 8a7ea12 commit 0bc46d2
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 22 deletions.
17 changes: 17 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"bitwise": true,
"devel": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"maxdepth": 2,
"maxparams": 2,
"newcap": true,
"noarg": true,
"node": true,
"proto": true,
"quotmark": "single",
"undef": true,
"unused": true,
"maxlen": 80
}
21 changes: 18 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,27 @@
/**
* Dependencies
*/
var _ = require('lodash'),
JSV = require('JSV').JSV;
var JSV = require('JSV').JSV;

var dict = require('./dict.json'),
env = JSV.createEnvironment();

/**
* Naive (shallow) object extension.
*
* @param {object} Object to be extended
* @param {object} Extension "source"
*
* @return {object}
*/
function extend (destination, source) {
for (var property in source) {
destination[property] = source[property];
}

return destination;
}

/**
* Build error response.
*
Expand Down Expand Up @@ -44,7 +59,7 @@ module.exports = function (opts, callback) {
// Parse options
var json = (typeof opts.input === 'undefined') ? null : opts.input;
var schema = (typeof opts.schema === 'undefined') ? null : opts.schema;
var dictionary = _.extend(dict, opts.dict);
var dictionary = extend(dict, opts.dict);

// Validate (JSV)
var report = env.validate(json, schema);
Expand Down
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Andrew Sliwinski <andrewsliwinski@acm.org> (http://andrewsliwinski.com)",
"name": "vouch",
"description": "JSON schema validation ... for humans.",
"version": "0.1.0",
"version": "0.2.0",
"homepage": "https://github.com/thisandagain/vouch",
"repository": {
"type": "git",
Expand All @@ -13,16 +13,14 @@
"test": "make test"
},
"dependencies": {
"JSV": "~4.0.2",
"lodash": "~1.2.1"
"JSV": "~4.0.2"
},
"devDependencies": {
"codebux": "~0.1.2",
"jshint-tap-simple": "~1.0.2",
"hint-hint": "~0.4.0",
"tap": "~0.3.1"
},
"optionalDependencies": {},
"engines": {
"node": ">=0.6"
"node": ">=0.8"
}
}
}
11 changes: 0 additions & 11 deletions test/governance/debt.js

This file was deleted.

3 changes: 2 additions & 1 deletion test/governance/lint.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
require('jshint-tap-simple').run(__dirname + '/../../lib/*.js');
var config = require('fs').readFileSync(__dirname + '/../../.jshintrc');
require('hint-hint')(__dirname + '/../../lib/index.js', JSON.parse(config.toString()));

0 comments on commit 0bc46d2

Please sign in to comment.