From 5de4267ec68f2ec33d7522fb5c9eb406a7debc05 Mon Sep 17 00:00:00 2001 From: Andres Morey Date: Sun, 22 Sep 2024 16:04:00 +0300 Subject: [PATCH] fixed linting errors --- shared/src/util.test.ts | 2 +- shared/src/util.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/src/util.test.ts b/shared/src/util.test.ts index 9947f58..09bcd79 100644 --- a/shared/src/util.test.ts +++ b/shared/src/util.test.ts @@ -109,7 +109,7 @@ describe('getTokenString', () => { expect(tokenStr).toEqual('my-token'); }); - it('gets token from custom field name', async() => { + it('gets token from custom field name', async () => { const formData = new FormData(); formData.set('file', new Blob(['xxx']), 'filename'); formData.set('csrfToken', 'my-token'); diff --git a/shared/src/util.ts b/shared/src/util.ts index 2d57890..e00acd6 100644 --- a/shared/src/util.ts +++ b/shared/src/util.ts @@ -68,7 +68,7 @@ export async function getTokenString(request: Request, tokenOpts: TokenOptions = const token = request.headers.get('x-csrf-token'); if (token !== null) return token; - const fieldName = tokenOpts.fieldName; + const { fieldName } = tokenOpts; // check request body const contentType = request.headers.get('content-type') || 'text/plain';