We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 64f6711 commit 581647dCopy full SHA for 581647d
packages/notion-utils/src/parse-page-id.ts
@@ -12,13 +12,13 @@ const pageId2Re = /\b([\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12})\b/
12
* Defaults to returning a UUID (with dashes).
13
*/
14
export const parsePageId = (
15
- id: string | null = '',
+ id: string | undefined | null = '',
16
{ uuid = true }: { uuid?: boolean } = {}
17
-) => {
18
- if (!id) return null
+): string | undefined => {
+ if (!id) return
19
20
id = id.split('?')[0]!
21
22
23
const match = id.match(pageIdRe)
24
@@ -31,5 +31,5 @@ export const parsePageId = (
31
return uuid ? match2[1] : match2[1]!.replaceAll('-', '')
32
}
33
34
- return null
+ return
35
0 commit comments