From 751edc1105c6f0f39e3e99a0db63ea0750a36c1b Mon Sep 17 00:00:00 2001 From: Adriano Raiano Date: Mon, 19 Dec 2022 23:05:39 +0100 Subject: [PATCH] fix for https://github.com/i18next/i18next/issues/1890 --- i18nextHttpBackend.js | 2 +- i18nextHttpBackend.min.js | 2 +- lib/index.js | 2 +- package.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/i18nextHttpBackend.js b/i18nextHttpBackend.js index 8a413e2..eaad36c 100644 --- a/i18nextHttpBackend.js +++ b/i18nextHttpBackend.js @@ -163,7 +163,7 @@ var Backend = function () { dataArray.push(data); resArray.push(res); if (finished === languages.length) { - if (callback) callback(dataArray, resArray); + if (typeof callback === 'function') callback(dataArray, resArray); } }); }); diff --git a/i18nextHttpBackend.min.js b/i18nextHttpBackend.min.js index 3bf8d6f..3100ac9 100644 --- a/i18nextHttpBackend.min.js +++ b/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(i,r,a){function s(t,e){if(!r[t]){if(!i[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=r[t]={exports:{}},i[t][0].call(n.exports,function(e){return s(i[t][1][e]||e)},n,n.exports,o,i,r,a)}return r[t].exports}for(var u="function"==typeof require&&require,e=0;e