Permalink
Browse files

Fix validation parameter error

  • Loading branch information...
1 parent dd474a1 commit 8ccac84de8feadb3a364cd066d8d1be0acd8d3ab @fhellwig committed Sep 26, 2012
Showing with 3 additions and 5 deletions.
  1. +2 −0 README.md
  2. +1 −2 pkgconfig.js
  3. +0 −3 test.js
View
@@ -49,6 +49,8 @@ var config = pkgconfig();
This reads the `config.json` configuration file and validates it against the `schema.json` schema file.
+Returns a configuration object. Throws an exception if there is an error reading the schema or configuration file or if the configuration data does not validate against the schema.
+
### Defaults
Be default, pkgconfig looks for the following schema and a configuration files:
View
@@ -115,8 +115,7 @@ function pkgconfig(options) {
options.config = readFile(pkginfo.resolve(options.config));
}
jsvutil.check(options.schema);
- jsvutil.validate(options.schema, options.config);
- return config;
+ return jsvutil.validate(options.config, options.schema);
}
module.exports = pkgconfig;
View
@@ -1,3 +0,0 @@
-var pkgconfig = require('./pkgconfig');
-
-var config = pkgconfig({schema: 'config/schema.js'});

0 comments on commit 8ccac84

Please sign in to comment.