extract-base-iterator 3.3.0 → 3.3.1

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,2 +1,2 @@
1
1
  import type { NoParamCallback } from './types.js';
2
- export default function waitForAccess(fullPath: string, noFollowOrCallback: boolean | NoParamCallback, callbackOrAttempts?: NoParamCallback | number, attempts?: number): void;
2
+ export default function waitForAccess(fullPath: string, noFollow: boolean | NoParamCallback, callback?: NoParamCallback | number): void;
@@ -1,2 +1,2 @@
1
1
  import type { NoParamCallback } from './types.js';
2
- export default function waitForAccess(fullPath: string, noFollowOrCallback: boolean | NoParamCallback, callbackOrAttempts?: NoParamCallback | number, attempts?: number): void;
2
+ export default function waitForAccess(fullPath: string, noFollow: boolean | NoParamCallback, callback?: NoParamCallback | number): void;
@@ -15,58 +15,45 @@ function _interop_require_default(obj) {
15
15
  default: obj
16
16
  };
17
17
  }
18
- var isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);
19
- function waitForAccess(fullPath, noFollowOrCallback, callbackOrAttempts) {
20
- var attempts = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
21
- // Parse arguments for backward compatibility
22
- var noFollow;
23
- var callback;
24
- if (typeof noFollowOrCallback === 'function') {
25
- // Old signature: waitForAccess(path, callback, attempts?)
26
- noFollow = false;
27
- callback = noFollowOrCallback;
28
- attempts = callbackOrAttempts || 0;
29
- } else {
30
- // New signature: waitForAccess(path, noFollow, callback, attempts?)
31
- noFollow = noFollowOrCallback;
32
- callback = callbackOrAttempts;
33
- }
34
- // POSIX: finish event is reliable after decompression stream fixes
35
- // Avoid Zalgo: ensure callback is always async for consistent API
36
- if (!isWindows) return process.nextTick(callback);
37
- // Windows: NTFS metadata may not be committed yet, verify accessibility
38
- // For symlinks (noFollow=true), use lstat to check the link itself exists
39
- // For files/dirs/hardlinks, use open to verify the file is accessible
40
- if (noFollow) {
18
+ function waitForAccess(fullPath, noFollow, callback) {
19
+ callback = typeof noFollow === 'function' ? noFollow : callback;
20
+ noFollow = typeof noFollow === 'function' ? false : noFollow;
21
+ // Exponential backoff: 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560ms
22
+ // Total max wait: ~5 seconds
23
+ function waitSymlink(attempts, cb) {
41
24
  _fs.default.lstat(fullPath, function(err) {
42
25
  if (err) {
43
26
  if (err.code === 'ENOENT' && attempts < 10) {
44
27
  var delay = Math.min(5 * Math.pow(2, attempts), 2560);
45
28
  return setTimeout(function() {
46
- return waitForAccess(fullPath, noFollow, callback, attempts + 1);
29
+ return waitSymlink(attempts + 1, cb);
47
30
  }, delay);
48
31
  }
49
- return callback(err);
32
+ return cb(err);
50
33
  }
51
- callback();
34
+ cb();
52
35
  });
53
- } else {
36
+ }
37
+ function waitOpen(attempts, cb) {
54
38
  _fs.default.open(fullPath, 'r', function(err, fd) {
55
39
  if (err) {
56
40
  if (err.code === 'ENOENT' && attempts < 10) {
57
- // Exponential backoff: 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560ms
58
- // Total max wait: ~5 seconds
59
41
  var delay = Math.min(5 * Math.pow(2, attempts), 2560);
60
42
  return setTimeout(function() {
61
- return waitForAccess(fullPath, noFollow, callback, attempts + 1);
43
+ return waitOpen(attempts + 1, cb);
62
44
  }, delay);
63
45
  }
64
- return callback(err);
46
+ return cb(err);
65
47
  }
66
48
  _fs.default.close(fd, function() {
67
- return callback();
49
+ return cb();
68
50
  });
69
51
  });
70
52
  }
53
+ // Windows: NTFS metadata may not be committed yet, verify accessibility
54
+ // Node 0.10: the write stream's finish/close events may fire before the file is fully flushed to disk
55
+ // For symlinks (noFollow=true), use lstat to check the link itself exists
56
+ // For files/dirs/hardlinks, use open to verify the file is accessible
57
+ noFollow ? waitSymlink(0, callback) : waitOpen(0, callback);
71
58
  }
72
59
  /* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/waitForAccess.ts"],"sourcesContent":["import fs from 'fs';\n\nimport type { NoParamCallback } from './types.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\n\n// Backward compatible: waitForAccess(path, callback) or waitForAccess(path, noFollow, callback)\nexport default function waitForAccess(fullPath: string, noFollowOrCallback: boolean | NoParamCallback, callbackOrAttempts?: NoParamCallback | number, attempts = 0) {\n // Parse arguments for backward compatibility\n let noFollow: boolean;\n let callback: NoParamCallback;\n if (typeof noFollowOrCallback === 'function') {\n // Old signature: waitForAccess(path, callback, attempts?)\n noFollow = false;\n callback = noFollowOrCallback;\n attempts = (callbackOrAttempts as number) || 0;\n } else {\n // New signature: waitForAccess(path, noFollow, callback, attempts?)\n noFollow = noFollowOrCallback;\n callback = callbackOrAttempts as NoParamCallback;\n }\n\n // POSIX: finish event is reliable after decompression stream fixes\n // Avoid Zalgo: ensure callback is always async for consistent API\n if (!isWindows) return process.nextTick(callback);\n\n // Windows: NTFS metadata may not be committed yet, verify accessibility\n // For symlinks (noFollow=true), use lstat to check the link itself exists\n // For files/dirs/hardlinks, use open to verify the file is accessible\n if (noFollow) {\n fs.lstat(fullPath, (err) => {\n if (err) {\n if (err.code === 'ENOENT' && attempts < 10) {\n const delay = Math.min(5 * 2 ** attempts, 2560);\n return setTimeout(() => waitForAccess(fullPath, noFollow, callback, attempts + 1), delay);\n }\n return callback(err);\n }\n callback();\n });\n } else {\n fs.open(fullPath, 'r', (err, fd) => {\n if (err) {\n if (err.code === 'ENOENT' && attempts < 10) {\n // Exponential backoff: 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560ms\n // Total max wait: ~5 seconds\n const delay = Math.min(5 * 2 ** attempts, 2560);\n return setTimeout(() => waitForAccess(fullPath, noFollow, callback, attempts + 1), delay);\n }\n return callback(err);\n }\n fs.close(fd, () => callback());\n });\n }\n}\n"],"names":["waitForAccess","isWindows","process","platform","test","env","OSTYPE","fullPath","noFollowOrCallback","callbackOrAttempts","attempts","noFollow","callback","nextTick","fs","lstat","err","code","delay","Math","min","setTimeout","open","fd","close"],"mappings":";;;;+BAMA,gGAAgG;AAChG;;;eAAwBA;;;yDAPT;;;;;;AAIf,IAAMC,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM;AAG5E,SAASN,cAAcO,QAAgB,EAAEC,kBAA6C,EAAEC,kBAA6C;QAAEC,WAAAA,iEAAW;IAC/J,6CAA6C;IAC7C,IAAIC;IACJ,IAAIC;IACJ,IAAI,OAAOJ,uBAAuB,YAAY;QAC5C,0DAA0D;QAC1DG,WAAW;QACXC,WAAWJ;QACXE,WAAW,AAACD,sBAAiC;IAC/C,OAAO;QACL,oEAAoE;QACpEE,WAAWH;QACXI,WAAWH;IACb;IAEA,mEAAmE;IACnE,kEAAkE;IAClE,IAAI,CAACR,WAAW,OAAOC,QAAQW,QAAQ,CAACD;IAExC,wEAAwE;IACxE,0EAA0E;IAC1E,sEAAsE;IACtE,IAAID,UAAU;QACZG,WAAE,CAACC,KAAK,CAACR,UAAU,SAACS;YAClB,IAAIA,KAAK;gBACP,IAAIA,IAAIC,IAAI,KAAK,YAAYP,WAAW,IAAI;oBAC1C,IAAMQ,QAAQC,KAAKC,GAAG,CAAC,aAAI,GAAKV,WAAU;oBAC1C,OAAOW,WAAW;+BAAMrB,cAAcO,UAAUI,UAAUC,UAAUF,WAAW;uBAAIQ;gBACrF;gBACA,OAAON,SAASI;YAClB;YACAJ;QACF;IACF,OAAO;QACLE,WAAE,CAACQ,IAAI,CAACf,UAAU,KAAK,SAACS,KAAKO;YAC3B,IAAIP,KAAK;gBACP,IAAIA,IAAIC,IAAI,KAAK,YAAYP,WAAW,IAAI;oBAC1C,sEAAsE;oBACtE,6BAA6B;oBAC7B,IAAMQ,QAAQC,KAAKC,GAAG,CAAC,aAAI,GAAKV,WAAU;oBAC1C,OAAOW,WAAW;+BAAMrB,cAAcO,UAAUI,UAAUC,UAAUF,WAAW;uBAAIQ;gBACrF;gBACA,OAAON,SAASI;YAClB;YACAF,WAAE,CAACU,KAAK,CAACD,IAAI;uBAAMX;;QACrB;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/waitForAccess.ts"],"sourcesContent":["import fs from 'fs';\n\nimport type { NoParamCallback } from './types.ts';\n\n// Backward compatible: waitForAccess(path, callback) or waitForAccess(path, noFollow, callback)\nexport default function waitForAccess(fullPath: string, noFollow: boolean | NoParamCallback, callback?: NoParamCallback | number) {\n callback = typeof noFollow === 'function' ? noFollow : callback;\n noFollow = typeof noFollow === 'function' ? false : (noFollow as boolean);\n\n // Exponential backoff: 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560ms\n // Total max wait: ~5 seconds\n function waitSymlink(attempts, cb) {\n fs.lstat(fullPath, (err) => {\n if (err) {\n if (err.code === 'ENOENT' && attempts < 10) {\n const delay = Math.min(5 * 2 ** attempts, 2560);\n return setTimeout(() => waitSymlink(attempts + 1, cb), delay);\n }\n return cb(err);\n }\n cb();\n });\n }\n function waitOpen(attempts, cb) {\n fs.open(fullPath, 'r', (err, fd) => {\n if (err) {\n if (err.code === 'ENOENT' && attempts < 10) {\n const delay = Math.min(5 * 2 ** attempts, 2560);\n return setTimeout(() => waitOpen(attempts + 1, cb), delay);\n }\n return cb(err);\n }\n fs.close(fd, () => cb());\n });\n }\n\n // Windows: NTFS metadata may not be committed yet, verify accessibility\n // Node 0.10: the write stream's finish/close events may fire before the file is fully flushed to disk\n // For symlinks (noFollow=true), use lstat to check the link itself exists\n // For files/dirs/hardlinks, use open to verify the file is accessible\n noFollow ? waitSymlink(0, callback) : waitOpen(0, callback);\n}\n"],"names":["waitForAccess","fullPath","noFollow","callback","waitSymlink","attempts","cb","fs","lstat","err","code","delay","Math","min","setTimeout","waitOpen","open","fd","close"],"mappings":";;;;+BAIA,gGAAgG;AAChG;;;eAAwBA;;;yDALT;;;;;;AAKA,SAASA,cAAcC,QAAgB,EAAEC,QAAmC,EAAEC,QAAmC;IAC9HA,WAAW,OAAOD,aAAa,aAAaA,WAAWC;IACvDD,WAAW,OAAOA,aAAa,aAAa,QAASA;IAErD,sEAAsE;IACtE,6BAA6B;IAC7B,SAASE,YAAYC,QAAQ,EAAEC,EAAE;QAC/BC,WAAE,CAACC,KAAK,CAACP,UAAU,SAACQ;YAClB,IAAIA,KAAK;gBACP,IAAIA,IAAIC,IAAI,KAAK,YAAYL,WAAW,IAAI;oBAC1C,IAAMM,QAAQC,KAAKC,GAAG,CAAC,aAAI,GAAKR,WAAU;oBAC1C,OAAOS,WAAW;+BAAMV,YAAYC,WAAW,GAAGC;uBAAKK;gBACzD;gBACA,OAAOL,GAAGG;YACZ;YACAH;QACF;IACF;IACA,SAASS,SAASV,QAAQ,EAAEC,EAAE;QAC5BC,WAAE,CAACS,IAAI,CAACf,UAAU,KAAK,SAACQ,KAAKQ;YAC3B,IAAIR,KAAK;gBACP,IAAIA,IAAIC,IAAI,KAAK,YAAYL,WAAW,IAAI;oBAC1C,IAAMM,QAAQC,KAAKC,GAAG,CAAC,aAAI,GAAKR,WAAU;oBAC1C,OAAOS,WAAW;+BAAMC,SAASV,WAAW,GAAGC;uBAAKK;gBACtD;gBACA,OAAOL,GAAGG;YACZ;YACAF,WAAE,CAACW,KAAK,CAACD,IAAI;uBAAMX;;QACrB;IACF;IAEA,wEAAwE;IACxE,sGAAsG;IACtG,0EAA0E;IAC1E,sEAAsE;IACtEJ,WAAWE,YAAY,GAAGD,YAAYY,SAAS,GAAGZ;AACpD"}
@@ -1,2 +1,2 @@
1
1
  import type { NoParamCallback } from './types.js';
2
- export default function waitForAccess(fullPath: string, noFollowOrCallback: boolean | NoParamCallback, callbackOrAttempts?: NoParamCallback | number, attempts?: number): void;
2
+ export default function waitForAccess(fullPath: string, noFollow: boolean | NoParamCallback, callback?: NoParamCallback | number): void;
@@ -1,49 +1,37 @@
1
1
  import fs from 'fs';
2
- const isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);
3
2
  // Backward compatible: waitForAccess(path, callback) or waitForAccess(path, noFollow, callback)
4
- export default function waitForAccess(fullPath, noFollowOrCallback, callbackOrAttempts, attempts = 0) {
5
- // Parse arguments for backward compatibility
6
- let noFollow;
7
- let callback;
8
- if (typeof noFollowOrCallback === 'function') {
9
- // Old signature: waitForAccess(path, callback, attempts?)
10
- noFollow = false;
11
- callback = noFollowOrCallback;
12
- attempts = callbackOrAttempts || 0;
13
- } else {
14
- // New signature: waitForAccess(path, noFollow, callback, attempts?)
15
- noFollow = noFollowOrCallback;
16
- callback = callbackOrAttempts;
17
- }
18
- // POSIX: finish event is reliable after decompression stream fixes
19
- // Avoid Zalgo: ensure callback is always async for consistent API
20
- if (!isWindows) return process.nextTick(callback);
21
- // Windows: NTFS metadata may not be committed yet, verify accessibility
22
- // For symlinks (noFollow=true), use lstat to check the link itself exists
23
- // For files/dirs/hardlinks, use open to verify the file is accessible
24
- if (noFollow) {
3
+ export default function waitForAccess(fullPath, noFollow, callback) {
4
+ callback = typeof noFollow === 'function' ? noFollow : callback;
5
+ noFollow = typeof noFollow === 'function' ? false : noFollow;
6
+ // Exponential backoff: 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560ms
7
+ // Total max wait: ~5 seconds
8
+ function waitSymlink(attempts, cb) {
25
9
  fs.lstat(fullPath, (err)=>{
26
10
  if (err) {
27
11
  if (err.code === 'ENOENT' && attempts < 10) {
28
12
  const delay = Math.min(5 * 2 ** attempts, 2560);
29
- return setTimeout(()=>waitForAccess(fullPath, noFollow, callback, attempts + 1), delay);
13
+ return setTimeout(()=>waitSymlink(attempts + 1, cb), delay);
30
14
  }
31
- return callback(err);
15
+ return cb(err);
32
16
  }
33
- callback();
17
+ cb();
34
18
  });
35
- } else {
19
+ }
20
+ function waitOpen(attempts, cb) {
36
21
  fs.open(fullPath, 'r', (err, fd)=>{
37
22
  if (err) {
38
23
  if (err.code === 'ENOENT' && attempts < 10) {
39
- // Exponential backoff: 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560ms
40
- // Total max wait: ~5 seconds
41
24
  const delay = Math.min(5 * 2 ** attempts, 2560);
42
- return setTimeout(()=>waitForAccess(fullPath, noFollow, callback, attempts + 1), delay);
25
+ return setTimeout(()=>waitOpen(attempts + 1, cb), delay);
43
26
  }
44
- return callback(err);
27
+ return cb(err);
45
28
  }
46
- fs.close(fd, ()=>callback());
29
+ fs.close(fd, ()=>cb());
47
30
  });
48
31
  }
32
+ // Windows: NTFS metadata may not be committed yet, verify accessibility
33
+ // Node 0.10: the write stream's finish/close events may fire before the file is fully flushed to disk
34
+ // For symlinks (noFollow=true), use lstat to check the link itself exists
35
+ // For files/dirs/hardlinks, use open to verify the file is accessible
36
+ noFollow ? waitSymlink(0, callback) : waitOpen(0, callback);
49
37
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/waitForAccess.ts"],"sourcesContent":["import fs from 'fs';\n\nimport type { NoParamCallback } from './types.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\n\n// Backward compatible: waitForAccess(path, callback) or waitForAccess(path, noFollow, callback)\nexport default function waitForAccess(fullPath: string, noFollowOrCallback: boolean | NoParamCallback, callbackOrAttempts?: NoParamCallback | number, attempts = 0) {\n // Parse arguments for backward compatibility\n let noFollow: boolean;\n let callback: NoParamCallback;\n if (typeof noFollowOrCallback === 'function') {\n // Old signature: waitForAccess(path, callback, attempts?)\n noFollow = false;\n callback = noFollowOrCallback;\n attempts = (callbackOrAttempts as number) || 0;\n } else {\n // New signature: waitForAccess(path, noFollow, callback, attempts?)\n noFollow = noFollowOrCallback;\n callback = callbackOrAttempts as NoParamCallback;\n }\n\n // POSIX: finish event is reliable after decompression stream fixes\n // Avoid Zalgo: ensure callback is always async for consistent API\n if (!isWindows) return process.nextTick(callback);\n\n // Windows: NTFS metadata may not be committed yet, verify accessibility\n // For symlinks (noFollow=true), use lstat to check the link itself exists\n // For files/dirs/hardlinks, use open to verify the file is accessible\n if (noFollow) {\n fs.lstat(fullPath, (err) => {\n if (err) {\n if (err.code === 'ENOENT' && attempts < 10) {\n const delay = Math.min(5 * 2 ** attempts, 2560);\n return setTimeout(() => waitForAccess(fullPath, noFollow, callback, attempts + 1), delay);\n }\n return callback(err);\n }\n callback();\n });\n } else {\n fs.open(fullPath, 'r', (err, fd) => {\n if (err) {\n if (err.code === 'ENOENT' && attempts < 10) {\n // Exponential backoff: 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560ms\n // Total max wait: ~5 seconds\n const delay = Math.min(5 * 2 ** attempts, 2560);\n return setTimeout(() => waitForAccess(fullPath, noFollow, callback, attempts + 1), delay);\n }\n return callback(err);\n }\n fs.close(fd, () => callback());\n });\n }\n}\n"],"names":["fs","isWindows","process","platform","test","env","OSTYPE","waitForAccess","fullPath","noFollowOrCallback","callbackOrAttempts","attempts","noFollow","callback","nextTick","lstat","err","code","delay","Math","min","setTimeout","open","fd","close"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AAIpB,MAAMC,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM;AAE3F,gGAAgG;AAChG,eAAe,SAASC,cAAcC,QAAgB,EAAEC,kBAA6C,EAAEC,kBAA6C,EAAEC,WAAW,CAAC;IAChK,6CAA6C;IAC7C,IAAIC;IACJ,IAAIC;IACJ,IAAI,OAAOJ,uBAAuB,YAAY;QAC5C,0DAA0D;QAC1DG,WAAW;QACXC,WAAWJ;QACXE,WAAW,AAACD,sBAAiC;IAC/C,OAAO;QACL,oEAAoE;QACpEE,WAAWH;QACXI,WAAWH;IACb;IAEA,mEAAmE;IACnE,kEAAkE;IAClE,IAAI,CAACT,WAAW,OAAOC,QAAQY,QAAQ,CAACD;IAExC,wEAAwE;IACxE,0EAA0E;IAC1E,sEAAsE;IACtE,IAAID,UAAU;QACZZ,GAAGe,KAAK,CAACP,UAAU,CAACQ;YAClB,IAAIA,KAAK;gBACP,IAAIA,IAAIC,IAAI,KAAK,YAAYN,WAAW,IAAI;oBAC1C,MAAMO,QAAQC,KAAKC,GAAG,CAAC,IAAI,KAAKT,UAAU;oBAC1C,OAAOU,WAAW,IAAMd,cAAcC,UAAUI,UAAUC,UAAUF,WAAW,IAAIO;gBACrF;gBACA,OAAOL,SAASG;YAClB;YACAH;QACF;IACF,OAAO;QACLb,GAAGsB,IAAI,CAACd,UAAU,KAAK,CAACQ,KAAKO;YAC3B,IAAIP,KAAK;gBACP,IAAIA,IAAIC,IAAI,KAAK,YAAYN,WAAW,IAAI;oBAC1C,sEAAsE;oBACtE,6BAA6B;oBAC7B,MAAMO,QAAQC,KAAKC,GAAG,CAAC,IAAI,KAAKT,UAAU;oBAC1C,OAAOU,WAAW,IAAMd,cAAcC,UAAUI,UAAUC,UAAUF,WAAW,IAAIO;gBACrF;gBACA,OAAOL,SAASG;YAClB;YACAhB,GAAGwB,KAAK,CAACD,IAAI,IAAMV;QACrB;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/extract-base-iterator/src/waitForAccess.ts"],"sourcesContent":["import fs from 'fs';\n\nimport type { NoParamCallback } from './types.ts';\n\n// Backward compatible: waitForAccess(path, callback) or waitForAccess(path, noFollow, callback)\nexport default function waitForAccess(fullPath: string, noFollow: boolean | NoParamCallback, callback?: NoParamCallback | number) {\n callback = typeof noFollow === 'function' ? noFollow : callback;\n noFollow = typeof noFollow === 'function' ? false : (noFollow as boolean);\n\n // Exponential backoff: 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560ms\n // Total max wait: ~5 seconds\n function waitSymlink(attempts, cb) {\n fs.lstat(fullPath, (err) => {\n if (err) {\n if (err.code === 'ENOENT' && attempts < 10) {\n const delay = Math.min(5 * 2 ** attempts, 2560);\n return setTimeout(() => waitSymlink(attempts + 1, cb), delay);\n }\n return cb(err);\n }\n cb();\n });\n }\n function waitOpen(attempts, cb) {\n fs.open(fullPath, 'r', (err, fd) => {\n if (err) {\n if (err.code === 'ENOENT' && attempts < 10) {\n const delay = Math.min(5 * 2 ** attempts, 2560);\n return setTimeout(() => waitOpen(attempts + 1, cb), delay);\n }\n return cb(err);\n }\n fs.close(fd, () => cb());\n });\n }\n\n // Windows: NTFS metadata may not be committed yet, verify accessibility\n // Node 0.10: the write stream's finish/close events may fire before the file is fully flushed to disk\n // For symlinks (noFollow=true), use lstat to check the link itself exists\n // For files/dirs/hardlinks, use open to verify the file is accessible\n noFollow ? waitSymlink(0, callback) : waitOpen(0, callback);\n}\n"],"names":["fs","waitForAccess","fullPath","noFollow","callback","waitSymlink","attempts","cb","lstat","err","code","delay","Math","min","setTimeout","waitOpen","open","fd","close"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AAIpB,gGAAgG;AAChG,eAAe,SAASC,cAAcC,QAAgB,EAAEC,QAAmC,EAAEC,QAAmC;IAC9HA,WAAW,OAAOD,aAAa,aAAaA,WAAWC;IACvDD,WAAW,OAAOA,aAAa,aAAa,QAASA;IAErD,sEAAsE;IACtE,6BAA6B;IAC7B,SAASE,YAAYC,QAAQ,EAAEC,EAAE;QAC/BP,GAAGQ,KAAK,CAACN,UAAU,CAACO;YAClB,IAAIA,KAAK;gBACP,IAAIA,IAAIC,IAAI,KAAK,YAAYJ,WAAW,IAAI;oBAC1C,MAAMK,QAAQC,KAAKC,GAAG,CAAC,IAAI,KAAKP,UAAU;oBAC1C,OAAOQ,WAAW,IAAMT,YAAYC,WAAW,GAAGC,KAAKI;gBACzD;gBACA,OAAOJ,GAAGE;YACZ;YACAF;QACF;IACF;IACA,SAASQ,SAAST,QAAQ,EAAEC,EAAE;QAC5BP,GAAGgB,IAAI,CAACd,UAAU,KAAK,CAACO,KAAKQ;YAC3B,IAAIR,KAAK;gBACP,IAAIA,IAAIC,IAAI,KAAK,YAAYJ,WAAW,IAAI;oBAC1C,MAAMK,QAAQC,KAAKC,GAAG,CAAC,IAAI,KAAKP,UAAU;oBAC1C,OAAOQ,WAAW,IAAMC,SAAST,WAAW,GAAGC,KAAKI;gBACtD;gBACA,OAAOJ,GAAGE;YACZ;YACAT,GAAGkB,KAAK,CAACD,IAAI,IAAMV;QACrB;IACF;IAEA,wEAAwE;IACxE,sGAAsG;IACtG,0EAA0E;IAC1E,sEAAsE;IACtEJ,WAAWE,YAAY,GAAGD,YAAYW,SAAS,GAAGX;AACpD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "extract-base-iterator",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Base iterator for extract iterators like tar-iterator and zip-iterator",
5
5
  "keywords": [
6
6
  "extract",