@torthu/jacketui-bring 0.2.0 → 0.2.2

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.
@@ -10,4 +10,4 @@ import { BringInitDecorator } from "../types/BringDecorator";
10
10
  * @param headers A record of headers to set or a Headers object.
11
11
  * @returns BringDecorator
12
12
  */
13
- export declare const headers: (headers: Record<string, string> | Headers) => BringInitDecorator;
13
+ export declare const headers: (headers: Record<string, string | number> | Headers) => BringInitDecorator;
@@ -1,4 +1,3 @@
1
- import { BringInitDecorator } from "../types/BringDecorator";
2
1
  import { BringInit } from "../types/BringInit";
3
2
  /** url(string | URL): BringInitDecorator
4
3
  *
@@ -9,4 +8,4 @@ import { BringInit } from "../types/BringInit";
9
8
  * @param url - URL to request.
10
9
  * @returns BringDecorator
11
10
  */
12
- export declare const url: (url: BringInit["url"]) => BringInitDecorator;
11
+ export declare const url: (url: BringInit["url"]) => ((init?: BringInit) => BringInit);
@@ -7,7 +7,7 @@
7
7
  * @param url - URL to request.
8
8
  * @returns BringDecorator
9
9
  */
10
- export const url = (url) => (init) => ({
10
+ export const url = (url) => (init = { url }) => ({
11
11
  ...init,
12
12
  url,
13
13
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@torthu/jacketui-bring",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Improved fetch API with retry, timeout, and more.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,7 +12,7 @@ import { BringInitDecorator } from "../types/BringDecorator";
12
12
  * @returns BringDecorator
13
13
  */
14
14
  export const headers = (
15
- headers: Record<string, string> | Headers
15
+ headers: Record<string, string | number> | Headers
16
16
  ): BringInitDecorator => {
17
17
  return (init) => {
18
18
  init.headers ??= new Headers();
@@ -11,8 +11,8 @@ import { BringInit } from "../types/BringInit";
11
11
  * @returns BringDecorator
12
12
  */
13
13
  export const url =
14
- (url: BringInit["url"]): BringInitDecorator =>
15
- (init) => ({
14
+ (url: BringInit["url"]): ((init?: BringInit) => BringInit) =>
15
+ (init = { url }) => ({
16
16
  ...init,
17
17
  url,
18
18
  });