diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/node_modules/okschema/index.js | 27 | ||||
| -rw-r--r-- | app/node_modules/oktemplate/index.js | 2 |
2 files changed, 28 insertions, 1 deletions
diff --git a/app/node_modules/okschema/index.js b/app/node_modules/okschema/index.js index 6c7cf96..355a2ee 100644 --- a/app/node_modules/okschema/index.js +++ b/app/node_modules/okschema/index.js @@ -39,6 +39,33 @@ var types = { }]; } } + }, + 'captioned-image-list': { + parent: [{ + uri: { type: 'string' }, // TODO Implement URI type + caption: { type: 'string' } + }], + assertValid: function(spec, value) { + var message; + var actual; + if (!value || !value.length) { + throw [{ + message: 'Not an array', + expected: JSON.stringify(this.parent), + actual: value + }]; + } else { + value.forEach(function(obj) { + if (!(obj.uri && obj.caption)) { + throw [{ + message: 'Array contains invalid object', + expected: JSON.stringify(this.parent), + actual: obj + }]; + } + }); + } + } } } diff --git a/app/node_modules/oktemplate/index.js b/app/node_modules/oktemplate/index.js index dafe5e6..a37f78e 100644 --- a/app/node_modules/oktemplate/index.js +++ b/app/node_modules/oktemplate/index.js @@ -18,7 +18,7 @@ var filters = { try { return '<pre>' + stringify(obj) + '</pre>'; } catch (e) { - return ''; + return 'Error stringifying'; } } |
