diff options
| author | Sean Fridman <fridman@mail.sfsu.edu> | 2015-04-06 14:28:55 -0400 |
|---|---|---|
| committer | Sean Fridman <fridman@mail.sfsu.edu> | 2015-04-06 15:27:53 -0400 |
| commit | 907bd49fde01758e1e9669c4bfa8176773d9be30 (patch) | |
| tree | 16394d85b577e4507bec744722fd6ef7b83e58f4 /app/node_modules/okschema/index.js | |
| parent | f651f596ccdac372714caef7d6a26d0d14f5306c (diff) | |
Properly convert to mschema before validating
Diffstat (limited to 'app/node_modules/okschema/index.js')
| -rw-r--r-- | app/node_modules/okschema/index.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/node_modules/okschema/index.js b/app/node_modules/okschema/index.js index 1ffe2d6..d63f5db 100644 --- a/app/node_modules/okschema/index.js +++ b/app/node_modules/okschema/index.js @@ -16,13 +16,17 @@ function OKSchema(spec) { } OKSchema.prototype.assertValid = function(data) { - var result = mschema.validate(data, this._spec); + var result = mschema.validate(data, this.toMschema()); if (!result.valid) throw result.errors; }; -OKSchema.prototype.getMschema = function() { - return this._spec; +/** + * Return schema as an mschema object. + * Currently no difference between the two. + */ +OKSchema.prototype.toMschema = function() { + return this.spec; }; module.exports = OKSchema; |
