mirror of
https://github.com/reiyua/github-profile-trophy-reiyua-mirror.git
synced 2026-11-17 06:02:09 +11:00
Add getBooleanValue
This commit is contained in:
parent
af12ef61f5
commit
ea4ba8aeac
1 changed files with 7 additions and 0 deletions
|
|
@ -28,6 +28,13 @@ export class CustomURLSearchParams extends URLSearchParams {
|
||||||
}
|
}
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
|
getBooleanValue(key: string, defaultValue: boolean): boolean {
|
||||||
|
if (super.has(key)) {
|
||||||
|
const param = super.get(key);
|
||||||
|
return param !== null && param.toString() === 'true';
|
||||||
|
}
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parseParams(req: ServerRequest): CustomURLSearchParams {
|
export function parseParams(req: ServerRequest): CustomURLSearchParams {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue