PromoCursed/node_modules/.cache/babel-loader/ec22f787f3d5d3f000e19d86c68330efa200615903c502ef50a13db2872348f4.json

1 line
3.1 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import rules from \"../rule\";\nimport { isEmptyValue } from \"../util\";\nvar string = function string(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options, 'string');\n if (!isEmptyValue(value, 'string')) {\n rules.type(rule, value, source, errors, options);\n rules.range(rule, value, source, errors, options);\n rules.pattern(rule, value, source, errors, options);\n if (rule.whitespace === true) {\n rules.whitespace(rule, value, source, errors, options);\n }\n }\n }\n callback(errors);\n};\nexport default string;","map":{"version":3,"names":["rules","isEmptyValue","string","rule","value","callback","source","options","errors","validate","required","hasOwnProperty","field","type","range","pattern","whitespace"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/@rc-component/async-validator/es/validator/string.js"],"sourcesContent":["import rules from \"../rule\";\nimport { isEmptyValue } from \"../util\";\nvar string = function string(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options, 'string');\n if (!isEmptyValue(value, 'string')) {\n rules.type(rule, value, source, errors, options);\n rules.range(rule, value, source, errors, options);\n rules.pattern(rule, value, source, errors, options);\n if (rule.whitespace === true) {\n rules.whitespace(rule, value, source, errors, options);\n }\n }\n }\n callback(errors);\n};\nexport default string;"],"mappings":"AAAA,OAAOA,KAAK,MAAM,SAAS;AAC3B,SAASC,YAAY,QAAQ,SAAS;AACtC,IAAIC,MAAM,GAAG,SAASA,MAAMA,CAACC,IAAI,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,OAAO,EAAE;EACnE,IAAIC,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