summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSean Fridman <fridman@mail.sfsu.edu>2015-04-06 14:27:20 -0400
committerSean Fridman <fridman@mail.sfsu.edu>2015-04-06 15:27:53 -0400
commitf651f596ccdac372714caef7d6a26d0d14f5306c (patch)
treecb2a3bd08306303b43f706b22a4ed01d70e0c621 /app
parentf7bb4fc5ad662d9becd60c11f48998dba9339433 (diff)
Expose resource raw schema
Diffstat (limited to 'app')
-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) {