Transform header fields into a properly formatted string, with lowercase characters and hyphens.
npm install header-field
import { normalize } from "header-field";
normalize("content-type"); //-> "content-type"
normalize("content-Length"); //-> "content-length"
normalize("Content-Disposition"); //-> "content-disposition"
// Special case: referrer -> referer.
normalize("Referrer"); //-> "referer"
- Use
npm test
to build and run tests.
Please feel free to create a PR!