diff --git a/dist/cjs/frenchkiss.js b/dist/cjs/frenchkiss.js index 5a94776..7620c56 100644 --- a/dist/cjs/frenchkiss.js +++ b/dist/cjs/frenchkiss.js @@ -1,6 +1,6 @@ /** - * @license frenchkiss 0.0.10 + * @license frenchkiss 0.1.0 * Copyright (c) 2018-2019 Koala Interactive, Inc. * License: MIT */ -"use strict";var n=/^\s*\w+\s*$/,t=/^\s*(\w+)\s*,\s*(select|plural)\s*,/i,r=JSON.stringify,e=function(n){return'(p["'+n+'"]||(p["'+n+'"]=="0"?0:"'+n+'" in p?"":v("'+n+'",k,l)))'};function u(n){for(var t={},u=function n(t,u){var i=[];var o=t.length;for(var f=0;f'(p["'+t+'"]||(p["'+t+'"]=="0"?0:"'+t+'" in p?"":v("'+t+'",k,l)))';function l(t){const e={},l=function t(e,l){const o=[];const r=e.length;for(let c=0;ct,h=()=>"";const g=(t,e)=>c[e]&&c[e][t]||i[e]&&"string"==typeof i[e][t]&&(c[e][t]=l(i[e][t])),b=(t,e,n)=>{let s,l=n||u;return l&&(s=g(t,l))?s(e,f[l],t,l,h):(l=p)&&(s=g(t,l))?s(e,f[l],t,l,h):a(t)},d=t=>{a=t},k=t=>{h=t},m=t=>(t&&(u=t),u),y=t=>(t&&(p=t),p),j=(t,e)=>{c[t]={},i[t]=e},v=(t,e)=>{f[t]=e},w=(t,e)=>{i[t]||(i[t]={}),c[t]||(c[t]={});const n=Object.keys(e),s=n.length;for(let l=0;l{delete c[t],delete i[t]};export default{cache:c,store:i,t:b,onMissingKey:d,onMissingVariable:k,locale:m,fallback:y,set:j,unset:x,extend:w,plural:v};export{c as cache,i as store,b as t,d as onMissingKey,k as onMissingVariable,m as locale,y as fallback,j as set,v as plural,w as extend,x as unset}; +const t=/^\s*\w+\s*$/,e=/^\s*(\w+)\s*,\s*(select|plural)\s*,/i,n=JSON.stringify,s=t=>'(p["'+t+'"]||(p["'+t+'"]=="0"?0:"'+t+'" in p?"":v("'+t+'",k,l)))';function l(t){const e={},l=function t(e,l){const o=[];const r=e.length;for(let c=0;ct,a=()=>"";const g=(t,e)=>c[e]&&c[e][t]||y(t,e),y=(t,e)=>{let n=f[e];if(n){if("string"==typeof n[t])n=n[t];else{const e=t.split("."),s=e.length;for(let t=0;t{let s,l=n||u;return l&&(s=g(t,l))?s(e,i[l],t,l,a):(l=p)&&(s=g(t,l))?s(e,i[l],t,l,a):h(t)},j=t=>{h=t},d=t=>{a=t},k=t=>(t&&(u=t),u),m=t=>(t&&(p=t),p),O=(t,e)=>{c[t]={},f[t]=e},w=(t,e)=>{i[t]=e},v=(t,e)=>{f[t]||(f[t]={}),c[t]||(c[t]={}),x(f[t],e,c[t],"")},x=(t,e,n,s)=>{const l=Object.keys(e),o=l.length;for(let r=0;r{delete c[t],delete f[t]};export default{cache:c,store:f,t:b,onMissingKey:j,onMissingVariable:d,locale:k,fallback:m,set:O,unset:M,extend:v,plural:w};export{c as cache,f as store,b as t,j as onMissingKey,d as onMissingVariable,k as locale,m as fallback,O as set,w as plural,v as extend,M as unset}; diff --git a/dist/umd/frenchkiss.js b/dist/umd/frenchkiss.js index 7c75a94..600d50d 100644 --- a/dist/umd/frenchkiss.js +++ b/dist/umd/frenchkiss.js @@ -1,6 +1,6 @@ /** - * @license frenchkiss 0.0.10 + * @license frenchkiss 0.1.0 * Copyright (c) 2018-2019 Koala Interactive, Inc. * License: MIT */ -var n,e;n=this,e=function(){"use strict";var n=/^\s*\w+\s*$/,e=/^\s*(\w+)\s*,\s*(select|plural)\s*,/i,t=JSON.stringify,r=function(n){return'(p["'+n+'"]||(p["'+n+'"]=="0"?0:"'+n+'" in p?"":v("'+n+'",k,l)))'};function u(n){for(var e={},u=function n(e,u){var i=[];var f=e.length;for(var o=0;o", "license": "MIT",