@vee-validate/i18n
Advanced tools
Comparing version 4.12.3 to 4.12.4
/** | ||
* vee-validate v4.12.3 | ||
* vee-validate v4.12.4 | ||
* (c) 2023 Abdelrahman Awad | ||
@@ -34,3 +34,3 @@ * @license MIT | ||
Object.keys(source).forEach(key => { | ||
if (isPlainObject(source[key])) { | ||
if (isPlainObject(source[key]) && isPlainObject(target[key])) { | ||
if (!target[key]) { | ||
@@ -37,0 +37,0 @@ target[key] = {}; |
/** | ||
* vee-validate v4.12.3 | ||
* vee-validate v4.12.4 | ||
* (c) 2023 Abdelrahman Awad | ||
@@ -40,3 +40,3 @@ * @license MIT | ||
Object.keys(source).forEach(key => { | ||
if (isPlainObject(source[key])) { | ||
if (isPlainObject(source[key]) && isPlainObject(target[key])) { | ||
if (!target[key]) { | ||
@@ -43,0 +43,0 @@ target[key] = {}; |
/** | ||
* vee-validate v4.12.3 | ||
* vee-validate v4.12.4 | ||
* (c) 2023 Abdelrahman Awad | ||
* @license MIT | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VeeValidateI18n={})}(this,(function(e){"use strict";function t(e){return"function"==typeof e}function o(e){if(!function(e){return"object"==typeof e&&null!==e}(e)||"[object Object]"!==function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function n(e,t){return Object.keys(t).forEach((i=>{if(o(t[i]))return e[i]||(e[i]={}),void n(e[i],t[i]);e[i]=t[i]})),e}function i(e,t){return e.replace(/(\d:)?{([^}]+)}/g,(function(e,o,n){if(!o||!t.params)return n in t?t[n]:t.params&&n in t.params?t.params[n]:`{${n}}`;if(!Array.isArray(t.params))return n in t.params?t.params[n]:`{${n}}`;const i=Number(o.replace(":",""));return i in t.params?t.params[i]:`${o}{${n}}`}))}const l=new class{constructor(e,t){this.container={},this.locale=e,this.merge(t)}resolve(e){return this.format(this.locale,e)}getLocaleDefault(e,t){var o,n,i,l,r;return(null===(i=null===(n=null===(o=this.container[e])||void 0===o?void 0:o.fields)||void 0===n?void 0:n[t])||void 0===i?void 0:i._default)||(null===(r=null===(l=this.container[e])||void 0===l?void 0:l.messages)||void 0===r?void 0:r._default)}resolveLabel(e,t,o){var n,i,l,r;return o?(null===(i=null===(n=this.container[e])||void 0===n?void 0:n.names)||void 0===i?void 0:i[o])||o:(null===(r=null===(l=this.container[e])||void 0===l?void 0:l.names)||void 0===r?void 0:r[t])||t}format(e,o){var n,l,r,a,s;let c;const{rule:u,form:d,label:f,name:v}=o,p=this.resolveLabel(e,v,f);return u?(c=(null===(r=null===(l=null===(n=this.container[e])||void 0===n?void 0:n.fields)||void 0===l?void 0:l[v])||void 0===r?void 0:r[u.name])||(null===(s=null===(a=this.container[e])||void 0===a?void 0:a.messages)||void 0===s?void 0:s[u.name]),c||(c=this.getLocaleDefault(e,v)||`${p} is not valid`),t(c)?c(o):i(c,Object.assign(Object.assign({},d),{field:p,params:u.params}))):(c=this.getLocaleDefault(e,v)||`${p} is not valid`,t(c)?c(o):i(c,Object.assign(Object.assign({},d),{field:p})))}merge(e){n(this.container,e)}}("en",{});function r(e,t){const o=e=>l.resolve(e);return"string"==typeof e?(l.locale=e,t&&l.merge({[e]:t}),o):(l.merge(e),o)}e.loadLocaleFromURL=async function(e){try{const t=await fetch(e,{headers:{"content-type":"application/json"}}).then((e=>e.json()));if(!t.code)return void console.error("Could not identify locale, ensure the locale file contains `code` field");r({[t.code]:t})}catch(e){console.error("Failed to load locale ")}},e.localize=r,e.setLocale=function(e){l.locale=e}})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VeeValidateI18n={})}(this,(function(e){"use strict";function t(e){return"function"==typeof e}function o(e){if(!function(e){return"object"==typeof e&&null!==e}(e)||"[object Object]"!==function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function n(e,t){return Object.keys(t).forEach((i=>{if(o(t[i])&&o(e[i]))return e[i]||(e[i]={}),void n(e[i],t[i]);e[i]=t[i]})),e}function i(e,t){return e.replace(/(\d:)?{([^}]+)}/g,(function(e,o,n){if(!o||!t.params)return n in t?t[n]:t.params&&n in t.params?t.params[n]:`{${n}}`;if(!Array.isArray(t.params))return n in t.params?t.params[n]:`{${n}}`;const i=Number(o.replace(":",""));return i in t.params?t.params[i]:`${o}{${n}}`}))}const l=new class{constructor(e,t){this.container={},this.locale=e,this.merge(t)}resolve(e){return this.format(this.locale,e)}getLocaleDefault(e,t){var o,n,i,l,r;return(null===(i=null===(n=null===(o=this.container[e])||void 0===o?void 0:o.fields)||void 0===n?void 0:n[t])||void 0===i?void 0:i._default)||(null===(r=null===(l=this.container[e])||void 0===l?void 0:l.messages)||void 0===r?void 0:r._default)}resolveLabel(e,t,o){var n,i,l,r;return o?(null===(i=null===(n=this.container[e])||void 0===n?void 0:n.names)||void 0===i?void 0:i[o])||o:(null===(r=null===(l=this.container[e])||void 0===l?void 0:l.names)||void 0===r?void 0:r[t])||t}format(e,o){var n,l,r,a,s;let c;const{rule:u,form:d,label:f,name:v}=o,p=this.resolveLabel(e,v,f);return u?(c=(null===(r=null===(l=null===(n=this.container[e])||void 0===n?void 0:n.fields)||void 0===l?void 0:l[v])||void 0===r?void 0:r[u.name])||(null===(s=null===(a=this.container[e])||void 0===a?void 0:a.messages)||void 0===s?void 0:s[u.name]),c||(c=this.getLocaleDefault(e,v)||`${p} is not valid`),t(c)?c(o):i(c,Object.assign(Object.assign({},d),{field:p,params:u.params}))):(c=this.getLocaleDefault(e,v)||`${p} is not valid`,t(c)?c(o):i(c,Object.assign(Object.assign({},d),{field:p})))}merge(e){n(this.container,e)}}("en",{});function r(e,t){const o=e=>l.resolve(e);return"string"==typeof e?(l.locale=e,t&&l.merge({[e]:t}),o):(l.merge(e),o)}e.loadLocaleFromURL=async function(e){try{const t=await fetch(e,{headers:{"content-type":"application/json"}}).then((e=>e.json()));if(!t.code)return void console.error("Could not identify locale, ensure the locale file contains `code` field");r({[t.code]:t})}catch(e){console.error("Failed to load locale ")}},e.localize=r,e.setLocale=function(e){l.locale=e}})); |
{ | ||
"name": "@vee-validate/i18n", | ||
"version": "4.12.3", | ||
"version": "4.12.4", | ||
"description": "Localization module for VeeValidate", | ||
@@ -5,0 +5,0 @@ "author": "Abdelrahman Awad <logaretm1@gmail.com>", |
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
128592