From 907bd49fde01758e1e9669c4bfa8176773d9be30 Mon Sep 17 00:00:00 2001 From: Sean Fridman Date: Mon, 6 Apr 2015 14:28:55 -0400 Subject: Properly convert to mschema before validating --- app/node_modules/okschema/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'app/node_modules/okschema/index.js') 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; -- cgit v1.2.3-70-g09d2