splitbee / notion-api-worker

Notion as CMS with easy API access
MIT License
1.56k stars 197 forks source link

fix: use slice instead of substr(deprecated) #73

Closed youngjae99 closed 3 months ago

youngjae99 commented 2 years ago

Resolves https://github.com/splitbee/notion-api-worker/issues/72

tobiaslins commented 3 months ago

unfortunately slice can't be used like substr but I just fixed the fn now.

export const idToUuid = (path: string): string =>
  `${path.slice(0, 8)}-${path.slice(8, 12)}-${path.slice(12, 16)}-${path.slice(16, 20)}-${path.slice(20)}`;