Skip to content
Browse files

Remove lodash dep and update package

  • Loading branch information...
1 parent 8a7ea12 commit 0bc46d255cdc049e8f3dc759f42e402aebbaf8de Andrew Sliwinski committed Mar 4, 2014
Showing with 42 additions and 22 deletions.
  1. +17 −0 .jshintrc
  2. +18 −3 lib/index.js
  3. +5 −7 package.json
  4. +0 −11 test/governance/debt.js
  5. +2 −1 test/governance/lint.js
View
17 .jshintrc
@@ -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
+}
View
21 lib/index.js
@@ -8,13 +8,28 @@
/**
* 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.
*
* @param {Object} JSV error
@@ -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);
View
12 package.json
@@ -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",
@@ -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"
}
-}
+}
View
11 test/governance/debt.js
@@ -1,11 +0,0 @@
-var bux = require('codebux'),
- test = require('tap').test;
-
-bux(__dirname + '/../../lib/index.js', function (err, debt) {
- console.log('Codebux: %s', debt);
- test('governance', function (t) {
- t.equal(err, null, 'error object is null');
- t.ok(debt > 50, 'debt within threshold');
- t.end();
- });
-});
View
3 test/governance/lint.js
@@ -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.
Something went wrong with that request. Please try again.