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

i18next-xhr-backend

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18next-xhr-backend - npm Package Compare versions

Comparing version 0.5.5 to 0.6.0

2

dist/commonjs/index.js

@@ -136,3 +136,3 @@ 'use strict';

try {
ret = _this.options.parse(data);
ret = _this.options.parse(data, url);
} catch (e) {

@@ -139,0 +139,0 @@ err = 'failed parsing ' + url + ' to json';

@@ -126,3 +126,3 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

try {
ret = _this.options.parse(data);
ret = _this.options.parse(data, url);
} catch (e) {

@@ -129,0 +129,0 @@ err = 'failed parsing ' + url + ' to json';

@@ -171,3 +171,3 @@ (function (global, factory) {

try {
ret = _this.options.parse(data);
ret = _this.options.parse(data, url);
} catch (e) {

@@ -174,0 +174,0 @@ err = 'failed parsing ' + url + ' to json';

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("i18nextXHRBackend",e):t.i18nextXHRBackend=e()}(this,function(){"use strict";function t(t){return a.call(r.call(arguments,1),function(e){if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n])}),t}function e(t,e,n,i,a){if(i&&"object"===("undefined"==typeof i?"undefined":o["typeof"](i))){var r="",s=encodeURIComponent;for(var l in i)r+="&"+s(l)+"="+s(i[l]);i=r.slice(1)+(a?"":"&_t="+new Date)}try{var c=new(XMLHttpRequest||ActiveXObject)("MSXML2.XMLHTTP.3.0");c.open(i?"POST":"GET",t,1),e.crossDomain||c.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&c.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c.onreadystatechange=function(){c.readyState>3&&n&&n(c.responseText,c)},c.send(i)}catch(s){window.console&&console.log(s)}}function n(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:JSON.parse,crossDomain:!1,ajax:e}}var o={};o["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o.classCallCheck=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o.createClass=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}();var i=[],a=i.forEach,r=i.slice,s=function(){function e(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];o.classCallCheck(this,e),this.init(t,n),this.type="backend"}return o.createClass(e,[{key:"init",value:function(e){var o=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.services=e,this.options=t(o,this.options||{},n())}},{key:"readMulti",value:function(t,e,n){var o=this.services.interpolator.interpolate(this.options.loadPath,{lng:t.join("+"),ns:e.join("+")});this.loadUrl(o,n)}},{key:"read",value:function(t,e,n){var o=this.services.interpolator.interpolate(this.options.loadPath,{lng:t,ns:e});this.loadUrl(o,n)}},{key:"loadUrl",value:function(t,e){var n=this;this.options.ajax(t,this.options,function(o,i){if(i.status>=500&&i.status<600)return e("failed loading "+t,!0);if(i.status>=400&&i.status<500)return e("failed loading "+t,!1);var a=void 0,r=void 0;try{a=n.options.parse(o)}catch(s){r="failed parsing "+t+" to json"}return r?e(r,!1):void e(null,a)})}},{key:"create",value:function(t,e,n,o){var i=this;"string"==typeof t&&(t=[t]);var a={};a[n]=o||"",t.forEach(function(t){var n=i.services.interpolator.interpolate(i.options.addPath,{lng:t,ns:e});i.options.ajax(n,i.options,function(t,e){},a)})}}]),e}();return s.type="backend",s});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("i18nextXHRBackend",e):t.i18nextXHRBackend=e()}(this,function(){"use strict";function t(t){return a.call(r.call(arguments,1),function(e){if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n])}),t}function e(t,e,n,i,a){if(i&&"object"===("undefined"==typeof i?"undefined":o["typeof"](i))){var r="",s=encodeURIComponent;for(var l in i)r+="&"+s(l)+"="+s(i[l]);i=r.slice(1)+(a?"":"&_t="+new Date)}try{var c=new(XMLHttpRequest||ActiveXObject)("MSXML2.XMLHTTP.3.0");c.open(i?"POST":"GET",t,1),e.crossDomain||c.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&c.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c.onreadystatechange=function(){c.readyState>3&&n&&n(c.responseText,c)},c.send(i)}catch(s){window.console&&console.log(s)}}function n(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:JSON.parse,crossDomain:!1,ajax:e}}var o={};o["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o.classCallCheck=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o.createClass=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}();var i=[],a=i.forEach,r=i.slice,s=function(){function e(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];o.classCallCheck(this,e),this.init(t,n),this.type="backend"}return o.createClass(e,[{key:"init",value:function(e){var o=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.services=e,this.options=t(o,this.options||{},n())}},{key:"readMulti",value:function(t,e,n){var o=this.services.interpolator.interpolate(this.options.loadPath,{lng:t.join("+"),ns:e.join("+")});this.loadUrl(o,n)}},{key:"read",value:function(t,e,n){var o=this.services.interpolator.interpolate(this.options.loadPath,{lng:t,ns:e});this.loadUrl(o,n)}},{key:"loadUrl",value:function(t,e){var n=this;this.options.ajax(t,this.options,function(o,i){if(i.status>=500&&i.status<600)return e("failed loading "+t,!0);if(i.status>=400&&i.status<500)return e("failed loading "+t,!1);var a=void 0,r=void 0;try{a=n.options.parse(o,t)}catch(s){r="failed parsing "+t+" to json"}return r?e(r,!1):void e(null,a)})}},{key:"create",value:function(t,e,n,o){var i=this;"string"==typeof t&&(t=[t]);var a={};a[n]=o||"",t.forEach(function(t){var n=i.services.interpolator.interpolate(i.options.addPath,{lng:t,ns:e});i.options.ajax(n,i.options,function(t,e){},a)})}}]),e}();return s.type="backend",s});

