Skip to content

[Types] ICookie get and getAll() could benefit from generics #160

@randompch

Description

@randompch

Hi everyone,

ICookie could benefit from generics as its cousin cookie-universal-nuxt does.

Not a big deal but right now I'm forced to extend ICookie within my project, so having it native would be much better 💪

import type { ICookie, ICookieGetOpts } from 'cookie-universal';

export interface CookieExtended extends ICookie {
  get<T = any>(name: string, options?: ICookieGetOpts): T;
  getAll<T = object>(options?: ICookieGetOpts): T;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions