Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Nov 1, 2024
1 parent 2745c39 commit 90512a4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/react-notion-x/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,20 @@ export const getYoutubeId = (url: string): string | null => {
return null
}

export const getUrlParams = (url: string): Record<string, string> | null => {
export const getUrlParams = (
url: string
): Record<string, string> | undefined => {
try {
const { searchParams } = new URL(url)
const result: Record<string, string> = {}
searchParams.forEach((value, key) => {
for (const [key, value] of searchParams.entries()) {
result[key] = value
})
}

return result
} catch {
// ignore invalid urls
}

return null
return
}

0 comments on commit 90512a4

Please sign in to comment.