@fuman/fetch 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/addons/_utils.cjs +1 -0
- package/addons/_utils.js +1 -0
- package/ffetch.d.cts +3 -3
- package/ffetch.d.ts +3 -3
- package/index.d.cts +1 -1
- package/index.d.ts +1 -1
- package/package.json +2 -2
package/addons/_utils.cjs
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
function urlencode(query) {
|
|
4
4
|
const search = new URLSearchParams();
|
|
5
5
|
for (const [key, value] of Object.entries(query)) {
|
|
6
|
+
if (value == null) continue;
|
|
6
7
|
if (Array.isArray(value)) {
|
|
7
8
|
for (let i = 0; i < value.length; i++) {
|
|
8
9
|
search.append(key, String(value[i]));
|
package/addons/_utils.js
CHANGED
package/ffetch.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CombineAddons, FfetchMiddleware } from './_types.js';
|
|
1
|
+
import { CombineAddons, FetchLike, FfetchMiddleware } from './_types.js';
|
|
2
2
|
import { FfetchAddon } from './addons/types.js';
|
|
3
3
|
export interface FfetchOptions {
|
|
4
4
|
/**
|
|
@@ -55,7 +55,7 @@ export interface FfetchOptions {
|
|
|
55
55
|
*/
|
|
56
56
|
baseUrl?: string;
|
|
57
57
|
/** body to be passed to fetch() */
|
|
58
|
-
body?: BodyInit;
|
|
58
|
+
body?: BodyInit | Uint8Array;
|
|
59
59
|
/**
|
|
60
60
|
* shorthand for sending json body.
|
|
61
61
|
* mutually exclusive with `body`
|
|
@@ -70,7 +70,7 @@ export interface FfetchOptions {
|
|
|
70
70
|
}
|
|
71
71
|
export interface FfetchBaseOptions<Addons extends FfetchAddon<any, any>[] = FfetchAddon<any, any>[]> extends FfetchOptions {
|
|
72
72
|
/** implementation of fetch() */
|
|
73
|
-
fetch?:
|
|
73
|
+
fetch?: FetchLike;
|
|
74
74
|
/** addons for the request */
|
|
75
75
|
addons?: Addons;
|
|
76
76
|
/**
|
package/ffetch.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CombineAddons, FfetchMiddleware } from './_types.js';
|
|
1
|
+
import { CombineAddons, FetchLike, FfetchMiddleware } from './_types.js';
|
|
2
2
|
import { FfetchAddon } from './addons/types.js';
|
|
3
3
|
export interface FfetchOptions {
|
|
4
4
|
/**
|
|
@@ -55,7 +55,7 @@ export interface FfetchOptions {
|
|
|
55
55
|
*/
|
|
56
56
|
baseUrl?: string;
|
|
57
57
|
/** body to be passed to fetch() */
|
|
58
|
-
body?: BodyInit;
|
|
58
|
+
body?: BodyInit | Uint8Array;
|
|
59
59
|
/**
|
|
60
60
|
* shorthand for sending json body.
|
|
61
61
|
* mutually exclusive with `body`
|
|
@@ -70,7 +70,7 @@ export interface FfetchOptions {
|
|
|
70
70
|
}
|
|
71
71
|
export interface FfetchBaseOptions<Addons extends FfetchAddon<any, any>[] = FfetchAddon<any, any>[]> extends FfetchOptions {
|
|
72
72
|
/** implementation of fetch() */
|
|
73
|
-
fetch?:
|
|
73
|
+
fetch?: FetchLike;
|
|
74
74
|
/** addons for the request */
|
|
75
75
|
addons?: Addons;
|
|
76
76
|
/**
|
package/index.d.cts
CHANGED
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuman/fetch",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"description": "tiny wrapper over fetch",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@fuman/utils": "^0.0.
|
|
8
|
+
"@fuman/utils": "^0.0.17",
|
|
9
9
|
"@standard-schema/spec": "^1.0.0"
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|