mirror of
https://github.com/cachix/install-nix-action.git
synced 2024-11-22 16:40:51 +00:00
14 lines
573 B
JavaScript
14 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;
|
|
}
|