Comparing version
@@ -1,2 +0,2 @@ | ||
var n={},o="{}",r=1,e=2,t=0;function i(n,o){return n.reduce(function(n,r,e){return n+r+(e<o.length?o[e]:"")},"")}function c(n){return n.join(o)}exports.t=function(o){for(var u=[],f=arguments.length-1;f-- >0;)u[f]=arguments[f+1];var a="string"==typeof o,l=a?o:c(o),s=n[l];return s?"string"==typeof s?s:s(u):(function(n){if(t===r)console.warn(n);else if(t===e)throw new Error(n)}("No translation found for "+l),a?o:i(o,u))},exports.v=function(n){for(var o=[],r=arguments.length-1;r-- >0;)o[r]=arguments[r+1];return function(r){return o.length?i(n,o.map(function(n){return r[n]})):n.join("")}},exports.k=c,exports.load=function(o,r){"object"==typeof o&&Object.keys(o).forEach(function(r){n[r]=o[r]}),n[o]=r},exports.clear=function(){n={}},exports.config=function(n){void 0!==n.log&&(t=n.log),void 0!==n.placeholder&&(o=n.placeholder)},exports.loader=function(n){return"function"==typeof this.cacheable&&this.cacheable(),"var nano = require('nano-i18n');\nvar res = {};\n"+n.map(function(n){return"res[nano.k`"+n.key+"`] = nano.v`"+n.val+"`;"}).join("\n")+"\nmodule.exports = res;"}; | ||
var n={},o="{}",r=1,e=2,t=0;function i(n,o){return n.reduce(function(n,r,e){return n+r+(e<o.length?o[e]:"")},"")}function u(n){return n.join(o)}exports.t=function(o){for(var c=[],f=arguments.length-1;f-- >0;)c[f]=arguments[f+1];var a="string"==typeof o,s=a?o:u(o),l=n[s];return l?"string"==typeof l?l:l(c):(function(n){if(t===r)console.warn(n);else if(t===e)throw new Error(n)}("No translation found for "+s),a?o:i(o,c))},exports.v=function(n){for(var o=[],r=arguments.length-1;r-- >0;)o[r]=arguments[r+1];return function(r){return o.length?i(n,o.map(function(n){return r[n]})):n.join("")}},exports.k=u,exports.load=function(o,r){"object"==typeof o&&Object.keys(o).forEach(function(r){n[r]=o[r]}),n[o]=r},exports.clear=function(){n={}},exports.config=function(n){void 0!==n.log&&(t=n.log),void 0!==n.placeholder&&(o=n.placeholder)},exports.loader=function(n){"function"==typeof this.cacheable&&this.cacheable();var o=n;return"object"==typeof this.query&&"function"==typeof this.query.parse&&(o=this.query.parse(n)),"var nano = require('nano-i18n');\nvar res = {};\n"+o.map(function(n){return"res[nano.k`"+n.key+"`] = nano.v`"+n.val+"`;"}).join("\n")+"\nmodule.exports = res;"}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
!function(n,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o(n.nanoI18n={})}(this,function(n){var o={},e="{}",t=1,r=2,i=0;function f(n,o){return n.reduce(function(n,e,t){return n+e+(t<o.length?o[t]:"")},"")}function u(n){return n.join(e)}n.t=function(n){for(var e=[],c=arguments.length-1;c-- >0;)e[c]=arguments[c+1];var a="string"==typeof n,l=a?n:u(n),d=o[l];return d?"string"==typeof d?d:d(e):(function(n){if(i===t)console.warn(n);else if(i===r)throw new Error(n)}("No translation found for "+l),a?n:f(n,e))},n.v=function(n){for(var o=[],e=arguments.length-1;e-- >0;)o[e]=arguments[e+1];return function(e){return o.length?f(n,o.map(function(n){return e[n]})):n.join("")}},n.k=u,n.load=function(n,e){"object"==typeof n&&Object.keys(n).forEach(function(e){o[e]=n[e]}),o[n]=e},n.clear=function(){o={}},n.config=function(n){void 0!==n.log&&(i=n.log),void 0!==n.placeholder&&(e=n.placeholder)},n.loader=function(n){return"function"==typeof this.cacheable&&this.cacheable(),"var nano = require('nano-i18n');\nvar res = {};\n"+n.map(function(n){return"res[nano.k`"+n.key+"`] = nano.v`"+n.val+"`;"}).join("\n")+"\nmodule.exports = res;"}}); | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(n.nanoI18n={})}(this,function(n){var e={},o="{}",t=1,r=2,i=0;function f(n,e){return n.reduce(function(n,o,t){return n+o+(t<e.length?e[t]:"")},"")}function u(n){return n.join(o)}n.t=function(n){for(var o=[],c=arguments.length-1;c-- >0;)o[c]=arguments[c+1];var a="string"==typeof n,l=a?n:u(n),s=e[l];return s?"string"==typeof s?s:s(o):(function(n){if(i===t)console.warn(n);else if(i===r)throw new Error(n)}("No translation found for "+l),a?n:f(n,o))},n.v=function(n){for(var e=[],o=arguments.length-1;o-- >0;)e[o]=arguments[o+1];return function(o){return e.length?f(n,e.map(function(n){return o[n]})):n.join("")}},n.k=u,n.load=function(n,o){"object"==typeof n&&Object.keys(n).forEach(function(o){e[o]=n[o]}),e[n]=o},n.clear=function(){e={}},n.config=function(n){void 0!==n.log&&(i=n.log),void 0!==n.placeholder&&(o=n.placeholder)},n.loader=function(n){"function"==typeof this.cacheable&&this.cacheable();var e=n;return"object"==typeof this.query&&"function"==typeof this.query.parse&&(e=this.query.parse(n)),"var nano = require('nano-i18n');\nvar res = {};\n"+e.map(function(n){return"res[nano.k`"+n.key+"`] = nano.v`"+n.val+"`;"}).join("\n")+"\nmodule.exports = res;"}}); | ||
//# sourceMappingURL=index.umd.js.map |
@@ -126,3 +126,3 @@ /* | ||
*/ | ||
function loader(obj) { | ||
function loader(text) { | ||
if (typeof this.cacheable === 'function') { | ||
@@ -132,2 +132,7 @@ this.cacheable(); | ||
let obj = text; | ||
if (typeof this.query === 'object' && typeof this.query.parse === 'function') { | ||
obj = this.query.parse(text); | ||
} | ||
return `var nano = require('nano-i18n'); | ||
@@ -134,0 +139,0 @@ var res = {}; |
{ | ||
"name": "nano-i18n", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "umd:main": "dist/index.umd.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
28542
4.46%134
3.88%