@worker-tools/response-creators
Advanced tools
Comparing version 1.0.8 to 1.2.0-pre.1
{ | ||
"module": "./esm/index.js", | ||
"main": "./script/index.js", | ||
"types": "./types/index.d.ts", | ||
"name": "@worker-tools/response-creators", | ||
"version": "1.0.8", | ||
"description": "Helper functions to create Fetch API Response objects based on HTTP status codes", | ||
"type": "module", | ||
"main": "index.js", | ||
"module": "index.js", | ||
"types": "index.d.ts", | ||
"exports": { | ||
".": "./index.js" | ||
}, | ||
"files": [ | ||
"typings", | ||
"src", | ||
"*.js*", | ||
"*.d.ts*" | ||
], | ||
"version": "1.2.0-pre.1", | ||
"description": "A collection of factory functions for Fetch API Response types with pre-filled status and status-text headers for well-known HTTP status codes.", | ||
"license": "MIT", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"clean": "rm -f *.d.ts *.js *.js.map *.d.ts.map", | ||
"test": "echo \"Error: no test specified\" && exit 0", | ||
"build": "tsc -d", | ||
"prepack": "npm run clean && npm run build" | ||
}, | ||
"author": "Florian Klampfer <mail@qwtel.com> (https://qwtel.com/)", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"typescript": "^4.0.3" | ||
}, | ||
"repository": { | ||
@@ -39,11 +20,20 @@ "type": "git", | ||
}, | ||
"homepage": "https://github.com/worker-tools/response-creators#readme", | ||
"homepage": "", | ||
"keywords": [ | ||
"workers", | ||
"cloudflare-workers", | ||
"fetch-api", | ||
"http-status-codes", | ||
"response", | ||
"service-workers", | ||
"fetch-api", | ||
"http-status-codes", | ||
"cloudflare-workers" | ||
] | ||
} | ||
"workers" | ||
], | ||
"exports": { | ||
".": { | ||
"import": "./esm/index.js", | ||
"require": "./script/index.js", | ||
"types": "./types/index.d.ts" | ||
} | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": {} | ||
} |
export type RequestInitExStatus = Omit<RequestInit, 'status' | 'statusText'>; | ||
const mkResponse = (status: number, statusText: string) => (body: BodyInit = null, init: RequestInitExStatus = {}) => new Response(body, { | ||
const mkResponse = (status: number, statusText: string) => (body: BodyInit | null = null, init: RequestInitExStatus = {}) => new Response(body, { | ||
...init, | ||
@@ -19,3 +19,3 @@ status, | ||
const mkUnauthorized = (status: number, statusText: string) => (realm: string = '', init: RequestInitExStatus = {}) => new Response(null, { | ||
const mkUnauthorized = (status: number, statusText: string) => (realm = '', init: RequestInitExStatus = {}) => new Response(null, { | ||
...init, | ||
@@ -22,0 +22,0 @@ status, |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
36344
0
337
2
1
No