archiver-node 8.0.2 → 8.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,44 +1,37 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var JsonArchive_exports = {};
29
- __export(JsonArchive_exports, {
30
- default: () => JsonArchive
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
31
6
  });
32
- module.exports = __toCommonJS(JsonArchive_exports);
33
- var import_Archiver = __toESM(require("../Archiver.js"), 1);
34
- var import_json = __toESM(require("../plugins/json.js"), 1);
35
- class JsonArchive extends import_Archiver.default {
36
- constructor(options) {
37
- super(options);
38
- this._format = "json";
39
- this._module = new import_json.default(options);
40
- this._supportsDirectory = true;
41
- this._supportsSymlink = true;
42
- this._modulePipe();
7
+ exports["default"] = void 0;
8
+ var _Archiver2 = _interopRequireDefault(require("../Archiver.js"));
9
+ var _json = _interopRequireDefault(require("../plugins/json.js"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
17
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
18
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
19
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
20
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
21
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
22
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
23
+ var JsonArchive = exports["default"] = /*#__PURE__*/function (_Archiver) {
24
+ function JsonArchive(options) {
25
+ var _this;
26
+ _classCallCheck(this, JsonArchive);
27
+ _this = _callSuper(this, JsonArchive, [options]);
28
+ _this._format = "json";
29
+ _this._module = new _json["default"](options);
30
+ _this._supportsDirectory = true;
31
+ _this._supportsSymlink = true;
32
+ _this._modulePipe();
33
+ return _this;
43
34
  }
44
- }
35
+ _inherits(JsonArchive, _Archiver);
36
+ return _createClass(JsonArchive);
37
+ }(_Archiver2["default"]);
@@ -1,44 +1,37 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var TarArchive_exports = {};
29
- __export(TarArchive_exports, {
30
- default: () => TarArchive
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
31
6
  });
32
- module.exports = __toCommonJS(TarArchive_exports);
33
- var import_Archiver = __toESM(require("../Archiver.js"), 1);
34
- var import_tar = __toESM(require("../plugins/tar.js"), 1);
35
- class TarArchive extends import_Archiver.default {
36
- constructor(options) {
37
- super(options);
38
- this._format = "tar";
39
- this._module = new import_tar.default(options);
40
- this._supportsDirectory = true;
41
- this._supportsSymlink = true;
42
- this._modulePipe();
7
+ exports["default"] = void 0;
8
+ var _Archiver2 = _interopRequireDefault(require("../Archiver.js"));
9
+ var _tar = _interopRequireDefault(require("../plugins/tar.js"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
17
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
18
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
19
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
20
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
21
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
22
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
23
+ var TarArchive = exports["default"] = /*#__PURE__*/function (_Archiver) {
24
+ function TarArchive(options) {
25
+ var _this;
26
+ _classCallCheck(this, TarArchive);
27
+ _this = _callSuper(this, TarArchive, [options]);
28
+ _this._format = "tar";
29
+ _this._module = new _tar["default"](options);
30
+ _this._supportsDirectory = true;
31
+ _this._supportsSymlink = true;
32
+ _this._modulePipe();
33
+ return _this;
43
34
  }
44
- }
35
+ _inherits(TarArchive, _Archiver);
36
+ return _createClass(TarArchive);
37
+ }(_Archiver2["default"]);
@@ -1,44 +1,37 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var ZipArchive_exports = {};
29
- __export(ZipArchive_exports, {
30
- default: () => ZipArchive
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
31
6
  });
32
- module.exports = __toCommonJS(ZipArchive_exports);
33
- var import_Archiver = __toESM(require("../Archiver.js"), 1);
34
- var import_zip = __toESM(require("../plugins/zip.js"), 1);
35
- class ZipArchive extends import_Archiver.default {
36
- constructor(options) {
37
- super(options);
38
- this._format = "zip";
39
- this._module = new import_zip.default(options);
40
- this._supportsDirectory = true;
41
- this._supportsSymlink = true;
42
- this._modulePipe();
7
+ exports["default"] = void 0;
8
+ var _Archiver2 = _interopRequireDefault(require("../Archiver.js"));
9
+ var _zip = _interopRequireDefault(require("../plugins/zip.js"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
17
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
18
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
19
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
20
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
21
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
22
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
23
+ var ZipArchive = exports["default"] = /*#__PURE__*/function (_Archiver) {
24
+ function ZipArchive(options) {
25
+ var _this;
26
+ _classCallCheck(this, ZipArchive);
27
+ _this = _callSuper(this, ZipArchive, [options]);
28
+ _this._format = "zip";
29
+ _this._module = new _zip["default"](options);
30
+ _this._supportsDirectory = true;
31
+ _this._supportsSymlink = true;
32
+ _this._modulePipe();
33
+ return _this;
43
34
  }
44
- }
35
+ _inherits(ZipArchive, _Archiver);
36
+ return _createClass(ZipArchive);
37
+ }(_Archiver2["default"]);
package/cjs/error.js CHANGED
@@ -1,37 +1,12 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var error_exports = {};
29
- __export(error_exports, {
30
- ArchiverError: () => ArchiverError
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
31
5
  });
32
- module.exports = __toCommonJS(error_exports);
33
- var import_util = __toESM(require("util"), 1);
34
- const ERROR_CODES = {
6
+ exports.ArchiverError = ArchiverError;
7
+ var _util = _interopRequireDefault(require("util"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ var ERROR_CODES = {
35
10
  ABORTED: "archive was aborted",
36
11
  DIRECTORYDIRPATHREQUIRED: "diretory dirpath argument must be a non-empty string value",
37
12
  DIRECTORYFUNCTIONINVALIDDATA: "invalid data returned by directory custom data function",
@@ -51,12 +26,9 @@ const ERROR_CODES = {
51
26
  };
52
27
  function ArchiverError(code, data) {
53
28
  Error.captureStackTrace(this, this.constructor);
29
+ //this.name = this.constructor.name;
54
30
  this.message = ERROR_CODES[code] || code;
55
31
  this.code = code;
56
32
  this.data = data;
57
33
  }
58
- import_util.default.inherits(ArchiverError, Error);
59
- // Annotate the CommonJS export names for ESM import in node:
60
- 0 && (module.exports = {
61
- ArchiverError
62
- });
34
+ _util["default"].inherits(ArchiverError, Error);
package/cjs/lazystream.js CHANGED
@@ -1,66 +1,112 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var lazystream_exports = {};
19
- __export(lazystream_exports, {
20
- Readable: () => Readable,
21
- Writable: () => Writable
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
22
6
  });
23
- module.exports = __toCommonJS(lazystream_exports);
24
- var import_stream = require("stream");
7
+ exports.Writable = exports.Readable = void 0;
8
+ var _stream = require("stream");
9
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
10
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
12
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
15
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
16
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
17
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
19
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
20
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } // Copy-pasted from an unmerged pull request in `lazystream` repo on 23.02.2026:
21
+ // https://github.com/jpommerening/node-lazystream/pull/9/changes
22
+ //
23
+ // That pull request fixes the dependency on `readable-stream` library.
24
+ // https://github.com/jpommerening/node-lazystream/issues/7
25
+ // It wasn't merged because it would have to be a "breaking change" in term of Node.js version requirement
26
+ // and also `lazystream` package seems to no longer be maintained anyway.
27
+ // Patch the given method of instance so that the callback
28
+ // is executed once, before the actual method is called the
29
+ // first time.
25
30
  function beforeFirstCall(instance, method, callback) {
26
- instance[method] = function(...args) {
31
+ instance[method] = function () {
27
32
  delete instance[method];
33
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
34
+ args[_key] = arguments[_key];
35
+ }
28
36
  callback.apply(this, args);
29
37
  return this[method].apply(this, args);
30
38
  };
31
39
  }
32
- class Readable extends import_stream.PassThrough {
33
- constructor(fn, options) {
34
- super(options);
35
- if (!(this instanceof Readable)) {
36
- return new Readable(fn, options);
40
+ var Readable = exports.Readable = /*#__PURE__*/function (_PassThrough) {
41
+ function Readable(fn, options) {
42
+ var _this;
43
+ _classCallCheck(this, Readable);
44
+ _this = _callSuper(this, Readable, [options]);
45
+
46
+ // Support calling without new
47
+ if (!(_this instanceof Readable)) {
48
+ return _possibleConstructorReturn(_this, new Readable(fn, options));
37
49
  }
38
- beforeFirstCall(this, "_read", function() {
39
- const source = fn.call(this, options);
40
- const emit = this.emit.bind(this, "error");
41
- source.on("error", emit);
50
+ beforeFirstCall(_this, '_read', function () {
51
+ var source = fn.call(this, options);
52
+ var emit = this.emit.bind(this, 'error');
53
+ source.on('error', emit);
42
54
  source.pipe(this);
43
55
  });
44
- this.emit("readable");
56
+ _this.emit('readable');
57
+ return _this;
45
58
  }
46
- }
47
- class Writable extends import_stream.PassThrough {
48
- constructor(fn, options) {
49
- super(options);
50
- if (!(this instanceof Writable)) {
51
- return new Writable(fn, options);
59
+ _inherits(Readable, _PassThrough);
60
+ return _createClass(Readable);
61
+ }(_stream.PassThrough);
62
+ var Writable = exports.Writable = /*#__PURE__*/function (_PassThrough2) {
63
+ function Writable(fn, options) {
64
+ var _this2;
65
+ _classCallCheck(this, Writable);
66
+ _this2 = _callSuper(this, Writable, [options]);
67
+
68
+ // Support calling without new
69
+ if (!(_this2 instanceof Writable)) {
70
+ return _possibleConstructorReturn(_this2, new Writable(fn, options));
52
71
  }
53
- beforeFirstCall(this, "_write", function() {
54
- const destination = fn.call(this, options);
55
- const emit = this.emit.bind(this, "error");
56
- destination.on("error", emit);
72
+ beforeFirstCall(_this2, '_write', function () {
73
+ var destination = fn.call(this, options);
74
+ var emit = this.emit.bind(this, 'error');
75
+ destination.on('error', emit);
57
76
  this.pipe(destination);
58
77
  });
59
- this.emit("writable");
78
+ _this2.emit('writable');
79
+ return _this2;
60
80
  }
61
- }
62
- // Annotate the CommonJS export names for ESM import in node:
63
- 0 && (module.exports = {
64
- Readable,
65
- Writable
66
- });
81
+ _inherits(Writable, _PassThrough2);
82
+ return _createClass(Writable);
83
+ }(_stream.PassThrough); // An alternative suggested by Google AI:
84
+ //
85
+ // function createLazyReadStream(filePath) {
86
+ // const passthrough = new PassThrough();
87
+ // let underlyingStream = null;
88
+ //
89
+ // // This function is called only when the stream is first consumed (e.g., piped or 'data' event listener added)
90
+ // const initializeStream = () => {
91
+ // if (!underlyingStream) {
92
+ // underlyingStream = fs.createReadStream(filePath);
93
+ // // Pipe the real stream's data through the passthrough stream
94
+ // underlyingStream.pipe(passthrough);
95
+ //
96
+ // // Forward error events
97
+ // underlyingStream.on('error', (err) => passthrough.emit('error', err));
98
+ // }
99
+ // };
100
+ //
101
+ // // Intercept the 'data' event listener or 'pipe' method to initialize the stream
102
+ // passthrough.on('newListener', (event) => {
103
+ // if (event === 'data' || event === 'pipe') {
104
+ // initializeStream();
105
+ // }
106
+ // });
107
+ //
108
+ // // You also need to handle cases where 'read()' is called directly.
109
+ // // This is a bit more complex, but the 'newListener' approach covers most common use cases.
110
+ //
111
+ // return passthrough;
112
+ // }