@vee-validate/i18n
Advanced tools
Comparing version 4.0.2 to 4.0.3
@@ -6,2 +6,10 @@ # Change Log | ||
## [4.0.3](https://github.com/logaretm/vee-validate/compare/@vee-validate/i18n@4.0.2...@vee-validate/i18n@4.0.3) (2021-02-06) | ||
**Note:** Version bump only for package @vee-validate/i18n | ||
## [4.0.2](https://github.com/logaretm/vee-validate/compare/@vee-validate/i18n@4.0.1...@vee-validate/i18n@4.0.2) (2020-12-20) | ||
@@ -8,0 +16,0 @@ |
/** | ||
* vee-validate v4.0.2 | ||
* (c) 2020 Abdelrahman Awad | ||
* vee-validate v4.0.3 | ||
* (c) 2021 Abdelrahman Awad | ||
* @license MIT | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* vee-validate v4.0.2 | ||
* (c) 2020 Abdelrahman Awad | ||
* vee-validate v4.0.3 | ||
* (c) 2021 Abdelrahman Awad | ||
* @license MIT | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* vee-validate v4.0.2 | ||
* (c) 2020 Abdelrahman Awad | ||
* vee-validate v4.0.3 | ||
* (c) 2021 Abdelrahman Awad | ||
* @license MIT | ||
*/ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).VeeValidateI18n={})}(this,(function(e){"use strict";function n(e,i){return Object.keys(i).forEach((r=>{if(null!==(o=i[r])&&o&&"object"==typeof o&&!Array.isArray(o))return e[r]||(e[r]={}),void n(e[r],i[r]);var o;e[r]=i[r]})),e}class i{constructor(e,n){this.container={},this.locale=e,this.merge(n)}resolve(e){return this.format(this.locale,e)}format(e,n){var i,r,o,t,a,s,l,c;let u;const{field:d,rule:f,form:m}=n;if(!f)return`${d} is not valid`;u=(null===(o=null===(r=null===(i=this.container[e])||void 0===i?void 0:i.fields)||void 0===r?void 0:r[d])||void 0===o?void 0:o[f.name])||(null===(a=null===(t=this.container[e])||void 0===t?void 0:t.messages)||void 0===a?void 0:a[f.name]),u||(u=`${d} is not valid`);const p=null!==(c=null===(l=null===(s=this.container[e])||void 0===s?void 0:s.names)||void 0===l?void 0:l[d])&&void 0!==c?c:d;return"function"==typeof u?u(n):(v=u,h=Object.assign(Object.assign({},m),{field:p,params:f.params}),v.replace(/(\d:)?{([^}]+)}/g,(function(e,n,i){if(!n||!h.params)return i in h?h[i]:h.params&&i in h.params?h.params[i]:`{${i}}`;if(!Array.isArray(h.params))return i in h.params?h.params[i]:`{${i}}`;const r=Number(n.replace(":",""));return r in h.params?h.params[r]:`${n}{${i}}`})));var v,h}merge(e){n(this.container,e)}}let r;e.localize=function(e,n){r||(r=new i("en",{}));const o=e=>r.resolve(e);return"string"==typeof e?(r.locale=e,n&&r.merge({[e]:n}),o):(r.merge(e),o)},e.setLocale=function(e){r.locale=e},Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "@vee-validate/i18n", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "Localization module for VeeValidate", | ||
@@ -28,3 +28,3 @@ "author": "Abdelrahman Awad <logaretm1@gmail.com>", | ||
}, | ||
"gitHead": "817f8308931c5ae790d4989677b236b40d16b62b" | ||
"gitHead": "4d4dcd2bffddc00e0dc81cf0ede3cb5e41589a3b" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108707
57
1655