Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/ajv/lib/dotjs/comment.js')
-rw-r--r--node_modules/ajv/lib/dotjs/comment.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/node_modules/ajv/lib/dotjs/comment.js b/node_modules/ajv/lib/dotjs/comment.js
new file mode 100644
index 000000000..dd66bb8f0
--- /dev/null
+++ b/node_modules/ajv/lib/dotjs/comment.js
@@ -0,0 +1,14 @@
+'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;
+}