summaryrefslogtreecommitdiff
path: root/app/node_modules
diff options
context:
space:
mode:
Diffstat (limited to 'app/node_modules')
-rw-r--r--app/node_modules/okresource/index.js5
-rw-r--r--app/node_modules/okschema/index.js5
2 files changed, 9 insertions, 1 deletions
diff --git a/app/node_modules/okresource/index.js b/app/node_modules/okresource/index.js
index 055a24a..2eba03a 100644
--- a/app/node_modules/okresource/index.js
+++ b/app/node_modules/okresource/index.js
@@ -15,6 +15,7 @@ function OKResource(options) {
throw new Error('No schema provided to OKResource');
if (!options.db)
throw new Error('No DB provided to OKResource');
+ var schema = options.schema;
var type = options.type;
this._db = options.db;
// Define properties which are part of the API
@@ -22,6 +23,10 @@ function OKResource(options) {
value: schema,
writable: false
});
+ Object.defineProperty(this, 'spec', {
+ value: schema.spec,
+ writable: false
+ });
Object.defineProperty(this, 'type', {
value: type,
writable: false
diff --git a/app/node_modules/okschema/index.js b/app/node_modules/okschema/index.js
index c601a07..1ffe2d6 100644
--- a/app/node_modules/okschema/index.js
+++ b/app/node_modules/okschema/index.js
@@ -9,7 +9,10 @@ function OKSchema(spec) {
if (!(this instanceof OKSchema)) return new OKSchema(spec);
if (!spec)
throw new Error('No spec provided to OKSchema');
- this._spec = spec;
+ Object.defineProperty(this, 'spec', {
+ value: spec,
+ writable: false
+ });
}
OKSchema.prototype.assertValid = function(data) {