diff --git a/demo/trunk/node_modules/.yarn-integrity b/demo/trunk/node_modules/.yarn-integrity index fd1f2ba2..680e8471 100644 --- a/demo/trunk/node_modules/.yarn-integrity +++ b/demo/trunk/node_modules/.yarn-integrity @@ -19,7 +19,7 @@ "grunt-contrib-watch@^1.1.0", "grunt@^1.4.0", "i18next-browser-languagedetector@~8.0.0", - "i18next-http-backend@~2.5.0", + "i18next-http-backend@~2.6.0", "i18next@~23.14.0", "jquery@3.4.1" ], @@ -173,7 +173,7 @@ "http-parser-js@>=0.5.1": "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.3.tgz#01d2709c79d41698bb01d4decc5e9da4e4a033d9", "http2-wrapper@^2.2.1": "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-2.2.1.tgz#310968153dcdedb160d8b72114363ef5fce1f64a", "i18next-browser-languagedetector@~8.0.0": "https://registry.yarnpkg.com/i18next-browser-languagedetector/-/i18next-browser-languagedetector-8.0.0.tgz#b6fdd9b43af67c47f2c26c9ba27710a1eaf31e2f", - "i18next-http-backend@~2.5.0": "https://registry.yarnpkg.com/i18next-http-backend/-/i18next-http-backend-2.5.2.tgz#3d846cc239987fe7700d1cf0f17975807bfd25d3", + "i18next-http-backend@~2.6.0": "https://registry.yarnpkg.com/i18next-http-backend/-/i18next-http-backend-2.6.0.tgz#e2a2bc391b129c17d4918e9574962df6dc130327", "i18next@~23.14.0": "https://registry.yarnpkg.com/i18next/-/i18next-23.14.0.tgz#d415a858390cc849f3db0df539cb2bbfe24a3cdb", "iconv-lite@~0.6.3": "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501", "ignore@^5.2.0": "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324", diff --git a/demo/trunk/node_modules/i18next-http-backend/CHANGELOG.md b/demo/trunk/node_modules/i18next-http-backend/CHANGELOG.md index bba09f50..5f4a23f6 100644 --- a/demo/trunk/node_modules/i18next-http-backend/CHANGELOG.md +++ b/demo/trunk/node_modules/i18next-http-backend/CHANGELOG.md @@ -1,3 +1,7 @@ +### 2.6.0 + +- fix "Failed to fetch" retry case [147](https://github.com/i18next/i18next-http-backend/issues/147) + ### 2.5.2 - dereference timers in node.js so that the process may exit when finished [139](https://github.com/i18next/i18next-http-backend/pull/139) diff --git a/demo/trunk/node_modules/i18next-http-backend/README.md b/demo/trunk/node_modules/i18next-http-backend/README.md index d5e94fb0..a235c0ab 100644 --- a/demo/trunk/node_modules/i18next-http-backend/README.md +++ b/demo/trunk/node_modules/i18next-http-backend/README.md @@ -79,6 +79,10 @@ for plain browser: ``` +```js +i18next.use(i18nextHttpBackend).init(i18nextOptions); +``` + - As with all modules you can either pass the constructor function (class) to the i18next.use or a concrete instance. - If you don't use a module loader it will be added to `window.i18nextHttpBackend` @@ -152,7 +156,7 @@ for plain browser: mode: 'cors', credentials: 'same-origin', cache: 'default' - } + }, // define a custom request function // can be used to support XDomainRequest in IE 8 and 9 diff --git a/demo/trunk/node_modules/i18next-http-backend/cjs/index.d.ts b/demo/trunk/node_modules/i18next-http-backend/cjs/index.d.ts index 6d47918d..ac5620c8 100644 --- a/demo/trunk/node_modules/i18next-http-backend/cjs/index.d.ts +++ b/demo/trunk/node_modules/i18next-http-backend/cjs/index.d.ts @@ -103,7 +103,7 @@ export interface HttpBackendOptions { requestOptions?: RequestInit | ((payload: {} | string) => RequestInit); } -type RequestCallback = (error: any, response: RequestResponse) => void; +type RequestCallback = (error: any | undefined | null, response: RequestResponse | undefined | null) => void; interface RequestResponse { status: number; diff --git a/demo/trunk/node_modules/i18next-http-backend/cjs/index.js b/demo/trunk/node_modules/i18next-http-backend/cjs/index.js index 60767be6..08410b5a 100644 --- a/demo/trunk/node_modules/i18next-http-backend/cjs/index.js +++ b/demo/trunk/node_modules/i18next-http-backend/cjs/index.js @@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", { exports.default = void 0; var _utils = require("./utils.js"); var _request = _interopRequireDefault(require("./request.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } +function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } +function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var getDefaults = function getDefaults() { @@ -109,7 +109,7 @@ var Backend = function () { this.options.request(this.options, url, payload, function (err, res) { if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback('failed loading ' + url + '; status code: ' + res.status, true); if (res && res.status >= 400 && res.status < 500) return callback('failed loading ' + url + '; status code: ' + res.status, false); - if (!res && err && err.message && err.message.indexOf('Failed to fetch') > -1) return callback('failed loading ' + url + ': ' + err.message, true); + if (!res && err && err.message && (err.message.indexOf('Failed to fetch') > -1 || err.message.indexOf('failed') > -1 && err.message.indexOf('fetch') > -1)) return callback('failed loading ' + url + ': ' + err.message, true); if (err) return callback(err, false); var ret, parseErr; try { diff --git a/demo/trunk/node_modules/i18next-http-backend/cjs/request.js b/demo/trunk/node_modules/i18next-http-backend/cjs/request.js index 88d30204..3515e9c2 100644 --- a/demo/trunk/node_modules/i18next-http-backend/cjs/request.js +++ b/demo/trunk/node_modules/i18next-http-backend/cjs/request.js @@ -10,7 +10,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } diff --git a/demo/trunk/node_modules/i18next-http-backend/esm/index.d.ts b/demo/trunk/node_modules/i18next-http-backend/esm/index.d.ts index 6d47918d..ac5620c8 100644 --- a/demo/trunk/node_modules/i18next-http-backend/esm/index.d.ts +++ b/demo/trunk/node_modules/i18next-http-backend/esm/index.d.ts @@ -103,7 +103,7 @@ export interface HttpBackendOptions { requestOptions?: RequestInit | ((payload: {} | string) => RequestInit); } -type RequestCallback = (error: any, response: RequestResponse) => void; +type RequestCallback = (error: any | undefined | null, response: RequestResponse | undefined | null) => void; interface RequestResponse { status: number; diff --git a/demo/trunk/node_modules/i18next-http-backend/esm/index.js b/demo/trunk/node_modules/i18next-http-backend/esm/index.js index a659ec19..0ca669fe 100644 --- a/demo/trunk/node_modules/i18next-http-backend/esm/index.js +++ b/demo/trunk/node_modules/i18next-http-backend/esm/index.js @@ -1,10 +1,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } +function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } +function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } import { makePromise } from './utils.js'; @@ -102,7 +102,7 @@ var Backend = function () { this.options.request(this.options, url, payload, function (err, res) { if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback('failed loading ' + url + '; status code: ' + res.status, true); if (res && res.status >= 400 && res.status < 500) return callback('failed loading ' + url + '; status code: ' + res.status, false); - if (!res && err && err.message && err.message.indexOf('Failed to fetch') > -1) return callback('failed loading ' + url + ': ' + err.message, true); + if (!res && err && err.message && (err.message.indexOf('Failed to fetch') > -1 || err.message.indexOf('failed') > -1 && err.message.indexOf('fetch') > -1)) return callback('failed loading ' + url + ': ' + err.message, true); if (err) return callback(err, false); var ret, parseErr; try { diff --git a/demo/trunk/node_modules/i18next-http-backend/esm/request.js b/demo/trunk/node_modules/i18next-http-backend/esm/request.js index 76b986d4..3f1c7771 100644 --- a/demo/trunk/node_modules/i18next-http-backend/esm/request.js +++ b/demo/trunk/node_modules/i18next-http-backend/esm/request.js @@ -1,6 +1,6 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } diff --git a/demo/trunk/node_modules/i18next-http-backend/i18nextHttpBackend.js b/demo/trunk/node_modules/i18next-http-backend/i18nextHttpBackend.js index f71a6a41..5abdf4ed 100644 --- a/demo/trunk/node_modules/i18next-http-backend/i18nextHttpBackend.js +++ b/demo/trunk/node_modules/i18next-http-backend/i18nextHttpBackend.js @@ -28,14 +28,14 @@ Object.defineProperty(exports, "__esModule", { exports.default = void 0; var _utils = require("./utils.js"); var _request = _interopRequireDefault(require("./request.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } +function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } +function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var getDefaults = function getDefaults() { @@ -131,7 +131,7 @@ var Backend = function () { this.options.request(this.options, url, payload, function (err, res) { if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback('failed loading ' + url + '; status code: ' + res.status, true); if (res && res.status >= 400 && res.status < 500) return callback('failed loading ' + url + '; status code: ' + res.status, false); - if (!res && err && err.message && err.message.indexOf('Failed to fetch') > -1) return callback('failed loading ' + url + ': ' + err.message, true); + if (!res && err && err.message && (err.message.indexOf('Failed to fetch') > -1 || err.message.indexOf('failed') > -1 && err.message.indexOf('fetch') > -1)) return callback('failed loading ' + url + ': ' + err.message, true); if (err) return callback(err, false); var ret, parseErr; try { @@ -226,7 +226,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } diff --git a/demo/trunk/node_modules/i18next-http-backend/i18nextHttpBackend.min.js b/demo/trunk/node_modules/i18next-http-backend/i18nextHttpBackend.min.js index d2b6da15..8d0157e3 100644 --- a/demo/trunk/node_modules/i18next-http-backend/i18nextHttpBackend.min.js +++ b/demo/trunk/node_modules/i18next-http-backend/i18nextHttpBackend.min.js @@ -1 +1 @@ -!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).i18nextHttpBackend=e()}(function(){return function o(r,i,s){function a(t,e){if(!i[t]){if(!r[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(u)return u(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}n=i[t]={exports:{}},r[t][0].call(n.exports,function(e){return a(r[t][1][e]||e)},n,n.exports,o,r,i,s)}return i[t].exports}for(var u="function"==typeof require&&require,e=0;e{if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=i(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==i(e)?e:e+""}e=function e(t){var n=1{if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=w(e)&&"function"!=typeof e)return{default:e};if((t=a(t))&&t.has(e))return t.get(e);var n,o,r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((o=i?Object.getOwnPropertyDescriptor(e,n):null)&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]);return r.default=e,t&&t.set(e,r),r})(n("./getFetch.js"));function a(e){var t,n;return"function"!=typeof WeakMap?null:(t=new WeakMap,n=new WeakMap,(a=function(e){return e?n:t})(e))}function t(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function g(o){for(var e=1;e(e=((e,t)=>{if("object"!=w(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=w(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==w(e)?e:e+""))(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(r,e))})}return o}function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"function"==typeof fetch&&(h=void 0!==S&&S.fetch?S.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),(0,m.hasXMLHttpRequest)()&&(void 0!==S&&S.XMLHttpRequest?b=S.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(b=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&(void 0!==S&&S.ActiveXObject?v=S.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(v=window.ActiveXObject)),"function"!=typeof(h=h||!e||b||v?h:e.default||e)&&(h=void 0);var O=function(e,t){if(t&&"object"===w(t)){var n,o="";for(n in t)o+="&"+encodeURIComponent(n)+"="+encodeURIComponent(t[n]);if(!o)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+o.slice(1)}return e},j=function(e,t,n,o){function r(t){if(!t.ok)return n(t.statusText||"Error",{status:t.status});t.text().then(function(e){n(null,{status:t.status,data:e})}).catch(n)}if(o){o=o(e,t);if(o instanceof Promise)return void o.then(r).catch(n)}("function"==typeof fetch?fetch:h)(e,t).then(r).catch(n)},P=!1;r.default=function(e,t,n,o){if("function"==typeof n&&(o=n,n=void 0),o=o||function(){},h&&0!==t.indexOf("file:")){var r=e,i=t,a=n,s=o,f=(r.queryStringParams&&(i=O(i,r.queryStringParams)),g({},"function"==typeof r.customHeaders?r.customHeaders():r.customHeaders)),u=("undefined"==typeof window&&void 0!==S&&void 0!==S.process&&S.process.versions&&S.process.versions.node&&(f["User-Agent"]="i18next-http-backend (node/".concat(S.process.version,"; ").concat(S.process.platform," ").concat(S.process.arch,")")),a&&(f["Content-Type"]="application/json"),"function"==typeof r.requestOptions?r.requestOptions(a):r.requestOptions),c=g({method:a?"POST":"GET",body:a?r.stringify(a):void 0,headers:f},P?{}:u),a="function"==typeof r.alternateFetch&&1<=r.alternateFetch.length?r.alternateFetch:void 0;try{j(i,c,s,a)}catch(e){if(!u||0===Object.keys(u).length||!e.message||e.message.indexOf("not implemented")<0)return s(e);try{Object.keys(u).forEach(function(e){delete c[e]}),j(i,c,s,a),P=!0}catch(e){s(e)}}}else if((0,m.hasXMLHttpRequest)()||"function"==typeof ActiveXObject){var f=e,r=t,u=n,l=o;u&&"object"===w(u)&&(u=O("",u).slice(1)),f.queryStringParams&&(r=O(r,f.queryStringParams));try{var d=b?new b:new v("MSXML2.XMLHTTP.3.0"),p=(d.open(u?"POST":"GET",r,1),f.crossDomain||d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.withCredentials=!!f.withCredentials,u&&d.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),d.overrideMimeType&&d.overrideMimeType("application/json"),f.customHeaders);if(p="function"==typeof p?p():p)for(var y in p)d.setRequestHeader(y,p[y]);d.onreadystatechange=function(){3e&&"function"==typeof e.then)(e))return e;return Promise.resolve(e)};var n=[],r=n.forEach,i=n.slice},{}],5:[function(e,t,n){},{}]},{},[2])(2)}); \ No newline at end of file diff --git a/demo/trunk/node_modules/i18next-http-backend/index.d.ts b/demo/trunk/node_modules/i18next-http-backend/index.d.ts index 6d47918d..ac5620c8 100644 --- a/demo/trunk/node_modules/i18next-http-backend/index.d.ts +++ b/demo/trunk/node_modules/i18next-http-backend/index.d.ts @@ -103,7 +103,7 @@ export interface HttpBackendOptions { requestOptions?: RequestInit | ((payload: {} | string) => RequestInit); } -type RequestCallback = (error: any, response: RequestResponse) => void; +type RequestCallback = (error: any | undefined | null, response: RequestResponse | undefined | null) => void; interface RequestResponse { status: number; diff --git a/demo/trunk/node_modules/i18next-http-backend/lib/index.js b/demo/trunk/node_modules/i18next-http-backend/lib/index.js index d1870100..b6494944 100644 --- a/demo/trunk/node_modules/i18next-http-backend/lib/index.js +++ b/demo/trunk/node_modules/i18next-http-backend/lib/index.js @@ -74,7 +74,7 @@ class Backend { this.options.request(this.options, url, payload, (err, res) => { if (res && ((res.status >= 500 && res.status < 600) || !res.status)) return callback('failed loading ' + url + '; status code: ' + res.status, true /* retry */) if (res && res.status >= 400 && res.status < 500) return callback('failed loading ' + url + '; status code: ' + res.status, false /* no retry */) - if (!res && err && err.message && err.message.indexOf('Failed to fetch') > -1) return callback('failed loading ' + url + ': ' + err.message, true /* retry */) + if (!res && err && err.message && (err.message.indexOf('Failed to fetch') > -1 || (err.message.indexOf('failed') > -1 && err.message.indexOf('fetch') > -1))) return callback('failed loading ' + url + ': ' + err.message, true /* retry */) if (err) return callback(err, false) let ret, parseErr diff --git a/demo/trunk/node_modules/i18next-http-backend/package.json b/demo/trunk/node_modules/i18next-http-backend/package.json index 3b734cd5..3dbffa2b 100644 --- a/demo/trunk/node_modules/i18next-http-backend/package.json +++ b/demo/trunk/node_modules/i18next-http-backend/package.json @@ -1,6 +1,6 @@ { "name": "i18next-http-backend", - "version": "2.5.2", + "version": "2.6.0", "private": false, "type": "module", "main": "./cjs/index.js", @@ -31,9 +31,9 @@ }, "types": "./index.d.mts", "devDependencies": { - "@babel/cli": "7.24.5", - "@babel/core": "7.24.5", - "@babel/preset-env": "7.24.5", + "@babel/cli": "7.24.8", + "@babel/core": "7.25.2", + "@babel/preset-env": "7.25.3", "babel-plugin-add-module-exports": "1.0.4", "browserify": "17.0.0", "dtslint": "4.2.1", @@ -45,14 +45,14 @@ "eslint-plugin-require-path-exists": "1.1.9", "eslint-plugin-standard": "5.0.0", "expect.js": "0.3.1", - "i18next": "23.11.4", + "i18next": "23.14.0", "json-server": "0.17.4", "json5": "2.2.3", - "mocha": "10.4.0", + "mocha": "10.7.3", "tslint": "5.20.1", - "tsd": "0.31.0", - "typescript": "5.4.5", - "uglify-js": "3.17.4", + "tsd": "0.31.1", + "typescript": "5.5.4", + "uglify-js": "3.19.2", "xmlhttprequest": "1.8.0" }, "description": "i18next-http-backend is a backend layer for i18next using in Node.js, in the browser and for Deno.", diff --git a/demo/trunk/package.json b/demo/trunk/package.json index b9deb61d..7986eeb1 100644 --- a/demo/trunk/package.json +++ b/demo/trunk/package.json @@ -18,7 +18,7 @@ "dwv": "0.33.1", "i18next": "~23.14.0", "i18next-browser-languagedetector": "~8.0.0", - "i18next-http-backend": "~2.5.0", + "i18next-http-backend": "~2.6.0", "jquery": "3.4.1" }, "devDependencies": { diff --git a/demo/trunk/yarn.lock b/demo/trunk/yarn.lock index 073992d7..571dc4a6 100644 --- a/demo/trunk/yarn.lock +++ b/demo/trunk/yarn.lock @@ -981,10 +981,10 @@ i18next-browser-languagedetector@~8.0.0: dependencies: "@babel/runtime" "^7.23.2" -i18next-http-backend@~2.5.0: - version "2.5.2" - resolved "https://registry.yarnpkg.com/i18next-http-backend/-/i18next-http-backend-2.5.2.tgz#3d846cc239987fe7700d1cf0f17975807bfd25d3" - integrity sha512-+K8HbDfrvc1/2X8jpb7RLhI9ZxBDpx3xogYkQwGKlWAUXLSEGXzgdt3EcUjLlBCdMwdQY+K+EUF6oh8oB6rwHw== +i18next-http-backend@~2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/i18next-http-backend/-/i18next-http-backend-2.6.0.tgz#e2a2bc391b129c17d4918e9574962df6dc130327" + integrity sha512-WX5pXYNrAz2fj8ajsAuCIsogOEvJL+aHw4RTQAD/uqPoLV1FHqa6IsUULTfa3GtREVQbApp0U3woLhz9EuR2pQ== dependencies: cross-fetch "4.0.0"