1 |
|
2 |
|
3 |
|
4 | const bedrock = require('bedrock');
|
5 |
|
6 | const schema = {
|
7 | title: 'Title',
|
8 | description: 'A descriptive title.',
|
9 | type: 'string',
|
10 | pattern: '^[-a-zA-Z0-9~`!@#$%^&*\\(\\)\\[\\]{}<>_=+\\\\|:;\'"\\.,/? ]*$',
|
11 | minLength: 1,
|
12 | maxLength: 200,
|
13 | errors: {
|
14 | invalid: 'The title contains invalid characters or is not between ' +
|
15 | '1 and 200 characters in length.',
|
16 | missing: 'Please enter a title.'
|
17 | }
|
18 | };
|
19 |
|
20 | module.exports = function(extend) {
|
21 | if(extend) {
|
22 | return bedrock.util.extend(true, bedrock.util.clone(schema), extend);
|
23 | }
|
24 | return schema;
|
25 | };
|