Git Product home page Git Product logo

Comments (5)

AntoineKM avatar AntoineKM commented on April 28, 2024 1

Hey @coler-j, if you want to use typescript with this package you should use @types/cookie-parser

from cookie-parser.

dougwilson avatar dougwilson commented on April 28, 2024

Hi, and sorry you are having an issue. I'm not familiar enough with typescript to help you, but maybe someone who knows will wonder by to help.

from cookie-parser.

SannanOfficial avatar SannanOfficial commented on April 28, 2024

Hey @coler-j, if you want to use typescript with this package you should use @types/cookie-parser

Works well, I think we can close the issue here.

from cookie-parser.

adamwozhere avatar adamwozhere commented on April 28, 2024

Hey @coler-j, if you want to use typescript with this package you should use @types/cookie-parser

Works well, I think we can close the issue here.

I have also had a similar issue to @coler-j -- If I try to access cookies with const { cookies } = req; @typescript/eslint errors: Unsafe array destructuring of a tuple element with an "any" value. I'm using @types/cookie-parser but this doesn't seem to change anything, req.cookies is still of type 'any'.

I could be missing something but there is no type definition for cookies on the Request object? -- shouldn't cookies be typed as:

interface Request {
    cookies?: { [key: string]: string };
}

could that be added along with the secret?: string; property?

from cookie-parser.

dougwilson avatar dougwilson commented on April 28, 2024

Sorry this is still open. Issues about the typings should be filed over at https://github.com/DefinitelyTyped/DefinitelyTyped

from cookie-parser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.