diff options
Diffstat (limited to 'app/node_modules/okresource/index.js')
| -rw-r--r-- | app/node_modules/okresource/index.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/node_modules/okresource/index.js b/app/node_modules/okresource/index.js index 9f0c9d4..055a24a 100644 --- a/app/node_modules/okresource/index.js +++ b/app/node_modules/okresource/index.js @@ -17,7 +17,11 @@ function OKResource(options) { throw new Error('No DB provided to OKResource'); var type = options.type; this._db = options.db; - this._schema = options.schema; + // Define properties which are part of the API + Object.defineProperty(this, 'schema', { + value: schema, + writable: false + }); Object.defineProperty(this, 'type', { value: type, writable: false @@ -28,7 +32,7 @@ function OKResource(options) { * Throws an error if data does not conform to schema */ OKResource.prototype.assertValid = function(data) { - this._schema.assertValid(data); + this.schema.assertValid(data); }; OKResource.prototype.all = function() { |
