@tinyhttp/send
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -6,2 +6,1 @@ export * from './json.js'; | ||
export * from './sendFile.js'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { parse, format } from "es-content-type"; | ||
import { parse, format } from "@tinyhttp/content-type"; | ||
import { eTag } from "@tinyhttp/etag"; | ||
@@ -6,3 +6,3 @@ import { Stats, statSync, createReadStream } from "node:fs"; | ||
import { isAbsolute, join, extname } from "node:path"; | ||
import { contentType } from "es-mime-types"; | ||
import mime from "mime"; | ||
const json = (res) => (body, ...args) => { | ||
@@ -111,3 +111,3 @@ res.setHeader("Content-Type", "application/json"); | ||
if (!res.getHeader("Content-Type")) | ||
headers["Content-Type"] = contentType(extname(path)); | ||
headers["Content-Type"] = mime.getType(extname(path)) + "; charset=utf-8"; | ||
let status2 = res.statusCode || 200; | ||
@@ -148,1 +148,2 @@ if (req.headers["range"]) { | ||
}; | ||
//# sourceMappingURL=index.js.map |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import { ServerResponse as S } from 'node:http'; | ||
@@ -9,2 +10,1 @@ type Res = Pick<S, 'setHeader' | 'end' | 'removeHeader'>; | ||
export {}; | ||
//# sourceMappingURL=json.d.ts.map |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import type { IncomingMessage as I, ServerResponse as S } from 'node:http'; | ||
@@ -19,2 +20,1 @@ type Req = Pick<I, 'method'> & { | ||
export {}; | ||
//# sourceMappingURL=send.d.ts.map |
@@ -0,1 +1,4 @@ | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import type { IncomingMessage as I, ServerResponse as S } from 'node:http'; | ||
@@ -39,2 +42,1 @@ export type ReadStreamOptions = Partial<{ | ||
export {}; | ||
//# sourceMappingURL=sendFile.d.ts.map |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import { IncomingMessage as I, ServerResponse as S } from 'node:http'; | ||
@@ -14,2 +15,1 @@ type Req = Pick<I, 'method'>; | ||
export {}; | ||
//# sourceMappingURL=sendStatus.d.ts.map |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import type { ServerResponse } from 'node:http'; | ||
@@ -10,2 +11,1 @@ type Res = Pick<ServerResponse, 'statusCode'>; | ||
export {}; | ||
//# sourceMappingURL=status.d.ts.map |
import { Stats } from 'node:fs'; | ||
export declare const createETag: (body: Buffer | string | Stats, encoding: BufferEncoding) => string; | ||
export declare function setCharset(type: string, charset: string): any; | ||
//# sourceMappingURL=utils.d.ts.map | ||
export declare function setCharset(type: string, charset: string): string; |
{ | ||
"name": "@tinyhttp/send", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"type": "module", | ||
@@ -30,4 +30,4 @@ "description": "json, send, sendFile, status and sendStatus methods for tinyhttp", | ||
"dependencies": { | ||
"es-content-type": "^0.1.0", | ||
"es-mime-types": "^0.1.4", | ||
"@tinyhttp/content-type": "^0.1.3", | ||
"mime": "4.0.0-beta.1", | ||
"@tinyhttp/etag": "2.1.0" | ||
@@ -34,0 +34,0 @@ }, |
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
250
26258
13
+ Addedmime@4.0.0-beta.1
+ Added@tinyhttp/content-type@0.1.4(transitive)
+ Addedmime@4.0.0-beta.1(transitive)
- Removedes-content-type@^0.1.0
- Removedes-mime-types@^0.1.4
- Removedes-content-type@0.1.0(transitive)
- Removedes-mime-types@0.1.4(transitive)
- Removedmime-db@1.53.0(transitive)