aboutsummaryrefslogtreecommitdiff
path: root/node_modules/vinyl/lib/inspect-stream.js
blob: 314009d1e088e1522f9e4f3c6dbc964d588ca161 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'use strict';

var isStream = require('is-stream');

function inspectStream(stream) {
  if (!isStream(stream)) {
    return;
  }

  var streamType = stream.constructor.name;
  // Avoid StreamStream
  if (streamType === 'Stream') {
    streamType = '';
  }

  return '<' + streamType + 'Stream>';
}

module.exports = inspectStream;