diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-04-09 02:03:06 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-04-09 02:03:06 -0400 |
| commit | 62fc7c328c78f5aff5a4f7ec95a5631c7d4e204b (patch) | |
| tree | 4af548951cacacb8852850ea74bf7a82b523016b /app | |
| parent | 6d075a940b30c186e8b668316c5f51fbcb47e78e (diff) | |
| parent | c5e38d7f48e2b5d6ce5ea70f7337f983e55969d6 (diff) | |
mergez
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'; } } |
