is-writable-stream.js 253 B

12345678910111213
  1. /**
  2. * Check whether a value has an end
  3. * method.
  4. *
  5. * @param {*} value
  6. * @returns {boolean}
  7. */
  8. export function isWritableStream(value) {
  9. if (!value || typeof value !== 'object') {
  10. return false;
  11. }
  12. return typeof value.end === 'function';
  13. }