fetch-addons
Advanced tools
Comparing version 1.0.2 to 1.1.0
import { getRequest } from './request.js'; | ||
export function deleteEmptyHeaders(headers) { | ||
// Can't do it in the headers.forEach loop, see https://twitter.com/meijer_s/status/1676506116736397312 | ||
[...headers.entries()].forEach(([key, value]) => { | ||
for (const [key, value] of [...headers]) { | ||
if (value && value !== 'undefined' && value !== 'null') | ||
return; | ||
continue; | ||
headers.delete(key); | ||
}); | ||
} | ||
} | ||
@@ -10,0 +10,0 @@ export function getHeaders(headersOrInput, init) { |
{ | ||
"name": "fetch-addons", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "A collection of addons for the fetch API", | ||
@@ -15,10 +15,11 @@ "license": "MIT", | ||
"types": "./dist/index.d.ts", | ||
"main": "./dist/index.js", | ||
"main": "./dist/index.cjs", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.cjs" | ||
}, | ||
"./*.js": { | ||
"default": "./dist/*.js", | ||
"import": "./dist/*.js", | ||
"types": "./dist/*.d.ts" | ||
@@ -32,3 +33,4 @@ } | ||
"test": "prettier -w . && eslint . --fix && jest", | ||
"build": "rimraf ./dist && tsc -p tsconfig.build.json", | ||
"build": "rimraf ./dist && tsc -p tsconfig.build.json && npm run build:cjs", | ||
"build:cjs": "esbuild src/index.ts --bundle --outfile=dist/index.cjs --format=cjs --platform=node", | ||
"prepare": "npm run build" | ||
@@ -53,2 +55,3 @@ }, | ||
"@types/jest": "^29.5.2", | ||
"esbuild": "^0.18.11", | ||
"jest": "^29.5.0", | ||
@@ -55,0 +58,0 @@ "rimraf": "^5.0.1", |
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
8243
12
108
9