You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8 lines
19 KiB
8 lines
19 KiB
1 year ago
|
/**
|
||
|
* Minified by jsDelivr using Terser v5.15.1.
|
||
|
* Original file: /npm/async-validator@4.2.5/dist-web/index.js
|
||
|
*
|
||
|
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||
|
*/
|
||
|
function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},_extends.apply(this,arguments)}function _inheritsLoose(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,_setPrototypeOf(e,r)}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _setPrototypeOf(e,r){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},_setPrototypeOf(e,r)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _construct(e,r,t){return _construct=_isNativeReflectConstruct()?Reflect.construct.bind():function(e,r,t){var n=[null];n.push.apply(n,r);var i=new(Function.bind.apply(e,n));return t&&_setPrototypeOf(i,t.prototype),i},_construct.apply(null,arguments)}function _isNativeFunction(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _wrapNativeSuper(e){var r="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function(e){if(null===e||!_isNativeFunction(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(t,e)},_wrapNativeSuper(e)}var formatRegExp=/%[sdj%]/g,warning=function(){};function convertFieldsError(e){if(!e||!e.length)return null;var r={};return e.forEach((function(e){var t=e.field;r[t]=r[t]||[],r[t].push(e)})),r}function format(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];var i=0,a=t.length;if("function"==typeof e)return e.apply(null,t);if("string"==typeof e){var s=e.replace(formatRegExp,(function(e){if("%%"===e)return"%";if(i>=a)return e;switch(e){case"%s":return String(t[i++]);case"%d":return Number(t[i++]);case"%j":try{return JSON.stringify(t[i++])}catch(e){return"[Circular]"}break;default:return e}}));return s}return e}function isNativeStringType(e){return"string"===e||"url"===e||"hex"===e||"email"===e||"date"===e||"pattern"===e}function isEmptyValue(e,r){return null==e||(!("array"!==r||!Array.isArray(e)||e.length)||!(!isNativeStringType(r)||"string"!=typeof e||e))}function asyncParallelArray(e,r,t){var n=[],i=0,a=e.length;function s(e){n.push.apply(n,e||[]),++i===a&&t(n)}e.forEach((function(e){r(e,s)}))}function asyncSerialArray(e,r,t){var n=0,i=e.length;!function a(s){if(s&&s.length)t(s);else{var u=n;n+=1,u<i?r(e[u],a):t([])}}([])}function flattenObjArr(e){var r=[];return Object.keys(e).forEach((function(t){r.push.apply(r,e[t]||[])})),r}"undefined"!=typeof process&&process.env&&"production"!==process.env.NODE_ENV&&"undefined"!=typeof window&&"undefined"!=typeof document&&(warning=function(e,r){"undefined"!=typeof console&&console.warn&&"undefined"==typeof ASYNC_VALIDATOR_NO_WARNING&&r.every((function(e){return"string"==typeof e}))&&console.warn(e,r)});var AsyncValidationError=function(e){function r(r,t){var n;return(n=e.call(this,"Async Validation Error")||this).errors=r,n.fields=t,n}return _inheritsLoose(r,e),r}(_wrapNativeSuper(Error));function asyncMap(e,r,t,n,i){if(r.first){var a=new Promise((function(r,a){asyncSerialArray(flattenObjArr(e),t,(function(e){return n(e),e.length?a(new AsyncValidationError(e,convertFieldsError(e))):r(i)}))}));return a.catch((function(e){return e})),a}var s=!0===r.firstFields?Object.keys(e):r.firstFields||[],u=Object.keys(e),o=u.length,l=0,f=[],c=new Promise((function(r,a){var c=function(e){if(f.push.apply(f,e),++l===o)return
|
||
|
//# sourceMappingURL=/sm/4d97c19f4a796ce296fb107c6b9389931dd66007986ab3e22a5049350df1fe21.map
|