From 3fbad8c04bb9a2e3438d5000de0c49ddc469536a Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Thu, 24 Nov 2022 15:00:11 +0100 Subject: [PATCH] fix: fix `QueryValue` type to be array only as `QueryObject` values (#101) --- src/query.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/query.ts b/src/query.ts index 277d8f4a..eb808dc0 100644 --- a/src/query.ts +++ b/src/query.ts @@ -5,8 +5,8 @@ import { encodeQueryValue } from "./encoding"; -export type QueryValue = string | string[] | undefined | null -export type QueryObject = Record +export type QueryValue = string | undefined | null +export type QueryObject = Record export function parseQuery (parametersString: string = ""): QueryObject { const object: QueryObject = {}; @@ -34,7 +34,7 @@ export function parseQuery (parametersString: string = ""): QueryObject { return object; } -export function encodeQueryItem (key: string, value: QueryValue): string { +export function encodeQueryItem (key: string, value: QueryValue | QueryValue[]): string { if (typeof value === "number" || typeof value === "boolean") { value = String(value); }