Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/ajv/lib/dotjs/comment.js
1126 views
1
'use strict';
2
module.exports = function generate_comment(it, $keyword, $ruleType) {
3
var out = ' ';
4
var $schema = it.schema[$keyword];
5
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
6
var $breakOnError = !it.opts.allErrors;
7
var $comment = it.util.toQuotedString($schema);
8
if (it.opts.$comment === true) {
9
out += ' console.log(' + ($comment) + ');';
10
} else if (typeof it.opts.$comment == 'function') {
11
out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);';
12
}
13
return out;
14
}
15
16