Skip to content

Commit 4d73161

Browse files
committed
Simplify serialize
1 parent d814801 commit 4d73161

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/lib/params-serializer.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,10 @@ export const paramsSerializer: CustomParamsSerializer = (params) => {
2828
}
2929

3030
const serialize = (k: string, v: unknown): string => {
31-
if (v == null) {
32-
throw new UnserializableParamError(k, `is ${v} or contains ${v}`)
33-
}
34-
35-
if (typeof v === 'function') {
36-
throw new UnserializableParamError(
37-
k,
38-
'is a function or contains a function',
39-
)
40-
}
41-
42-
if (typeof v === 'object') {
43-
throw new UnserializableParamError(k, 'is an object or contains an object')
44-
}
45-
46-
if (typeof v === 'symbol') {
47-
throw new UnserializableParamError(k, 'is a symbol')
48-
}
49-
5031
if (typeof v === 'string') return v.toString()
5132
if (typeof v === 'number') return v.toString()
5233
if (typeof v === 'bigint') return v.toString()
5334
if (typeof v === 'boolean') return v.toString()
54-
5535
throw new UnserializableParamError(k, `is a ${typeof v}`)
5636
}
5737

0 commit comments

Comments
 (0)