Skip to content

Commit c17af34

Browse files
Fix variable error, fix correct build CSV
1 parent 7476724 commit c17af34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class UrlBuilder {
6868
public buildPathVariables(url: string, pathVariables: IPathVariables): string {
6969
Object.keys(pathVariables).forEach((_, index) => {
7070
const value = Object.values(pathVariables)[index]
71-
url = url.replace(/:([^\/]+)/gi, isReactive(value) ? (value as Ref).value : value.toString())
71+
url = url.replace(/:([^\/]+)/gi, isReactive(value) ? (value as Ref).value : value?.toString())
7272
})
7373
return url
7474
}
@@ -78,7 +78,7 @@ export class UrlBuilder {
7878
.map((key, index) => {
7979
const param = Object.values(queryParams)[index]
8080
if (param === null || param === undefined) return undefined
81-
if (typeof param === 'object') return this.buildCSV(key, param, disableCSV)
81+
if (param instanceof Array) return this.buildCSV(key, param, disableCSV)
8282
return `${key}=${param}`
8383
})
8484
.flat()

0 commit comments

Comments
 (0)