i18next / i18next-http-backend

i18next-http-backend is a backend layer for i18next using in Node.js, in the browser and for Deno.
MIT License
452 stars 70 forks source link

added fetch interceptor to the Backend Options #133

Closed jacobbogers closed 9 months ago

jacobbogers commented 9 months ago

added fetch interceptor to the Backend Options

{
  //
  // Use an alternative fetch function that acts like an interecept, (usefull for low level mocks/simulations)
  // 
  // This option is not called if:
  // 
  // 1. There is an custom value set for the "request" property in this options object.
  // 2. The backend selected xmlHttpRequest over fetch
  // 
  // If the function is called and it returns anything BUT a promise the fetch or xmlHttpRequest will be
  // subsequentially called
  // 
  // The signature is a specialisation of the native fetch function: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
  //
  alternateFetch?: function(input: string, init: RequestInit): Promise<Response> | void,
socket-security[bot] commented 9 months ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@babel/cli@7.23.0 Transitive: environment, eval, filesystem, network, shell, unsafe +85 12.5 MB nicolo-ribaudo
npm/@babel/core@7.23.3 environment, filesystem, unsafe Transitive: shell +52 10.8 MB nicolo-ribaudo
npm/@babel/preset-env@7.23.3 environment Transitive: filesystem, shell, unsafe +161 14.9 MB nicolo-ribaudo
npm/babel-plugin-add-module-exports@1.0.4 None 0 21.8 kB ljharb
npm/browserify@17.0.0 filesystem, network, unsafe Transitive: environment, eval +153 6.95 MB goto-bus-stop
npm/cross-fetch@4.0.0 network +4 581 kB lquixada
npm/dtslint@4.2.1 filesystem Transitive: environment, eval, network, shell +211 467 MB types
npm/eslint-config-standard@17.1.0 Transitive: environment, eval, filesystem, shell, unsafe +186 17.1 MB voxpelli
npm/eslint-plugin-import@2.29.0 filesystem, unsafe Transitive: environment, eval, shell +175 16.1 MB ljharb
npm/eslint-plugin-n@16.3.1 filesystem Transitive: environment, eval, shell, unsafe +106 11.7 MB weiran.zsd
npm/eslint-plugin-promise@6.1.1 Transitive: environment, eval, filesystem, shell, unsafe +92 10.7 MB eslint-community-bot
npm/eslint-plugin-require-path-exists@1.1.9 environment, filesystem, shell Transitive: eval, unsafe +25 1.66 MB bohdantkachenko
npm/eslint-plugin-standard@5.0.0 Transitive: environment, eval, filesystem, shell, unsafe +92 10.6 MB feross
npm/eslint@8.53.0 environment, filesystem Transitive: eval, shell, unsafe +91 10.6 MB eslintbot
npm/expect.js@0.3.1 None 0 44.6 kB rauchg
npm/i18next@23.7.1 None +2 875 kB adrai
npm/json-server@0.17.4 environment, filesystem Transitive: eval, network, unsafe +99 4.24 MB typicode
npm/mocha@10.2.0 environment, eval, filesystem +66 4.6 MB juergba
npm/tsd@0.29.0 Transitive: environment, filesystem +113 2.72 MB sindresorhus
npm/tslint@5.20.1 filesystem Transitive: environment, eval +39 44.6 MB palantir
npm/typescript@5.2.2 None 0 40.6 MB typescript-bot
npm/uglify-js@3.17.4 environment, eval, filesystem 0 1.28 MB alexlamsl
npm/xmlhttprequest@1.8.0 filesystem, network, shell 0 21.7 kB driverdan

🚮 Removed packages: npm/@types/jasmine@3.6.11, npm/@types/node@12.20.55, npm/angular-i18next@10.2.0, npm/i18next-browser-languagedetector@6.1.1, npm/i18next-http-backend@1.2.6, npm/i18next@20.3.1, npm/jasmine-core@3.7.1, npm/karma-chrome-launcher@3.1.1, npm/karma-coverage@2.0.3, npm/karma-jasmine-html-reporter@1.7.0, npm/karma-jasmine@4.0.2, npm/karma@6.3.20

View full report↗︎

adrai commented 9 months ago

like already asked here: https://github.com/i18next/i18next-http-backend/issues/132#issuecomment-1955067847 Why isn't this an option for you?

jacobbogers commented 9 months ago

Thanks, I did not bump the version though, I though that would be a thing best left to you to publish it,

Thanks for the merge @adrai

adrai commented 9 months ago

included in v2.5.0