@tinyhttp/req
Advanced tools
Comparing version 0.1.1 to 0.1.4
# @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 @@ |
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 }; |
{ | ||
"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
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
9269
146
+ Added@tinyhttp/accepts@0.0.22
+ Added@tinyhttp/accepts@0.0.22(transitive)
+ Addedes-mime-types@0.0.15(transitive)
+ Addedmime-db@1.53.0(transitive)
+ Addednegotiator@0.6.4(transitive)
- Removedes-accepts@^0.0.21