Releases: suhaotian/xior
Releases · suhaotian/xior
v0.6.1
v0.6.0
v0.5.5
Change
- Refactor:
content-type
detecting code improve and decrease size
Full Changelog: v0.5.4...v0.5.5
v0.5.4
v0.5.3
v0.5.2
- Fix(core): if params include
Date
value, call.toISOString()
and utilsencodeParams
support optionsallowDot: true
andarrayFormat: '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 } });
Full Changelog: v0.5.1...v0.5.2
v0.5.1
v0.5.0
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';
Thanks
Thanks @guoyunhe feedback 🙌!
Full Changelog: v0.4.3...v0.5.0
v0.4.3
- revert minor improvement(unnecessary)
Full Changelog: v0.4.2...v0.4.3
v0.4.2
- Feat(new plugin): add token refresh plugin
- Chore: Update README
- Refactor: minor improvement
Full Changelog: v0.4.1...v0.4.2