1
0
mirror of https://github.com/actions/setup-node synced 2025-05-03 21:53:53 +00:00
setup-node/node_modules/ajv/lib/dotjs/comment.js
eric sciple e7ed525da5 .
2020-01-24 16:30:50 -05:00

15 lines
573 B
JavaScript

'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;
}