qauMaWeb/node_modules/.cache/babel-loader/fd275b1c297b760e34d12bbb1d2...

1 line
2.3 KiB
JSON

{"ast":null,"code":"import * as util from '../util';\n/**\n * Rule for validating required fields.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param source The source object being validated.\n * @param errors An array of errors that this rule may add\n * validation errors to.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\n\nfunction required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || util.isEmptyValue(value, type || rule.type))) {\n errors.push(util.format(options.messages.required, rule.fullField));\n }\n}\n\nexport default required;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/async-validator/es/rule/required.js"],"names":["util","required","rule","value","source","errors","options","type","hasOwnProperty","field","isEmptyValue","push","format","messages","fullField"],"mappings":"AAAA,OAAO,KAAKA,IAAZ,MAAsB,SAAtB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,QAAT,CAAkBC,IAAlB,EAAwBC,KAAxB,EAA+BC,MAA/B,EAAuCC,MAAvC,EAA+CC,OAA/C,EAAwDC,IAAxD,EAA8D;AAC5D,MAAIL,IAAI,CAACD,QAAL,KAAkB,CAACG,MAAM,CAACI,cAAP,CAAsBN,IAAI,CAACO,KAA3B,CAAD,IAAsCT,IAAI,CAACU,YAAL,CAAkBP,KAAlB,EAAyBI,IAAI,IAAIL,IAAI,CAACK,IAAtC,CAAxD,CAAJ,EAA0G;AACxGF,IAAAA,MAAM,CAACM,IAAP,CAAYX,IAAI,CAACY,MAAL,CAAYN,OAAO,CAACO,QAAR,CAAiBZ,QAA7B,EAAuCC,IAAI,CAACY,SAA5C,CAAZ;AACD;AACF;;AAED,eAAeb,QAAf","sourcesContent":["import * as util from '../util';\n\n/**\n * Rule for validating required fields.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param source The source object being validated.\n * @param errors An array of errors that this rule may add\n * validation errors to.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || util.isEmptyValue(value, type || rule.type))) {\n errors.push(util.format(options.messages.required, rule.fullField));\n }\n}\n\nexport default required;"]},"metadata":{},"sourceType":"module"}