kwhitley / itty-router

A little router.
MIT License
1.7k stars 77 forks source link

fixes #175 by allowing full options inclusion in status and fixing types in createResponse #176

Closed kwhitley closed 1 year ago

kwhitley commented 1 year ago

Description

  1. New signature for status takes full ResponseInit options as second param:

    status = (status: number, options?: ResponseInit): Response
  2. Changed ResponseFormatter internal type for createResponse to be more helpful in downstream uses (e.g. json)

    interface ResponseFormatter {
      (body?: any, options?: ResponseInit): Response
    }

Issue Related

See #175

TODO