'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = bufferToReadStream;

var _stream;

function _load_stream() {
  return _stream = _interopRequireWildcard(require('stream'));
}

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

/**
 * cast a buffer to a read stream
 */
function bufferToReadStream(buffer) {
  var s = new (_stream || _load_stream()).PassThrough();
  s.end(buffer);
  return s;
}