.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / ajv-keywords / keywords / switch.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/ajv-keywords/keywords/switch.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/ajv-keywords/keywords/switch.js
new file mode 100644 (file)
index 0000000..5b0f3f8
--- /dev/null
@@ -0,0 +1,38 @@
+'use strict';
+
+var util = require('./_util');
+
+module.exports = function defFunc(ajv) {
+  if (ajv.RULES.keywords.switch && ajv.RULES.keywords.if) return;
+
+  var metaSchemaRef = util.metaSchemaRef(ajv);
+
+  defFunc.definition = {
+    inline: require('./dotjs/switch'),
+    statements: true,
+    errors: 'full',
+    metaSchema: {
+      type: 'array',
+      items: {
+        required: [ 'then' ],
+        properties: {
+          'if': metaSchemaRef,
+          'then': {
+            anyOf: [
+              { type: 'boolean' },
+              metaSchemaRef
+            ]
+          },
+          'continue': { type: 'boolean' }
+        },
+        additionalProperties: false,
+        dependencies: {
+          'continue': [ 'if' ]
+        }
+      }
+    }
+  };
+
+  ajv.addKeyword('switch', defFunc.definition);
+  return ajv;
+};