Unverified Commit a1e95898 authored by jaffar keikei's avatar jaffar keikei Committed by GitHub

fix(router): support BigInt in query parameters (#89213)

**What changed?**
`stringifyUrlQueryParam` now handles `bigint` type properly.

**Why?**
BigInt is a valid JavaScript primitive but was being converted to empty
string:

Before:
```js
stringifyUrlQueryParam(123n) // '' ❌
```

After:
```js
stringifyUrlQueryParam(123n) // '123' ✓
```

**Use case:**
Query parameters with large integers (IDs, timestamps) often use BigInt
to avoid precision loss.

**Testing**
Manual testing with BigInt values.
parent 16087898
......@@ -24,7 +24,8 @@ function stringifyUrlQueryParam(param: unknown): string {
if (
(typeof param === 'number' && !isNaN(param)) ||
typeof param === 'boolean'
typeof param === 'boolean' ||
typeof param === 'bigint'
) {
return String(param)
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment