diff --git a/README.md b/README.md index 10b4648..5120230 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

💋 FrenchKiss.js

[![Build Status](https://travis-ci.com/koala-interactive/frenchkiss.js.svg?branch=master)](https://travis-ci.com/koala-interactive/frenchkiss.js) -[![File size](https://img.shields.io/badge/GZIP%20size-1.2%20kB-brightgreen.svg)](./dist/umd/frenchkiss.js) +[![File size](https://img.shields.io/badge/GZIP%20size-1.1%20kB-brightgreen.svg)](./dist/umd/frenchkiss.js) ![](https://img.shields.io/badge/dependencies-none-brightgreen.svg) ![](https://img.shields.io/snyk/vulnerabilities/github/koala-interactive/frenchkiss.js.svg) [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT) diff --git a/dist/cjs/frenchkiss.js b/dist/cjs/frenchkiss.js index 7620c56..769e83d 100644 --- a/dist/cjs/frenchkiss.js +++ b/dist/cjs/frenchkiss.js @@ -1,6 +1,6 @@ /** - * @license frenchkiss 0.1.0 + * @license frenchkiss 0.2.0 * Copyright (c) 2018-2019 Koala Interactive, Inc. * License: MIT */ -"use strict";var t=/^\s*\w+\s*$/,e=/^\s*(\w+)\s*,\s*(select|plural)\s*,/i,n=JSON.stringify,r=function(t){return'(p["'+t+'"]||(p["'+t+'"]=="0"?0:"'+t+'" in p?"":v("'+t+'",k,l)))'};function u(t){for(var e={},u=function t(e,u){var o=[];var f=e.length;for(var i=0;i'(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}; +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 o(t){const e={},o=function t(e,o){const l=[];const r=e.length;for(let c=0;ct,h=()=>"";const g=(t,e)=>c[e]&&c[e][t]||f[e]&&"string"==typeof f[e][t]&&(c[e][t]=o(f[e][t])),b=(t,e,n)=>{let s,o=n||u;return o&&(s=g(t,o))?s(e,i[o],t,o,h):(o=p)&&(s=g(t,o))?s(e,i[o],t,o,h):a(t,e,n||u)},y=t=>{a=t},d=t=>{h=t},j=t=>(t&&(u=t),u),k=t=>(t&&(p=t),p),m=(t,e)=>{O(e,e,""),c[t]={},f[t]=e},O=(t,e,n)=>{const s=Object.keys(e),o=s.length;for(let l=0;l{i[t]=e},w=(t,e)=>{f[t]||(f[t]={}),c[t]||(c[t]={}),x(f[t],c[t],e,"")},x=(t,e,n,s)=>{const o=Object.keys(n),l=o.length;for(let r=0;r{delete c[t],delete f[t]};export default{cache:c,store:f,t:b,onMissingKey:y,onMissingVariable:d,locale:j,fallback:k,set:m,unset:M,extend:w,plural:v};export{c as cache,f as store,b as t,y as onMissingKey,d as onMissingVariable,j as locale,k as fallback,m as set,v as plural,w as extend,M as unset}; diff --git a/dist/umd/frenchkiss.js b/dist/umd/frenchkiss.js index 600d50d..646d493 100644 --- a/dist/umd/frenchkiss.js +++ b/dist/umd/frenchkiss.js @@ -1,6 +1,6 @@ /** - * @license frenchkiss 0.1.0 + * @license frenchkiss 0.2.0 * Copyright (c) 2018-2019 Koala Interactive, Inc. * License: MIT */ -var e,t;e=this,t=function(){"use strict";var e=/^\s*\w+\s*$/,t=/^\s*(\w+)\s*,\s*(select|plural)\s*,/i,n=JSON.stringify,r=function(e){return'(p["'+e+'"]||(p["'+e+'"]=="0"?0:"'+e+'" in p?"":v("'+e+'",k,l)))'};function f(e){for(var t={},f=function e(t,f){var o=[];var i=t.length;for(var u=0;u", "license": "MIT",