1 line
663 B
JSON
1 line
663 B
JSON
{"ast":null,"code":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = validate;\nexports.validateField = validateField;\n\nvar _definitions = require(\"../definitions\");\n\nfunction validate(node, key, val) {\n if (!node) return;\n var fields = _definitions.NODE_FIELDS[node.type];\n if (!fields) return;\n var field = fields[key];\n validateField(node, key, val, field);\n}\n\nfunction validateField(node, key, val, field) {\n if (!field || !field.validate) return;\n if (field.optional && val == null) return;\n field.validate(node, key, val);\n}","map":null,"metadata":{},"sourceType":"script"} |