From ef51ff394786f68427373997ecb19b341a34b4d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Mar 2024 21:55:10 +0100 Subject: [PATCH] build(deps): bump process-warning from 2.3.2 to 3.0.0 (#277) --- lib/request.js | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/request.js b/lib/request.js index e197c90..0e2a250 100644 --- a/lib/request.js +++ b/lib/request.js @@ -6,13 +6,13 @@ const { Readable, addAbortSignal } = require('node:stream') const util = require('node:util') const cookie = require('cookie') const assert = require('node:assert') -const warning = require('process-warning')() +const { createDeprecation } = require('process-warning') const parseURL = require('./parse-url') const { EventEmitter } = require('node:events') // request.connectin deprecation https://nodejs.org/api/http.html#http_request_connection -warning.create('FastifyDeprecationLightMyRequest', 'FST_LIGHTMYREQUEST_DEP01', 'You are accessing "request.connection", use "request.socket" instead.') +const FST_LIGHTMYREQUEST_DEP01 = createDeprecation({ name: 'FastifyDeprecationLightMyRequest', code: 'FST_LIGHTMYREQUEST_DEP01', message: 'You are accessing "request.connection", use "request.socket" instead.' }) /** * Get hostname:port @@ -138,7 +138,7 @@ function Request (options) { Object.defineProperty(this, 'connection', { get () { - warning.emit('FST_LIGHTMYREQUEST_DEP01') + FST_LIGHTMYREQUEST_DEP01() return this.socket }, configurable: true diff --git a/package.json b/package.json index 33d2926..1e4e268 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "types": "types/index.d.ts", "dependencies": { "cookie": "^0.6.0", - "process-warning": "^2.0.0", + "process-warning": "^3.0.0", "set-cookie-parser": "^2.4.1" }, "devDependencies": {