UNPKG

@techmely/utils

Version:

Collection of helpful JavaScript / TypeScript utils

31 lines (26 loc) 523 B
/*! * @techmely/utils * Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com> * MIT Licensed */ // src/isStream/index.ts function isStream(value) { if (!value || typeof value !== "object") { return false; } if (typeof value.pipe === "function") { if (typeof value._read === "function") { return true; } if (typeof value.abort === "function") { return true; } } if (typeof value.pipeTo === "function") { return true; } return false; } export { isStream };