New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

i18njs

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18njs - npm Package Compare versions

Comparing version 2.1.3 to 2.1.4

2

bower.json
{
"name": "i18njs",
"main": "i18njs.js",
"version": "2.1.3",
"version": "2.1.4",
"homepage": "https://github.com/yoannmoinet/i18njs",

@@ -6,0 +6,0 @@ "authors": [

@@ -1,3 +0,3 @@

<a name="2.1.3"></a>
## [2.1.3](https://github.com/yoannmoinet/i18njs/compare/v2.1.3...v2.1.3) (2015-10-06)
<a name="2.1.4"></a>
## [2.1.4](https://github.com/yoannmoinet/i18njs/compare/v2.1.4...v2.1.4) (2015-10-07)

@@ -7,2 +7,12 @@

<a name="2.1.4"></a>
## [2.1.4](https://github.com/yoannmoinet/i18njs/compare/v2.1.3...v2.1.4) (2015-10-07)
### Features
* instrumentalize the templating feature ([5af18a4](https://github.com/yoannmoinet/i18njs/commit/5af18a4))
<a name="2.1.3"></a>

@@ -135,6 +145,6 @@ ## [2.1.3](https://github.com/yoannmoinet/i18njs/compare/v2.1.2...v2.1.3) (2015-10-06)

* add Travis CI ([988fc16](https://github.com/yoannmoinet/i18njs/commit/988fc16))
* add changelog ([45a3ccd](https://github.com/yoannmoinet/i18njs/commit/45a3ccd))
* add defaults template values ([3601034](https://github.com/yoannmoinet/i18njs/commit/3601034))
* add linting ([b9de51a](https://github.com/yoannmoinet/i18njs/commit/b9de51a))
* add Travis CI ([988fc16](https://github.com/yoannmoinet/i18njs/commit/988fc16))
* **npm:** add scripts ([4b6b378](https://github.com/yoannmoinet/i18njs/commit/4b6b378))

@@ -141,0 +151,0 @@

@@ -228,33 +228,38 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.i18njs = f()}})(function(){var define,module,exports;

if (typeof obj === 'string' || typeof obj === 'function') {
var i;
var settings = {
evaluate: options.evaluate || evaluate,
interpolate: options.interpolate || interpolate,
escape: options.escape || escape
};
var newDatas = {};
var defs = defaults[localLang] || defaults;
return this.templateString(obj, data, options, lng);
} else if (typeof obj === 'object') {
return obj;
}
for (i in defs) {
if (defs.hasOwnProperty(i)) {
newDatas[i] = defs[i];
}
}
return key;
};
for (i in data) {
if (data.hasOwnProperty(i)) {
newDatas[i] = data[i];
}
this.templateString = function (st, data, options, lng) {
var i;
options = options || {};
var settings = {
evaluate: options.evaluate || evaluate,
interpolate: options.interpolate || interpolate,
escape: options.escape || escape
};
var newDatas = {};
var defs = defaults[lng] || defaults;
for (i in defs) {
if (defs.hasOwnProperty(i)) {
newDatas[i] = defs[i];
}
}
if (typeof obj !== 'function' && typeof template === 'function') {
obj = template(obj, settings);
for (i in data) {
if (data.hasOwnProperty(i)) {
newDatas[i] = data[i];
}
}
return obj(newDatas);
} else if (typeof obj === 'object') {
return obj;
if (typeof st !== 'function' && typeof template === 'function') {
st = template(st, settings);
}
return key;
return st(newDatas);
};

@@ -261,0 +266,0 @@ };

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

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.i18njs=t()}}(function(){var t=/(.)^/,n=/\\|'|\r|\n|\u2028|\u2029/g,e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},r={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},o=function(t){"use strict";var n=function(n){return t[n]},e="(?:"+Object.keys(t).join("|")+")",r=RegExp(e),o=RegExp(e,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(o,n):t}},i=function(t){"use strict";return"\\"+r[t]},u=function(r,u){"use strict";var s=0,a="__p+='",f=RegExp([(u.escape||t).source,(u.interpolate||t).source,(u.evaluate||t).source].join("|")+"|$","g");r.replace(f,function(t,e,o,u,f){return a+=r.slice(s,f).replace(n,i),s=f+t.length,e?a+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":o?a+="'+\n((__t=("+o+"))==null?'':__t)+\n'":u&&(a+="';\n"+u+"\n__p+='"),t}),a+="';\n",a="with(obj||{}){\n"+a+"}\n",a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{var c=new Function("obj","_",a)}catch(p){throw p.source=a,p}var l=function(t){return c.call(this,t,{escape:o(e)})};return l.source="function (data) {\n return "+c.toString()+".call(this, data, {\n escape:"+o.toString()+".call(this, { '&': '&amp;', '<': '&lt;', '>': '&gt;','\"': '&quot;', \"'\": '&#x27;','`': '&#x60;'})})}",l},s=function(t,n){"use strict";for(var e=t.split(".");n&&e.length;)n=n[e.shift()];return n},a=function(t,n){"use strict";for(var e in n)n.hasOwnProperty(e)&&(t.hasOwnProperty(e)&&typeof t[e]==typeof n[e]?t[e]=a(n[e]):t[e]=n[e]);return t},f=function(){"use strict";var t="en",n={},e={},r=/\{\{([\s\S]+?)\}\}/g,o=/\{\{=([\s\S]+?)\}\}/g,i=/\{\{-([\s\S]+?)\}\}/g;this.add=function(t,e,r){var o,i;n[t]=n[t]||{},void 0===r?(r=e,e=void 0,i=n[t]):(n[t][e]=n[t][e]||{},i=n[t][e]);for(o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},this.has=function(e,r){r=r||t;var o=r+"."+e;return n[e]?!0:s(o,n)?!0:!1},this.listLangs=function(){var t=[];for(var e in n)t.push(e);return t},this.getCurrentLang=function(){return t},this.getDico=function(){return n},this.getDefaults=function(){return e},this.setLang=function(n){return t=n},this.setDefaults=function(t){e=a(e,t||{})},this.get=function(a,f,c,p){var l=p||t;void 0===p&&("string"==typeof f?(l=f,f=void 0):"string"==typeof c&&(l=c));var g=s(l+"."+a,n)||s(l+"."+a,e)||s(a,e);if(c=c||{},"string"==typeof g||"function"==typeof g){var h,_={evaluate:c.evaluate||r,interpolate:c.interpolate||o,escape:c.escape||i},d={},v=e[t]||e;for(h in v)v.hasOwnProperty(h)&&(d[h]=v[h]);for(h in f)f.hasOwnProperty(h)&&(d[h]=f[h]);return"function"!=typeof g&&"function"==typeof u&&(g=u(g,_)),g(d)}return"object"==typeof g?g:a}};return new f});
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.i18njs=t()}}(function(){var t=/(.)^/,n=/\\|'|\r|\n|\u2028|\u2029/g,e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},r={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},i=function(t){"use strict";var n=function(n){return t[n]},e="(?:"+Object.keys(t).join("|")+")",r=RegExp(e),i=RegExp(e,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,n):t}},o=function(t){"use strict";return"\\"+r[t]},u=function(r,u){"use strict";var s=0,a="__p+='",f=RegExp([(u.escape||t).source,(u.interpolate||t).source,(u.evaluate||t).source].join("|")+"|$","g");r.replace(f,function(t,e,i,u,f){return a+=r.slice(s,f).replace(n,o),s=f+t.length,e?a+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":i?a+="'+\n((__t=("+i+"))==null?'':__t)+\n'":u&&(a+="';\n"+u+"\n__p+='"),t}),a+="';\n",a="with(obj||{}){\n"+a+"}\n",a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{var c=new Function("obj","_",a)}catch(p){throw p.source=a,p}var l=function(t){return c.call(this,t,{escape:i(e)})};return l.source="function (data) {\n return "+c.toString()+".call(this, data, {\n escape:"+i.toString()+".call(this, { '&': '&amp;', '<': '&lt;', '>': '&gt;','\"': '&quot;', \"'\": '&#x27;','`': '&#x60;'})})}",l},s=function(t,n){"use strict";for(var e=t.split(".");n&&e.length;)n=n[e.shift()];return n},a=function(t,n){"use strict";for(var e in n)n.hasOwnProperty(e)&&(t.hasOwnProperty(e)&&typeof t[e]==typeof n[e]?t[e]=a(n[e]):t[e]=n[e]);return t},f=function(){"use strict";var t="en",n={},e={},r=/\{\{([\s\S]+?)\}\}/g,i=/\{\{=([\s\S]+?)\}\}/g,o=/\{\{-([\s\S]+?)\}\}/g;this.add=function(t,e,r){var i,o;n[t]=n[t]||{},void 0===r?(r=e,e=void 0,o=n[t]):(n[t][e]=n[t][e]||{},o=n[t][e]);for(i in r)r.hasOwnProperty(i)&&(o[i]=r[i])},this.has=function(e,r){r=r||t;var i=r+"."+e;return n[e]?!0:s(i,n)?!0:!1},this.listLangs=function(){var t=[];for(var e in n)t.push(e);return t},this.getCurrentLang=function(){return t},this.getDico=function(){return n},this.getDefaults=function(){return e},this.setLang=function(n){return t=n},this.setDefaults=function(t){e=a(e,t||{})},this.get=function(r,i,o,u){var a=u||t;void 0===u&&("string"==typeof i?(a=i,i=void 0):"string"==typeof o&&(a=o));var f=s(a+"."+r,n)||s(a+"."+r,e)||s(r,e);return o=o||{},"string"==typeof f||"function"==typeof f?this.templateString(f,i,o,a):"object"==typeof f?f:r},this.templateString=function(t,n,s,a){var f;s=s||{};var c={evaluate:s.evaluate||r,interpolate:s.interpolate||i,escape:s.escape||o},p={},l=e[a]||e;for(f in l)l.hasOwnProperty(f)&&(p[f]=l[f]);for(f in n)n.hasOwnProperty(f)&&(p[f]=n[f]);return"function"!=typeof t&&"function"==typeof u&&(t=u(t,c)),t(p)}};return new f});
{
"name": "i18njs",
"version": "2.1.3",
"version": "2.1.4",
"description": "Simplistic I18N tool for universal/isomorphic Javascript.",

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

@@ -122,33 +122,38 @@ /*globals template*/

if (typeof obj === 'string' || typeof obj === 'function') {
var i;
var settings = {
evaluate: options.evaluate || evaluate,
interpolate: options.interpolate || interpolate,
escape: options.escape || escape
};
var newDatas = {};
var defs = defaults[localLang] || defaults;
return this.templateString(obj, data, options, lng);
} else if (typeof obj === 'object') {
return obj;
}
for (i in defs) {
if (defs.hasOwnProperty(i)) {
newDatas[i] = defs[i];
}
}
return key;
};
for (i in data) {
if (data.hasOwnProperty(i)) {
newDatas[i] = data[i];
}
this.templateString = function (st, data, options, lng) {
var i;
options = options || {};
var settings = {
evaluate: options.evaluate || evaluate,
interpolate: options.interpolate || interpolate,
escape: options.escape || escape
};
var newDatas = {};
var defs = defaults[lng] || defaults;
for (i in defs) {
if (defs.hasOwnProperty(i)) {
newDatas[i] = defs[i];
}
}
if (typeof obj !== 'function' && typeof template === 'function') {
obj = template(obj, settings);
for (i in data) {
if (data.hasOwnProperty(i)) {
newDatas[i] = data[i];
}
}
return obj(newDatas);
} else if (typeof obj === 'object') {
return obj;
if (typeof st !== 'function' && typeof template === 'function') {
st = template(st, settings);
}
return key;
return st(newDatas);
};

@@ -155,0 +160,0 @@ };

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