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

@tinyhttp/req

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinyhttp/req - npm Package Compare versions

Comparing version 0.1.1 to 0.1.4

21

CHANGELOG.md
# @tinyhttp/req
## 0.1.4
### Patch Changes
- Fix broken release
- Updated dependencies [undefined]
- @tinyhttp/accepts@0.0.22
## 0.1.3
### Patch Changes
- Updated dependencies [undefined]
- @tinyhttp/accepts@0.1.2
## 0.1.2
### Patch Changes
- add res.redirect and res.format, transfer es-accepts to @tinyhttp/accepts
## 0.1.1

@@ -4,0 +25,0 @@

5

dist/index.js
import parseRange from 'range-parser';
import fresh from 'es-fresh';
import Accepts from 'es-accepts';
import { Accepts } from '@tinyhttp/accepts';

@@ -41,5 +41,6 @@ const getRequestHeader = (req) => (header) => {

const getAccepts = (req) => (...types) => {
return new Accepts(req).types(types);
const accepts = new Accepts(req);
return accepts.types(types);
};
export { checkIfXMLHttpRequest, getAccepts, getFreshOrStale, getRangeFromHeader, getRequestHeader };

92

package.json
{
"name": "@tinyhttp/req",
"version": "0.1.1",
"type": "module",
"description": "request extensions for tinyhttp",
"homepage": "https://github.com/talentlessguy/tinyhttp#readme",
"repository": {
"type": "git",
"url": "https://github.com/talentlessguy/tinyhttp.git",
"directory": "packages/req"
},
"main": "dist/index.cjs",
"types": "dist/index.d.ts",
"module": "dist/index.js",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"./package.json": "./package.json",
"./": "./"
},
"keywords": [
"tinyhttp",
"node.js",
"web framework",
"web",
"backend",
"req",
"request"
],
"engines": {
"node": ">=12.4.0"
},
"author": "v1rtl",
"license": "MIT",
"scripts": {
"build": "rollup -c ./rollup.config.js"
},
"dependencies": {
"es-accepts": "^0.0.21",
"es-fresh": "^0.0.8",
"range-parser": "^1.2.1"
},
"devDependencies": {
"@types/range-parser": "^1.2.3"
}
"name": "@tinyhttp/req",
"version": "0.1.4",
"type": "module",
"description": "request extensions for tinyhttp",
"homepage": "https://github.com/talentlessguy/tinyhttp#readme",
"repository": {
"type": "git",
"url": "https://github.com/talentlessguy/tinyhttp.git",
"directory": "packages/req"
},
"main": "dist/index.cjs",
"types": "dist/index.d.ts",
"module": "dist/index.js",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"./package.json": "./package.json",
"./": "./"
},
"keywords": [
"tinyhttp",
"node.js",
"web framework",
"web",
"backend",
"req",
"request"
],
"engines": {
"node": ">=12.4.0"
},
"author": "v1rtl",
"license": "MIT",
"scripts": {
"build": "rollup -c ./rollup.config.js"
},
"dependencies": {
"@tinyhttp/accepts": "0.0.22",
"es-fresh": "^0.0.8",
"range-parser": "^1.2.1"
},
"devDependencies": {
"@types/range-parser": "^1.2.3"
}
}
import { IncomingMessage as Request, ServerResponse as Response } from 'http'
import parseRange, { Options } from 'range-parser'
import fresh from 'es-fresh'
import Accepts from 'es-accepts'
import { Accepts } from '@tinyhttp/accepts'

@@ -51,3 +51,5 @@ export const getRequestHeader = (req: Request) => (header: string): string | string[] => {

export const getAccepts = (req: Request) => (...types: string[]): string | false | string[] => {
return new Accepts(req).types(types)
const accepts = new Accepts(req)
return accepts.types(types)
}

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