summaryrefslogtreecommitdiff
path: root/app/node_modules/okschema/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/node_modules/okschema/index.js')
-rw-r--r--app/node_modules/okschema/index.js3
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,