3
0
Fork 0
mirror of https://gitea.com/actions/setup-python.git synced 2024-11-26 20:19:35 +01:00
setup-python/node_modules/ajv/lib/dotjs/comment.js

15 lines
573 B
JavaScript
Raw Normal View History

2019-06-27 03:12:00 +02:00
'use strict';
module.exports = function generate_comment(it, $keyword, $ruleType) {
var out = ' ';
var $schema = it.schema[$keyword];
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $comment = it.util.toQuotedString($schema);
if (it.opts.$comment === true) {
out += ' console.log(' + ($comment) + ');';
} else if (typeof it.opts.$comment == 'function') {
out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);';
}
return out;
}