From 83354b2b88218090988dd6e526b0a2505b57e0f1 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Thu, 6 Apr 2023 22:18:28 +0200 Subject: Updated 5 files and added 1110 files (automated) --- .../node_modules/mimic-response/index.d.ts | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 includes/external/addressbook/node_modules/mimic-response/index.d.ts (limited to 'includes/external/addressbook/node_modules/mimic-response/index.d.ts') diff --git a/includes/external/addressbook/node_modules/mimic-response/index.d.ts b/includes/external/addressbook/node_modules/mimic-response/index.d.ts new file mode 100644 index 0000000..324613f --- /dev/null +++ b/includes/external/addressbook/node_modules/mimic-response/index.d.ts @@ -0,0 +1,29 @@ +import {IncomingMessage} from 'node:http'; + +/** +Mimic a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage) + +Makes `toStream` include the properties from `fromStream`. + +@param fromStream - The stream to copy the properties from. +@param toStream - The stream to copy the properties to. +@return The same object as `toStream`. + +@example +``` +import {PassThrough as PassThroughStream} from 'node:stream'; +import mimicResponse from 'mimic-response'; + +const responseStream = getHttpResponseStream(); +const myStream = new PassThroughStream(); + +mimicResponse(responseStream, myStream); + +console.log(myStream.statusCode); +//=> 200 +``` +*/ +export default function mimicResponse( + fromStream: IncomingMessage, + toStream: T, +): T & IncomingMessage; -- cgit