Closed colinbendell closed 4 years ago
@grantila what's the process for review and get the patch landed?
I would say the SAN and Headers changes should be separate, but I'm not sure what the actual problem is with the Headers as they are. They follow exactly https://developer.mozilla.org/en-US/docs/Web/API/Headers/Headers so that browser code running in Node.js can expect the very same behavior.
I made Headers look like Map
to unit test frameworks (at least this works in Jest) in a less intrusive way.
Sorry, the san issue wasn't supposed to merge into this PR.
The issue with Headers is that you're doing a lot of work to mimic Map functionality I would argue that treating it as a Map<string, string> is a simpler design and has better language consistency leading to better developer ergonomics for those adopting this library. The only reason that fetch doesn't explicitly define Headers as extending Map is because of the age of the spec.
:tada: This issue has been resolved in version 2.3.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
the Headers object should extend Map() so that standard mocha/chai specs treat this as a Map and utilise the standard methods