fix: 统一代码格式

pull/235/head
xingyu4j 2025-10-21 14:34:05 +08:00
parent 7f7f7cda2b
commit e5d69952cb
1 changed files with 6 additions and 6 deletions

View File

@ -48,23 +48,23 @@ export function getNestedValue<T>(obj: T, path: string): any {
* @param key * @param key
* @param urlStr * @param urlStr
*/ */
export const getUrlNumberValue = ( export function getUrlNumberValue(
key: string, key: string,
urlStr: string = location.href, urlStr: string = location.href,
): number => { ): number {
return Number(getUrlValue(key, urlStr)); return Number(getUrlValue(key, urlStr));
}; }
/** /**
* *
* @param key * @param key
* @param urlStr * @param urlStr
*/ */
export const getUrlValue = ( export function getUrlValue(
key: string, key: string,
urlStr: string = location.href, urlStr: string = location.href,
): string => { ): string {
if (!urlStr || !key) return ''; if (!urlStr || !key) return '';
const url = new URL(decodeURIComponent(urlStr)); const url = new URL(decodeURIComponent(urlStr));
return url.searchParams.get(key) ?? ''; return url.searchParams.get(key) ?? '';
}; }