headers-polyfill
Advanced tools
Comparing version 4.0.0 to 4.0.1
{ | ||
"name": "headers-polyfill", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "A native \"Headers\" class polyfill.", | ||
@@ -43,2 +43,2 @@ "main": "./lib/index.js", | ||
} | ||
} | ||
} |
@@ -15,4 +15,2 @@ [![Published version](https://img.shields.io/npm/v/headers-polyfill.svg)](https://www.npmjs.com/package/headers-polyfill) | ||
npm install headers-polyfill | ||
# or | ||
yarn add headers-polyfill | ||
``` | ||
@@ -53,10 +51,8 @@ | ||
### Custom methods | ||
## Transformations | ||
In addition, the polyfill instance has the following methods: | ||
### `getRawHeaders()` | ||
- `.all()` | ||
Returns an object consisting of the header name/value pairs but preserving raw header names. | ||
Returns the object of the _normalized_ header name/value pairs. | ||
```js | ||
@@ -68,16 +64,2 @@ const headers = new Headers({ | ||
headers.all() | ||
// { "accept": "*/*", "content-type": "application/json" } | ||
``` | ||
- `.raw()` | ||
Similar to the `.all()` method, `.raw()` returns an object consisting of the header name/value pairs, but preserving raw header names. | ||
```js | ||
const headers = new Headers({ | ||
Accept: '*/*', | ||
'Content-Type': 'application/json', | ||
}) | ||
headers.raw() | ||
@@ -87,4 +69,2 @@ // { "Accept": "*/*", "Content-Type": "application/json" } | ||
## Transformations | ||
### Headers ⭢ N | ||
@@ -91,0 +71,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
133009
205