Socket
Socket
Sign inDemoInstall

svelte-i18n

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-i18n - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

dist/i18n.umd.js

2

dist/i18n.js

@@ -1,2 +0,2 @@

function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("deepmerge")),n=e(require("object-resolve-path")),r=function(e){return e.replace(/(^|\s)\S/,function(e){return e.toUpperCase()})},o=function(e){return e.replace(/(^|\s)\S/g,function(e){return e.toUpperCase()})},u=function(e){return e.toLocaleUpperCase()},a=function(e){return e.toLocaleLowerCase()},i=function(e){return null!==e&&"object"==typeof e},c=/^(\d)+/,l=/^(\w)+/,s=function(){this._caches=Object.create(null)};s.prototype.interpolate=function(e,t){if(!t)return[e];var n=this._caches[e];return n||(n=function(e){var t=[],n=0,r="";for(;n<e.length;){var o=e[n++];if("{"!==o||n>0&&"\\"===o[n-1])r+=o;else{r.length&&t.push({type:"text",value:r}),r="";var u="";for(o=e[n++];"}"!==o;)u+=o,o=e[n++];var a=c.test(u)?"list":l.test(u)?"named":"unknown";t.push({value:u,type:a})}}r&&t.push({type:"text",value:r});return t}(e),this._caches[e]=n),function(e,t){var n=[],r=0,o=Array.isArray(t)?"list":i(t)?"named":"unknown";if("unknown"===o)return n;for(;r<e.length;){var u=e[r++];switch(u.type){case"text":n.push(u.value);break;case"list":n.push(t[parseInt(u.value,10)]);break;case"named":"named"===o?n.push(t[u.value]):"production"!==process.env.NODE_ENV&&console.warn("[svelte-i18n] Type of token '"+u.type+"' and format of value '"+o+"' don't match!");break;case"unknown":"production"!==process.env.NODE_ENV&&console.warn("[svelte-i18n] Detect 'unknown' type of token!")}}return n}(n,t)},exports.capital=r,exports.title=o,exports.upper=u,exports.lower=a,exports.i18n=function(e,i){var c,l=i.dictionary,p=new s,f={},v=function(e,t,r,o){void 0===r&&(r=c),void 0===o&&(o=void 0);var u=n(f[r],e);if(!u)return e;if(o)for(var a=0,i=o.length;a<i;a++)u=o[a](u);return t&&(u=p.interpolate(u,t).join("")),u.trim()},h=function(e,t,n){return r(v(e,t,n))},d=function(e,t,n){return o(v(e,t,n))},y=function(e,t,n){return u(v(e,t,n))},w=function(e,t,n){return a(v(e,t,n))},k=function(e,t,n,r){return v(e,n,r,[function(e){var n="number"==typeof t?Math.min(Math.abs(t),2):0;return e.split("|")[n]}])};return e.on("locale",function(t){if(Object.keys(f).includes(t)){c=t;var n=v;n.upper=y,n.lower=w,n.title=d,n.capital=h,n.plural=k,e.set({locale:t,_:n})}else console.error("[svelte-i18n] Couldn't find the \""+t+'" locale.')}),e.i18n={setLocale:function(t){e.fire("locale",t)},extendDictionary:function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];f=t.all([f].concat(e))}},e.i18n.extendDictionary(l),e};
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("deepmerge")),n=e(require("object-resolve-path")),r=function(e){return e.replace(/(^|\s)\S/,function(e){return e.toUpperCase()})},o=function(e){return e.replace(/(^|\s)\S/g,function(e){return e.toUpperCase()})},a=function(e){return e.toLocaleUpperCase()},u=function(e){return e.toLocaleLowerCase()},i=function(e){return null!==e&&"object"==typeof e},c=/^(\d)+/,l=/^(\w)+/,s=function(){this._caches=Object.create(null)};s.prototype.interpolate=function(e,t){if(!t)return[e];var n=this._caches[e];return n||(n=function(e){var t=[],n=0,r="";for(;n<e.length;){var o=e[n++];if("{"!==o||n>0&&"\\"===o[n-1])r+=o;else{r.length&&t.push({type:"text",value:r}),r="";var a="";for(o=e[n++];"}"!==o;)a+=o,o=e[n++];var u=c.test(a)?"list":l.test(a)?"named":"unknown";t.push({value:a,type:u})}}r&&t.push({type:"text",value:r});return t}(e),this._caches[e]=n),function(e,t){var n=[],r=0,o=Array.isArray(t)?"list":i(t)?"named":"unknown";if("unknown"===o)return n;for(;r<e.length;){var a=e[r++];switch(a.type){case"text":n.push(a.value);break;case"list":n.push(t[parseInt(a.value,10)]);break;case"named":"named"===o?n.push(t[a.value]):"production"!==process.env.NODE_ENV&&console.warn("[svelte-i18n] Type of token '"+a.type+"' and format of value '"+o+"' don't match!");break;case"unknown":"production"!==process.env.NODE_ENV&&console.warn("[svelte-i18n] Detect 'unknown' type of token!")}}return n}(n,t)},exports.capital=r,exports.title=o,exports.upper=a,exports.lower=u,exports.i18n=function(e,i){var c,l,p=i.dictionary,f=new s,v=function(e,t,r,o){void 0===r&&(r=l),void 0===o&&(o=void 0);var a=n(c[r],e);if(!a)return e;if(o)for(var u=0,i=o.length;u<i;u++)a=o[u](a);return t&&(a=f.interpolate(a,t).join("")),a.trim()},h=function(e,t,n){return r(v(e,t,n))},d=function(e,t,n){return o(v(e,t,n))},y=function(e,t,n){return a(v(e,t,n))},w=function(e,t,n){return u(v(e,t,n))},k=function(e,t,n,r){return v(e,n,r,[function(e){var n="number"==typeof t?Math.min(Math.abs(t),2):0;return e.split("|")[n]}])};return e.on("locale",function(t){if(Object.keys(c).includes(t)){l=t;var n=v;n.upper=y,n.lower=w,n.title=d,n.capital=h,n.plural=k,e.set({locale:t,_:n})}else console.error("[svelte-i18n] Couldn't find the \""+t+'" locale.')}),e.i18n={setLocale:function(t){e.fire("locale",t)},extendDictionary:function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];c=t.all([c].concat(e))}},Array.isArray(p)?c=t.all(p):p=c,e};
//# sourceMappingURL=i18n.js.map

