Socket
Socket
Sign inDemoInstall

xior

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xior - npm Package Versions

2345

0.6.1

Diff

Changelog

Source

v0.6.1

  • Fix: response interceptors should run only once with error-retry plugin
suhaotian
published 0.6.0 •

Changelog

Source

v0.6.0

  • Fix: response interceptors should run after plugins(Fix https://github.com/suhaotian/xior/issues/29)
suhaotian
published 0.5.5 •

Changelog

Source

v0.5.5

  • Refactor: content-type detecting code improve and decrease size
suhaotian
published 0.5.4 •

Changelog

Source

v0.5.4

  • feat(core): Support URLSearchParams Fix issues/26
suhaotian
published 0.5.3 •

Changelog

Source

v0.5.3

  • fix(core): RangeError: Invalid time value. ref issues/23
suhaotian
published 0.5.2 •

Changelog

Source

v0.5.2 2024/7/9

  • Fix(core): if params include Date value, call .toISOString() and utils encodeParams support options allowDot: true and arrayFormat: 'indices' | 'repeat' | 'brackets'(default is 'indices'). Fix issues/22 and issues/23

Code example:

import xior, { encodeParams } from 'xior';

const filter = {
  ids: [1, 2, 3],
  dateFrom: new Date(),
  dateTo: new Date(),
};

const http = xior.create({
  paramsSerializer: (params: any) =>
    encodeParams(params, true, null, {
      allowDots: false,
      arrayFormat: 'indices', // 'indices' | 'repeat' | 'brackets'
      serializeDate: (date) => date.toISOString(),
    }),
});

/* 
'indices': { a: ['b', 'c'] } -> 'a[0]=b&a[1]=c'
'brackets': { a: ['b', 'c'] } -> 'a[]=b&a[]=c'
'repeat': { a: ['b', 'c'] } -> 'a=b&a=c'
*/

http.get('https://example.com', { params: { filter } });
suhaotian
published 0.5.1 •

Changelog

Source

v0.5.1 2024/5/28

  • Feat(core): if request config withCredentials: true, before useless, now will set fetch config credentials: 'include'. Fix issues/19
suhaotian
published 0.5.0 •

Changelog

Source

v0.5.0 2024/5/19

This is a breaking change:

  • Feat(core): The xior class should be CapitalCase like: Xior. Fix issues/18

Migration

If you always use import xior from 'xior';, you can ignore migration code below.

Before:

import { xior } from 'xior';

Now:

import { Xior } from 'xior';
suhaotian
published 0.4.3 •

suhaotian
published 0.4.2 •

Changelog

Source

v0.4.2 2024/5/2

  • Feat(new plugin): add token refresh plugin
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc