JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7990
  • Score
    100M100P100Q170208F
  • License MIT

fetch Headers polyfill

Package Exports

  • fetch-headers

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fetch-headers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Fetch headers polyfill

https://developer.mozilla.org/en-US/docs/Web/API/Headers

Packed with latest and newest method from the spec: iterator, entries, keys, values, and support of for...of

const Headers = require('fetch-headers')

header = new Headers([
  ['accept', 'application/json']
  ['accept', 'text/plain']
])

Notes

This use

  • WeakMap for private properties
  • Symbol.iterator for iteration
  • vanilla ecmascript 6
  • no transpiler
  • no coffeescript or typescript

Up to date node version can just use this as is. (tested in v6.5.0)
Browsers should run this through closer-compiler, babel, Babili, browserify, webpack or equivalent.
Browsers need to include a polyfill for WeakMap if necessary.