Skip to content

Commit d5cf5e0

Browse files
authored
use crypto.randomUUID() (#5042)
* use crypto.randomUUID() instead of @lukeed/uuid - closes #4929 * changeset
1 parent ceef881 commit d5cf5e0

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.changeset/fast-islands-lick.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-svelte': patch
3+
---
4+
5+
Use crypto.randomUUID() instead of @lukeed/uuid

packages/create-svelte/templates/default/package.template.json

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"type": "module",
1717
"dependencies": {
1818
"@fontsource/fira-mono": "^4.5.0",
19-
"@lukeed/uuid": "^2.0.0",
2019
"cookie": "^0.4.1"
2120
}
2221
}

packages/create-svelte/templates/default/src/hooks.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { v4 as uuid } from '@lukeed/uuid';
21
import type { Handle } from '@sveltejs/kit';
32
import * as cookie from 'cookie';
43

54
/** @type {import('@sveltejs/kit').Handle} */
65
export const handle: Handle = async ({ event, resolve }) => {
76
const cookies = cookie.parse(event.request.headers.get('cookie') || '');
8-
event.locals.userid = cookies['userid'] || uuid();
7+
event.locals.userid = cookies['userid'] || crypto.randomUUID();
98

109
const response = await resolve(event);
1110

0 commit comments

Comments
 (0)