@@ -171,3 +171,3 @@ (function (global, factory) {

try {
ret = _this.options.parse(data);
ret = _this.options.parse(data, url);
} catch (e) {

@@ -174,0 +174,0 @@ err = 'failed parsing ' + url + ' to json';

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("i18nextXHRBackend",e):t.i18nextXHRBackend=e()}(this,function(){"use strict";function t(t){return a.call(r.call(arguments,1),function(e){if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n])}),t}function e(t,e,n,i,a){if(i&&"object"===("undefined"==typeof i?"undefined":o["typeof"](i))){var r="",s=encodeURIComponent;for(var l in i)r+="&"+s(l)+"="+s(i[l]);i=r.slice(1)+(a?"":"&_t="+new Date)}try{var c=new(XMLHttpRequest||ActiveXObject)("MSXML2.XMLHTTP.3.0");c.open(i?"POST":"GET",t,1),e.crossDomain||c.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&c.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c.onreadystatechange=function(){c.readyState>3&&n&&n(c.responseText,c)},c.send(i)}catch(s){window.console&&console.log(s)}}function n(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:JSON.parse,crossDomain:!1,ajax:e}}var o={};o["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o.classCallCheck=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o.createClass=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}();var i=[],a=i.forEach,r=i.slice,s=function(){function e(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];o.classCallCheck(this,e),this.init(t,n),this.type="backend"}return o.createClass(e,[{key:"init",value:function(e){var o=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.services=e,this.options=t(o,this.options||{},n())}},{key:"readMulti",value:function(t,e,n){var o=this.services.interpolator.interpolate(this.options.loadPath,{lng:t.join("+"),ns:e.join("+")});this.loadUrl(o,n)}},{key:"read",value:function(t,e,n){var o=this.services.interpolator.interpolate(this.options.loadPath,{lng:t,ns:e});this.loadUrl(o,n)}},{key:"loadUrl",value:function(t,e){var n=this;this.options.ajax(t,this.options,function(o,i){if(i.status>=500&&i.status<600)return e("failed loading "+t,!0);if(i.status>=400&&i.status<500)return e("failed loading "+t,!1);var a=void 0,r=void 0;try{a=n.options.parse(o)}catch(s){r="failed parsing "+t+" to json"}return r?e(r,!1):void e(null,a)})}},{key:"create",value:function(t,e,n,o){var i=this;"string"==typeof t&&(t=[t]);var a={};a[n]=o||"",t.forEach(function(t){var n=i.services.interpolator.interpolate(i.options.addPath,{lng:t,ns:e});i.options.ajax(n,i.options,function(t,e){},a)})}}]),e}();return s.type="backend",s});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("i18nextXHRBackend",e):t.i18nextXHRBackend=e()}(this,function(){"use strict";function t(t){return a.call(r.call(arguments,1),function(e){if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n])}),t}function e(t,e,n,i,a){if(i&&"object"===("undefined"==typeof i?"undefined":o["typeof"](i))){var r="",s=encodeURIComponent;for(var l in i)r+="&"+s(l)+"="+s(i[l]);i=r.slice(1)+(a?"":"&_t="+new Date)}try{var c=new(XMLHttpRequest||ActiveXObject)("MSXML2.XMLHTTP.3.0");c.open(i?"POST":"GET",t,1),e.crossDomain||c.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&c.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c.onreadystatechange=function(){c.readyState>3&&n&&n(c.responseText,c)},c.send(i)}catch(s){window.console&&console.log(s)}}function n(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:JSON.parse,crossDomain:!1,ajax:e}}var o={};o["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o.classCallCheck=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o.createClass=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}();var i=[],a=i.forEach,r=i.slice,s=function(){function e(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];o.classCallCheck(this,e),this.init(t,n),this.type="backend"}return o.createClass(e,[{key:"init",value:function(e){var o=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.services=e,this.options=t(o,this.options||{},n())}},{key:"readMulti",value:function(t,e,n){var o=this.services.interpolator.interpolate(this.options.loadPath,{lng:t.join("+"),ns:e.join("+")});this.loadUrl(o,n)}},{key:"read",value:function(t,e,n){var o=this.services.interpolator.interpolate(this.options.loadPath,{lng:t,ns:e});this.loadUrl(o,n)}},{key:"loadUrl",value:function(t,e){var n=this;this.options.ajax(t,this.options,function(o,i){if(i.status>=500&&i.status<600)return e("failed loading "+t,!0);if(i.status>=400&&i.status<500)return e("failed loading "+t,!1);var a=void 0,r=void 0;try{a=n.options.parse(o,t)}catch(s){r="failed parsing "+t+" to json"}return r?e(r,!1):void e(null,a)})}},{key:"create",value:function(t,e,n,o){var i=this;"string"==typeof t&&(t=[t]);var a={};a[n]=o||"",t.forEach(function(t){var n=i.services.interpolator.interpolate(i.options.addPath,{lng:t,ns:e});i.options.ajax(n,i.options,function(t,e){},a)})}}]),e}();return s.type="backend",s});
{
"name": "i18next-xhr-backend",
"version": "0.5.5",
"version": "0.6.0",
"description": "backend layer for i18next using browsers xhr",

@@ -18,4 +18,4 @@ "main": "./index.js",

"babel-eslint": "6.0.0-beta.5",
"babel-preset-es2015": "6.6.0",
"babel-preset-es2015-native-modules": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-es2015-rollup": "1.1.1",

@@ -49,2 +49,3 @@ "babel-preset-stage-0": "6.5.0",

"phantomjs": "1.9.19",
"phantomjs-prebuilt": "^2.1.7",
"rimraf": "2.5.2",

@@ -51,0 +52,0 @@ "rollup": "0.25.4",

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