File tree 3 files changed +6
-3
lines changed
packages/create-svelte/templates/default
3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' create-svelte ' : patch
3
+ ---
4
+
5
+ Use crypto.randomUUID() instead of @lukeed/uuid
Original file line number Diff line number Diff line change 16
16
"type" : " module" ,
17
17
"dependencies" : {
18
18
"@fontsource/fira-mono" : " ^4.5.0" ,
19
- "@lukeed/uuid" : " ^2.0.0" ,
20
19
"cookie" : " ^0.4.1"
21
20
}
22
21
}
Original file line number Diff line number Diff line change 1
- import { v4 as uuid } from '@lukeed/uuid' ;
2
1
import type { Handle } from '@sveltejs/kit' ;
3
2
import * as cookie from 'cookie' ;
4
3
5
4
/** @type {import('@sveltejs/kit').Handle } */
6
5
export const handle : Handle = async ( { event, resolve } ) => {
7
6
const cookies = cookie . parse ( event . request . headers . get ( 'cookie' ) || '' ) ;
8
- event . locals . userid = cookies [ 'userid' ] || uuid ( ) ;
7
+ event . locals . userid = cookies [ 'userid' ] || crypto . randomUUID ( ) ;
9
8
10
9
const response = await resolve ( event ) ;
11
10
You can’t perform that action at this time.
0 commit comments