(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define(["exports", "rxjs", "fs"], factory);
  } else if (typeof exports !== "undefined") {
    factory(exports, require("rxjs"), require("fs"));
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports, global.rxjs, global.fs);
    global.fromFile = mod.exports;
  }
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _rxjs, _fs) {
  "use strict";

  Object.defineProperty(_exports, "__esModule", {
    value: true
  });
  _exports.default = void 0;

  const fromFile = function fromFile({
    filePath,
    _createReadStream = _fs.createReadStream
  }) {
    return new _rxjs.Observable(obs => {
      const rs = _createReadStream(filePath);

      rs.on('data', chunk => obs.next(chunk));
      rs.on('close', () => obs.complete());
      rs.on('error', err => obs.error(err));
      return () => rs.destroy();
    });
  };

  var _default = fromFile;
  _exports.default = _default;
});
//# sourceMappingURL=fromFile.js.map