Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed May 17, 2024
1 parent f44ad1d commit bf2e552
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 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)

### 2.5.1

- fix: remove typeof window.document === 'undefined' check which deopt bundle optimization [137](https://github.com/i18next/i18next-http-backend/pull/137)
Expand Down
12 changes: 6 additions & 6 deletions i18nextHttpBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
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 _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
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() {
return {
Expand Down Expand Up @@ -77,7 +77,7 @@ var Backend = function () {
this.type = 'backend';
this.init(services, options, allOptions);
}
_createClass(Backend, [{
return _createClass(Backend, [{
key: "init",
value: function init(services) {
var _this = this;
Expand All @@ -87,9 +87,10 @@ var Backend = function () {
this.options = _objectSpread(_objectSpread(_objectSpread({}, getDefaults()), this.options || {}), options);
this.allOptions = allOptions;
if (this.services && this.options.reloadInterval) {
setInterval(function () {
var timer = setInterval(function () {
return _this.reload();
}, this.options.reloadInterval);
if (_typeof(timer) === 'object' && typeof timer.unref === 'function') timer.unref();
}
}
}, {
Expand Down Expand Up @@ -207,7 +208,6 @@ var Backend = function () {
});
}
}]);
return Backend;
}();
Backend.type = 'backend';
var _default = exports.default = Backend;
Expand All @@ -223,11 +223,11 @@ exports.default = void 0;
var _utils = require("./utils.js");
var fetchNode = _interopRequireWildcard(require("./getFetch.js"));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
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 && Object.prototype.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 _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 _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
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); }
var fetchApi;
Expand Down
2 changes: 1 addition & 1 deletion i18nextHttpBackend.min.js

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ class Backend {
this.allOptions = allOptions
if (this.services && this.options.reloadInterval) {
const timer = setInterval(() => this.reload(), this.options.reloadInterval)
if (typeof timer === 'object') {
timer.unref()
}
if (typeof timer === 'object' && typeof timer.unref === 'function') timer.unref()
}
}

Expand Down
2 changes: 1 addition & 1 deletion licence
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023 i18next
Copyright (c) 2024 i18next

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
},
"types": "./index.d.mts",
"devDependencies": {
"@babel/cli": "7.23.9",
"@babel/core": "7.23.9",
"@babel/preset-env": "7.23.9",
"@babel/cli": "7.24.5",
"@babel/core": "7.24.5",
"@babel/preset-env": "7.24.5",
"babel-plugin-add-module-exports": "1.0.4",
"browserify": "17.0.0",
"dtslint": "4.2.1",
Expand All @@ -45,13 +45,13 @@
"eslint-plugin-require-path-exists": "1.1.9",
"eslint-plugin-standard": "5.0.0",
"expect.js": "0.3.1",
"i18next": "23.9.0",
"i18next": "23.11.4",
"json-server": "0.17.4",
"json5": "2.2.3",
"mocha": "10.3.0",
"mocha": "10.4.0",
"tslint": "5.20.1",
"tsd": "0.30.5",
"typescript": "5.3.3",
"tsd": "0.31.0",
"typescript": "5.4.5",
"uglify-js": "3.17.4",
"xmlhttprequest": "1.8.0"
},
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const server = (done) => {
if (js) return done(null, js)

js = jsonServer.create()
js.use((req, res, next)=> {
js.use((req, res, next) => {
// disable keep alive so the test server can close quickly.
res.setHeader('Connection', 'close')
next()
Expand Down

0 comments on commit bf2e552

Please sign in to comment.