Skip to content

Add TypeScript support #10

@pke

Description

@pke

I wonder how one could make this a little bit more type-safe by having the middleware actually know the types of the arguments and the supposed return value (Promose<Response>).

I have started with this:

// This should be exported by "fetch-wrap" as a type
type FetchFunction = typeof fetch

export function logHeaders() {
  return function(url: string, options:RequestInit = {}, fetch: FetchFunction):Promise<Response> {
  }
}

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