{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/zip-iterator/src/lib/Lock.mjs"],"sourcesContent":["import fs from 'fs';\nimport BaseIterator from 'extract-base-iterator';\nimport LC from 'lifecycle';\nimport rimraf2 from 'rimraf2';\n\nexport default LC.RefCountable.extend({\n  constructor: function () {\n    LC.RefCountable.prototype.constructor.call(this);\n  },\n  __destroy: function () {\n    if (this.tempPath) {\n      try {\n        rimraf2.sync(this.tempPath, { disableGlob: true });\n      } catch (_err) {\n        /* empty */\n      }\n      this.tempPath = null;\n    }\n\n    if (this.fd) {\n      fs.closeSync(this.fd);\n      this.fd = null;\n    }\n\n    if (this.iterator) {\n      BaseIterator.prototype.end.call(this.iterator, this.err || null);\n      this.iterator = null;\n    }\n  },\n});\n"],"names":["LC","RefCountable","extend","constructor","prototype","call","__destroy","tempPath","rimraf2","sync","disableGlob","_err","fd","fs","closeSync","iterator","BaseIterator","end","err"],"mappings":";;;;+BAKA;;;eAAA;;;yDALe;0EACU;gEACV;8DACK;;;;;;IAEpB,WAAeA,kBAAE,CAACC,YAAY,CAACC,MAAM,CAAC;IACpCC,aAAa,SAAbA;QACEH,kBAAE,CAACC,YAAY,CAACG,SAAS,CAACD,WAAW,CAACE,IAAI,CAAC,IAAI;IACjD;IACAC,WAAW,SAAXA;QACE,IAAI,IAAI,CAACC,QAAQ,EAAE;YACjB,IAAI;gBACFC,gBAAO,CAACC,IAAI,CAAC,IAAI,CAACF,QAAQ,EAAE;oBAAEG,aAAa;gBAAK;YAClD,EAAE,OAAOC,MAAM;YACb,SAAS,GACX;YACA,IAAI,CAACJ,QAAQ,GAAG;QAClB;QAEA,IAAI,IAAI,CAACK,EAAE,EAAE;YACXC,WAAE,CAACC,SAAS,CAAC,IAAI,CAACF,EAAE;YACpB,IAAI,CAACA,EAAE,GAAG;QACZ;QAEA,IAAI,IAAI,CAACG,QAAQ,EAAE;YACjBC,4BAAY,CAACZ,SAAS,CAACa,GAAG,CAACZ,IAAI,CAAC,IAAI,CAACU,QAAQ,EAAE,IAAI,CAACG,GAAG,IAAI;YAC3D,IAAI,CAACH,QAAQ,GAAG;QAClB;IACF;AACF"}