i18next-http-middleware
Advanced tools
Comparing version 3.0.6 to 3.1.0
@@ -0,1 +1,4 @@ | ||
## [v3.1.0](https://github.com/i18next/i18next-http-middleware/compare/v3.0.6...v3.1.0) | ||
- added types | ||
## [v3.0.6](https://github.com/i18next/i18next-http-middleware/compare/v3.0.5...v3.0.6) | ||
@@ -2,0 +5,0 @@ - ignoreCase option true by default |
@@ -93,3 +93,4 @@ "use strict"; | ||
var getBody = function getBody(req) { | ||
if (req.ctx && req.ctx.body) return req.ctx.body.bind(req.ctx); | ||
if (req.ctx && typeof req.ctx.body === 'function') return req.ctx.body.bind(req.ctx); | ||
if (req.ctx && req.ctx.body) return req.ctx.body; | ||
if (req.json) return req.json; | ||
@@ -96,0 +97,0 @@ if (req.body) return req.body; |
@@ -62,3 +62,4 @@ export var getPath = function getPath(req) { | ||
export var getBody = function getBody(req) { | ||
if (req.ctx && req.ctx.body) return req.ctx.body.bind(req.ctx); | ||
if (req.ctx && typeof req.ctx.body === 'function') return req.ctx.body.bind(req.ctx); | ||
if (req.ctx && req.ctx.body) return req.ctx.body; | ||
if (req.json) return req.json; | ||
@@ -65,0 +66,0 @@ if (req.body) return req.body; |
@@ -0,2 +1,3 @@ | ||
// // @deno-types='./index.d.ts' | ||
import mod from './lib/index.js' | ||
export default mod |
@@ -59,3 +59,4 @@ export const getPath = (req) => { | ||
export const getBody = (req) => { | ||
if (req.ctx && req.ctx.body) return req.ctx.body.bind(req.ctx) | ||
if (req.ctx && typeof req.ctx.body === 'function') return req.ctx.body.bind(req.ctx) | ||
if (req.ctx && req.ctx.body) return req.ctx.body | ||
if (req.json) return req.json | ||
@@ -62,0 +63,0 @@ if (req.body) return req.body |
@@ -34,3 +34,3 @@ import * as utils from './utils.js' | ||
const ignores = (options.ignoreRoutes instanceof Array && options.ignoreRoutes) || [] | ||
for (var i = 0; i < ignores.length; i++) { | ||
for (let i = 0; i < ignores.length; i++) { | ||
if (options.getPath(req).indexOf(ignores[i]) > -1) return next() | ||
@@ -171,3 +171,3 @@ } | ||
promise.then((b) => { | ||
for (var m in b) { | ||
for (const m in b) { | ||
i18next.services.backendConnector.saveMissing([lng], ns, m, b[m]) | ||
@@ -181,3 +181,3 @@ } | ||
for (var m in body) { | ||
for (const m in body) { | ||
i18next.services.backendConnector.saveMissing([lng], ns, m, body[m]) | ||
@@ -184,0 +184,0 @@ } |
@@ -25,3 +25,3 @@ export function setPath (object, path, newValue) { | ||
if (source) { | ||
for (var prop in source) { | ||
for (const prop in source) { | ||
if (obj[prop] === undefined) obj[prop] = source[prop] | ||
@@ -37,3 +37,3 @@ } | ||
if (source) { | ||
for (var prop in source) { | ||
for (const prop in source) { | ||
obj[prop] = source[prop] | ||
@@ -40,0 +40,0 @@ } |
{ | ||
"name": "i18next-http-middleware", | ||
"version": "3.0.6", | ||
"version": "3.1.0", | ||
"private": false, | ||
"type": "module", | ||
"main": "./cjs/index.js", | ||
"types": "./index.d.ts", | ||
"exports": { | ||
@@ -23,20 +24,22 @@ "./package.json": "./package.json", | ||
"devDependencies": { | ||
"@babel/cli": "7.10.5", | ||
"@babel/core": "7.11.4", | ||
"@babel/preset-env": "7.11.0", | ||
"babel-plugin-add-module-exports": "1.0.2", | ||
"eslint": "7.7.0", | ||
"eslint-config-standard": "14.1.1", | ||
"eslint-plugin-import": "2.22.0", | ||
"@babel/cli": "7.12.10", | ||
"@babel/core": "7.12.10", | ||
"@babel/preset-env": "7.12.11", | ||
"@types/express-serve-static-core": "^4.17.18", | ||
"babel-plugin-add-module-exports": "1.0.4", | ||
"eslint": "7.17.0", | ||
"eslint-config-standard": "16.0.2", | ||
"eslint-plugin-import": "2.22.1", | ||
"eslint-plugin-node": "11.1.0", | ||
"eslint-plugin-promise": "4.2.1", | ||
"eslint-plugin-require-path-exists": "1.1.9", | ||
"eslint-plugin-standard": "4.0.1", | ||
"eslint-plugin-standard": "5.0.0", | ||
"expect.js": "0.3.1", | ||
"express": "4.17.1", | ||
"fastify": "3.3.0", | ||
"i18next": "19.7.0", | ||
"mocha": "8.1.3", | ||
"supertest": "4.0.2", | ||
"uglify-js": "3.10.3" | ||
"fastify": "3.9.2", | ||
"i18next": "19.8.4", | ||
"mocha": "8.2.1", | ||
"supertest": "6.0.1", | ||
"tsd": "0.14.0", | ||
"uglify-js": "3.12.4" | ||
}, | ||
@@ -70,7 +73,11 @@ "description": "i18next-http-middleware is a middleware to be used with Node.js web frameworks like express or Fastify and also for Deno.", | ||
"build": "npm run compile", | ||
"test": "npm run lint && npm run build && mocha test -R spec --exit --experimental-modules", | ||
"test:deno": "deno test test/deno/*.js --allow-net --no-check", | ||
"test": "npm run lint && npm run build && mocha test -R spec --exit --experimental-modules && npm run test:types", | ||
"test:deno": "deno test --allow-net test/deno/*.js", | ||
"test:types": "tsd", | ||
"preversion": "npm run test && npm run build && git push", | ||
"postversion": "git push && git push --tags" | ||
}, | ||
"tsd": { | ||
"directory": "test/types" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
101010
34
2236
20