New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@whatwg-node/server

Package Overview
Dependencies
Maintainers
1
Versions
736
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@whatwg-node/server - npm Package Compare versions

Comparing version 0.4.0-alpha-20220916163145-ea58ba1 to 0.4.0-alpha-20220916163416-8c6abfa

4

index.js

@@ -264,3 +264,5 @@ 'use strict';

has: (_, prop) => {
return prop in adapterObj || prop in genericRequestHandler || (serverAdapterBaseObject && prop in serverAdapterBaseObject);
return (prop in adapterObj ||
prop in genericRequestHandler ||
(serverAdapterBaseObject && prop in serverAdapterBaseObject));
},

@@ -267,0 +269,0 @@ get: (_, prop) => {

{
"name": "@whatwg-node/server",
"version": "0.4.0-alpha-20220916163145-ea58ba1",
"version": "0.4.0-alpha-20220916163416-8c6abfa",
"description": "Fetch API compliant HTTP Server adapter",

@@ -5,0 +5,0 @@ "sideEffects": false,

@@ -16,3 +16,3 @@ # WHATWG Node Generic Server Adapter

export default createServerAdapter((request: Request) => {
return new Response(`Hello World!`, { status: 200 })
return new Response(`Hello World!`, { status: 200 })
})

@@ -206,18 +206,18 @@ ```

const myServerAdapter = createServerAdapter(async request => {
// Parse the request as `FormData`
const formData = await request.formData()
// Select the file
const file = formData.get('file')
// Process it as a string
const fileTextContent = await file.text()
// Select the other text parameter
const regularTextData = formData.get('additionalStuff')
// ...
return new Response('{ "message": "ok" }', {
status: 200,
headers: {
'Content-Type': 'application/json'
}
})
// Parse the request as `FormData`
const formData = await request.formData()
// Select the file
const file = formData.get('file')
// Process it as a string
const fileTextContent = await file.text()
// Select the other text parameter
const regularTextData = formData.get('additionalStuff')
// ...
return new Response('{ "message": "ok" }', {
status: 200,
headers: {
'Content-Type': 'application/json'
}
})
})
```

@@ -224,0 +224,0 @@

Sorry, the diff of this file is not supported yet

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