@@ -1,2 +0,2 @@

import e from"deepmerge";import n from"object-resolve-path";var t=function(e){return e.replace(/(^|\s)\S/,function(e){return e.toUpperCase()})},r=function(e){return e.replace(/(^|\s)\S/g,function(e){return e.toUpperCase()})},o=function(e){return e.toLocaleUpperCase()},a=function(e){return e.toLocaleLowerCase()},u=function(e){return null!==e&&"object"==typeof e},i=/^(\d)+/,c=/^(\w)+/,l=function(){this._caches=Object.create(null)};function s(u,i){var c,s=i.dictionary,f=new l,p={},v=function(e,t,r,o){void 0===r&&(r=c),void 0===o&&(o=void 0);var a=n(p[r],e);if(!a)return e;if(o)for(var u=0,i=o.length;u<i;u++)a=o[u](a);return t&&(a=f.interpolate(a,t).join("")),a.trim()},h=function(e,n,r){return t(v(e,n,r))},d=function(e,n,t){return r(v(e,n,t))},y=function(e,n,t){return o(v(e,n,t))},m=function(e,n,t){return a(v(e,n,t))},w=function(e,n,t,r){return v(e,t,r,[function(e){var t="number"==typeof n?Math.min(Math.abs(n),2):0;return e.split("|")[t]}])};return u.on("locale",function(e){if(Object.keys(p).includes(e)){c=e;var n=v;n.upper=y,n.lower=m,n.title=d,n.capital=h,n.plural=w,u.set({locale:e,_:n})}else console.error("[svelte-i18n] Couldn't find the \""+e+'" locale.')}),u.i18n={setLocale:function(e){u.fire("locale",e)},extendDictionary:function(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];p=e.all([p].concat(n))}},u.i18n.extendDictionary(s),u}l.prototype.interpolate=function(e,n){if(!n)return[e];var t=this._caches[e];return t||(t=function(e){var n=[],t=0,r="";for(;t<e.length;){var o=e[t++];if("{"!==o||t>0&&"\\"===o[t-1])r+=o;else{r.length&&n.push({type:"text",value:r}),r="";var a="";for(o=e[t++];"}"!==o;)a+=o,o=e[t++];var u=i.test(a)?"list":c.test(a)?"named":"unknown";n.push({value:a,type:u})}}r&&n.push({type:"text",value:r});return n}(e),this._caches[e]=t),function(e,n){var t=[],r=0,o=Array.isArray(n)?"list":u(n)?"named":"unknown";if("unknown"===o)return t;for(;r<e.length;){var a=e[r++];switch(a.type){case"text":t.push(a.value);break;case"list":t.push(n[parseInt(a.value,10)]);break;case"named":"named"===o?t.push(n[a.value]):"production"!==process.env.NODE_ENV&&console.warn("[svelte-i18n] Type of token '"+a.type+"' and format of value '"+o+"' don't match!");break;case"unknown":"production"!==process.env.NODE_ENV&&console.warn("[svelte-i18n] Detect 'unknown' type of token!")}}return t}(t,n)};export{t as capital,r as title,o as upper,a as lower,s as i18n};
import e from"deepmerge";import n from"object-resolve-path";var t=function(e){return e.replace(/(^|\s)\S/,function(e){return e.toUpperCase()})},r=function(e){return e.replace(/(^|\s)\S/g,function(e){return e.toUpperCase()})},o=function(e){return e.toLocaleUpperCase()},a=function(e){return e.toLocaleLowerCase()},u=function(e){return null!==e&&"object"==typeof e},i=/^(\d)+/,c=/^(\w)+/,l=function(){this._caches=Object.create(null)};function s(u,i){var c,s,f=i.dictionary,p=new l,v=function(e,t,r,o){void 0===r&&(r=s),void 0===o&&(o=void 0);var a=n(c[r],e);if(!a)return e;if(o)for(var u=0,i=o.length;u<i;u++)a=o[u](a);return t&&(a=p.interpolate(a,t).join("")),a.trim()},h=function(e,n,r){return t(v(e,n,r))},d=function(e,n,t){return r(v(e,n,t))},y=function(e,n,t){return o(v(e,n,t))},m=function(e,n,t){return a(v(e,n,t))},w=function(e,n,t,r){return v(e,t,r,[function(e){var t="number"==typeof n?Math.min(Math.abs(n),2):0;return e.split("|")[t]}])};return u.on("locale",function(e){if(Object.keys(c).includes(e)){s=e;var n=v;n.upper=y,n.lower=m,n.title=d,n.capital=h,n.plural=w,u.set({locale:e,_:n})}else console.error("[svelte-i18n] Couldn't find the \""+e+'" locale.')}),u.i18n={setLocale:function(e){u.fire("locale",e)},extendDictionary:function(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];c=e.all([c].concat(n))}},Array.isArray(f)?c=e.all(f):f=c,u}l.prototype.interpolate=function(e,n){if(!n)return[e];var t=this._caches[e];return t||(t=function(e){var n=[],t=0,r="";for(;t<e.length;){var o=e[t++];if("{"!==o||t>0&&"\\"===o[t-1])r+=o;else{r.length&&n.push({type:"text",value:r}),r="";var a="";for(o=e[t++];"}"!==o;)a+=o,o=e[t++];var u=i.test(a)?"list":c.test(a)?"named":"unknown";n.push({value:a,type:u})}}r&&n.push({type:"text",value:r});return n}(e),this._caches[e]=t),function(e,n){var t=[],r=0,o=Array.isArray(n)?"list":u(n)?"named":"unknown";if("unknown"===o)return t;for(;r<e.length;){var a=e[r++];switch(a.type){case"text":t.push(a.value);break;case"list":t.push(n[parseInt(a.value,10)]);break;case"named":"named"===o?t.push(n[a.value]):"production"!==process.env.NODE_ENV&&console.warn("[svelte-i18n] Type of token '"+a.type+"' and format of value '"+o+"' don't match!");break;case"unknown":"production"!==process.env.NODE_ENV&&console.warn("[svelte-i18n] Detect 'unknown' type of token!")}}return t}(t,n)};export{t as capital,r as title,o as upper,a as lower,s as i18n};
//# sourceMappingURL=i18n.m.js.map
{
"name": "svelte-i18n",
"version": "0.0.3",
"version": "0.0.4",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "dist/i18n.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc