From 1305a0be1f386912c61f5ec5e9ac0d3e84001427 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Tue, 31 Jan 2023 23:04:47 -0800 Subject: [PATCH] Remove checkForStream --- lib/utils.js | 17 ----------------- src/utils.ts | 18 ------------------ 2 files changed, 35 deletions(-) diff --git a/lib/utils.js b/lib/utils.js index 255cbbf3f7..3c4f23f7e7 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -190,23 +190,6 @@ const utils = { .map((text) => text.charAt(0).toUpperCase() + text.substr(1).toLowerCase()) .join('-'); }, - /** - * Determine if file data is a derivative of EventEmitter class. - * https://nodejs.org/api/events.html#events_events - */ - checkForStream: (obj) => { - if (obj.file && obj.file.data) { - // return ( - // typeof obj.file.data === 'object' && - // 'on' in obj.file.data && - // typeof obj.file.data.on === 'function' && - // 'once' in obj.file.data && - // typeof obj.file.data.once === 'function' - // ); - return obj.file.data.constructor.name === 'EventEmitter'; - } - return false; - }, callbackifyPromiseWithTimeout: (promise, callback) => { if (callback) { // Ensure callback is called outside of promise stack. diff --git a/src/utils.ts b/src/utils.ts index d26eb26b18..3c3583ffdf 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -245,24 +245,6 @@ const utils = { .join('-'); }, - /** - * Determine if file data is a derivative of EventEmitter class. - * https://nodejs.org/api/events.html#events_events - */ - checkForStream: (obj: {file?: {data: unknown}}): boolean => { - if (obj.file && obj.file.data) { - // return ( - // typeof obj.file.data === 'object' && - // 'on' in obj.file.data && - // typeof obj.file.data.on === 'function' && - // 'once' in obj.file.data && - // typeof obj.file.data.once === 'function' - // ); - return obj.file.data.constructor.name === 'EventEmitter'; - } - return false; - }, - callbackifyPromiseWithTimeout: ( promise: Promise, callback: ((error: unknown, result: T | null) => void) | null