diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-10-24 17:27:36 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-10-24 17:27:36 -0400 |
| commit | 073b2af3e21edccb35dad6b5bfdda2772f164abf (patch) | |
| tree | 4621ce5a3a282b30b59d55cb770672a5b681aa24 /app/node_modules/okschema/index.js | |
| parent | bc38a56567c20f3205b89dae710d131655b0220d (diff) | |
fix issue with empty schemasv0.2.4
Diffstat (limited to 'app/node_modules/okschema/index.js')
| -rw-r--r-- | app/node_modules/okschema/index.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/node_modules/okschema/index.js b/app/node_modules/okschema/index.js index 0048fc5..39845ea 100644 --- a/app/node_modules/okschema/index.js +++ b/app/node_modules/okschema/index.js @@ -30,7 +30,8 @@ var types = { parent: {type: 'string'}, assertValid: function(spec, value) { value = value || ''; - if (spec.options.indexOf(value.trim()) === -1) { + if ( (spec.options.length && spec.options.indexOf(value.trim()) === -1) || + (! spec.options.length && Object.keys(spec.options).indexOf(value.trim()) === -1)) { throw [{ constraint: 'enum', actual: value, |
