fast-content-type-parse
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "fast-content-type-parse", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Parse HTTP Content-Type header according to RFC 7231", | ||
@@ -10,4 +10,4 @@ "main": "index.js", | ||
"benchmark": "node benchmarks/simple.js && node benchmarks/simple-ows.js && node benchmarks/with-param.js && node benchmarks/with-param-quoted.js", | ||
"lint": "standard", | ||
"lint:fix": "standard --fix", | ||
"lint": "eslint", | ||
"lint:fix": "eslint --fix", | ||
"test": "npm run test:unit && npm run test:typescript", | ||
@@ -22,2 +22,22 @@ "test:typescript": "tsd", | ||
"author": "Aras Abbasi <aras.abbasi@gmail.com>", | ||
"contributors": [ | ||
{ | ||
"name": "Gürgün Dayıoğlu", | ||
"email": "hey@gurgun.day", | ||
"url": "https://heyhey.to/G" | ||
}, | ||
{ | ||
"name": "Manuel Spigolon", | ||
"email": "behemoth89@gmail.com" | ||
}, | ||
{ | ||
"name": "James Sumners", | ||
"url": "https://james.sumners.info" | ||
}, | ||
{ | ||
"name": "Frazer Smith", | ||
"email": "frazer.dev@icloud.com", | ||
"url": "https://github.com/fdawgs" | ||
} | ||
], | ||
"license": "MIT", | ||
@@ -28,2 +48,16 @@ "repository": { | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/fastify/fast-content-type-parse/issues" | ||
}, | ||
"homepage": "https://github.com/fastify/fast-content-type-parse#readme", | ||
"funding": [ | ||
{ | ||
"type": "github", | ||
"url": "https://github.com/sponsors/fastify" | ||
}, | ||
{ | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/fastify" | ||
} | ||
], | ||
"devDependencies": { | ||
@@ -34,3 +68,4 @@ "@fastify/pre-commit": "^2.1.0", | ||
"content-type": "^1.0.4", | ||
"standard": "^17.0.0", | ||
"eslint": "^9.17.0", | ||
"neostandard": "^0.12.0", | ||
"tap": "^19.2.5", | ||
@@ -37,0 +72,0 @@ "tsd": "^0.31.0" |
# fast-content-type-parse | ||
Parse HTTP Content-Type header according to RFC 7231 | ||
<div align="center"> | ||
@@ -9,4 +7,4 @@ | ||
[![NPM downloads](https://img.shields.io/npm/dm/fast-content-type-parse.svg?style=flat)](https://www.npmjs.com/package/fast-content-type-parse) | ||
[![Build Status](https://github.com/fastify/fast-content-type-parse/workflows/CI/badge.svg)](https://github.com/fastify/fast-content-type-parse/actions) | ||
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/) | ||
[![CI](https://github.com/fastify/fast-content-type-parse/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/fastify/fast-content-type-parse/actions/workflows/ci.yml) | ||
[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard) | ||
[![Security Responsible Disclosure](https://img.shields.io/badge/Security-Responsible%20Disclosure-yellow.svg)](https://github.com/fastify/.github/blob/main/SECURITY.md) | ||
@@ -16,2 +14,4 @@ | ||
Parse HTTP Content-Type header according to RFC 7231. | ||
## Installation | ||
@@ -40,7 +40,7 @@ | ||
- `type`: The media type (the type and subtype, always lower case). | ||
- `type`: The media type (the type and subtype, always lowercase). | ||
Example: `'application/json'` | ||
- `parameters`: An object of the parameters in the media type (name of parameter | ||
always lower case). Example: `{charset: 'utf-8'}` | ||
always lowercase). Example: `{charset: 'utf-8'}` | ||
@@ -58,7 +58,7 @@ ### fastContentTypeParse.safeParse(string) | ||
- `type`: The media type (the type and subtype, always lower case). | ||
- `type`: The media type (the type and subtype, always lowercase). | ||
Example: `'application/json'` | ||
- `parameters`: An object of the parameters in the media type (name of parameter | ||
always lower case). Example: `{charset: 'utf-8'}` | ||
always lowercase). Example: `{charset: 'utf-8'}` | ||
@@ -82,2 +82,6 @@ In case the header is invalid, it will return an object | ||
Based on the npm package `content-type` | ||
Based on the npm package `content-type`. | ||
## License | ||
Licensed under [MIT](./LICENSE). |
@@ -14,6 +14,6 @@ interface ContentType { | ||
export function parse(header: string): ContentType; | ||
export function safeParse(header: string): ContentType; | ||
export const defaultContentType: ContentType; | ||
export function parse (header: string): ContentType | ||
export function safeParse (header: string): ContentType | ||
export const defaultContentType: ContentType | ||
const fastContentTypeParse: FastContentTypeParse | ||
@@ -23,2 +23,2 @@ export { fastContentTypeParse as default } | ||
export = fastContentTypeParse | ||
export = fastContentTypeParse |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
21964
438
0
0
83
8
20