diff --git a/package.json b/package.json index d3e0889..d4ae302 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@brainylab/fetch-wrapper", - "version": "0.5.4", + "version": "0.5.5", "keywords": [ "fetch", "wrapper", diff --git a/src/lib/fetch-wrapper.ts b/src/lib/fetch-wrapper.ts index 29c3920..22181c4 100644 --- a/src/lib/fetch-wrapper.ts +++ b/src/lib/fetch-wrapper.ts @@ -4,6 +4,7 @@ import { createPath } from '../utils/create-path'; import { mergeConfigs } from '../utils/merge-configs'; import { objectToUrlParams } from '../utils/object-to-url-params'; +import type { ObjectToUrl } from '../utils/object-to-url-params'; import type { FetchWrapperProps } from './create-instance'; export type FwprInterceptors = { @@ -17,7 +18,7 @@ export type FetchWrapperDefaults = { interceptors?: FwprInterceptors; }; type FetchWrapperInit = RequestInit & { - params?: Record; + params?: ObjectToUrl; }; type FetchWrapperResponse = { diff --git a/src/utils/object-to-url-params.ts b/src/utils/object-to-url-params.ts index c2c6f8e..f40231f 100644 --- a/src/utils/object-to-url-params.ts +++ b/src/utils/object-to-url-params.ts @@ -1,6 +1,6 @@ -type ObjectToUrl = Record< +export type ObjectToUrl = Record< string, - string | number | string[] | number[] | undefined | null + string | number | string[] | number[] | boolean | undefined | null >; function cleanObject(obj: ObjectToUrl): ObjectToUrl {