Make ts not scream
This commit is contained in:
@ -3,13 +3,15 @@ export async function onRequest(context: RequestContext) {
|
||||
|
||||
if (!cookies) return await context.next();
|
||||
|
||||
const cookieList = cookies.split("; ").map((cookie) => {
|
||||
const cookieList = cookies.split("; ").map((cookie: string) => {
|
||||
const [name, value] = cookie.split("=");
|
||||
|
||||
return { name, value };
|
||||
});
|
||||
|
||||
const transferId = cookieList.find((cookie) => cookie.name === "__dtid");
|
||||
const transferId = cookieList.find(
|
||||
(cookie: { name: string; value: string }) => cookie.name === "__dtid",
|
||||
);
|
||||
|
||||
if (transferId) context.data.data_transfer_id = transferId;
|
||||
|
||||
|
Reference in New Issue
Block a user