Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@worker-tools/response-creators

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@worker-tools/response-creators - npm Package Compare versions

Comparing version 1.0.8 to 1.2.0-pre.1

esm/index.js

54

package.json
{
"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,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc