summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Fridman <fridman@mail.sfsu.edu>2015-04-06 14:28:55 -0400
committerSean Fridman <fridman@mail.sfsu.edu>2015-04-06 15:27:53 -0400
commit907bd49fde01758e1e9669c4bfa8176773d9be30 (patch)
tree16394d85b577e4507bec744722fd6ef7b83e58f4
parentf651f596ccdac372714caef7d6a26d0d14f5306c (diff)
Properly convert to mschema before validating
-rw-r--r--app/node_modules/okschema/index.js10
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;