@adonisjs/http-server 6.8.2-2 → 6.8.2-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,16 +5,15 @@ import mime from 'mime-types';
5
5
  import destroy from 'destroy';
6
6
  import { extname } from 'node:path';
7
7
  import onFinished from 'on-finished';
8
- import { promisify } from 'node:util';
9
8
  import json from '@poppinss/utils/json';
10
9
  import Macroable from '@poppinss/macroable';
11
- import { createReadStream, stat } from 'node:fs';
10
+ import { createReadStream } from 'node:fs';
11
+ import { stat } from 'node:fs/promises';
12
12
  import { RuntimeException } from '@poppinss/utils';
13
13
  import contentDisposition from 'content-disposition';
14
14
  import { Redirect } from './redirect.js';
15
15
  import { CookieSerializer } from './cookies/serializer.js';
16
16
  import { E_HTTP_REQUEST_ABORTED } from './exceptions.js';
17
- const statFn = promisify(stat);
18
17
  const CACHEABLE_HTTP_METHODS = ['GET', 'HEAD'];
19
18
  export class Response extends Macroable {
20
19
  request;
@@ -203,7 +202,7 @@ export class Response extends Macroable {
203
202
  }
204
203
  async streamFileForDownload(filePath, generateEtag, errorCallback) {
205
204
  try {
206
- const stats = await statFn(filePath);
205
+ const stats = await stat(filePath);
207
206
  if (!stats || !stats.isFile()) {
208
207
  throw new TypeError('response.download only accepts path to a file');
209
208
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonisjs/http-server",
3
- "version": "6.8.2-2",
3
+ "version": "6.8.2-3",
4
4
  "description": "AdonisJS HTTP server with support packed with Routing and Cookies",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
@@ -52,7 +52,7 @@
52
52
  "@japa/run-failed-tests": "^1.1.1",
53
53
  "@japa/runner": "^2.5.1",
54
54
  "@japa/spec-reporter": "^1.3.3",
55
- "@swc/core": "^1.3.39",
55
+ "@swc/core": "^1.3.40",
56
56
  "@types/accepts": "^1.3.5",
57
57
  "@types/content-disposition": "^0.5.5",
58
58
  "@types/cookie": "^0.5.1",
@@ -63,7 +63,7 @@
63
63
  "@types/fs-extra": "^11.0.1",
64
64
  "@types/http-status-codes": "^1.2.0",
65
65
  "@types/mime-types": "^2.1.1",
66
- "@types/node": "^18.15.0",
66
+ "@types/node": "^18.15.2",
67
67
  "@types/on-finished": "^2.3.1",
68
68
  "@types/pem": "^1.9.6",
69
69
  "@types/proxy-addr": "^2.0.0",