UNPKG

557 BJavaScriptView Raw
1/*!
2 * Copyright (c) 2012-2018 Digital Bazaar, Inc. All rights reserved.
3 */
4const bedrock = require('bedrock');
5
6const schema = {
7 title: 'Comment',
8 description: 'A short comment.',
9 type: 'string',
10 minLength: 1,
11 maxLength: 5000,
12 errors: {
13 invalid: 'The comment contains invalid characters or is more than ' +
14 '5000 characters in length.',
15 missing: 'Please enter a comment.'
16 }
17};
18
19module.exports = function(extend) {
20 if(extend) {
21 return bedrock.util.extend(true, bedrock.util.clone(schema), extend);
22 }
23 return schema;
24};