7z-iterator 0.2.2 → 0.2.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,8 +1,8 @@
1
1
  {
2
2
  "name": "lzma-purejs-vendored",
3
3
  "version": "0.9.3",
4
- "type": "commonjs",
5
- "main": "index.js",
4
+ "description": "Vendored lzma-purejs with LZMA2 solid mode support",
6
5
  "license": "BSD",
7
- "description": "Vendored lzma-purejs with LZMA2 solid mode support"
6
+ "type": "commonjs",
7
+ "main": "index.js"
8
8
  }
@@ -14,10 +14,16 @@ export declare var hasNativeLzma: boolean;
14
14
  * Create a native LZMA2 decoder stream
15
15
  * Returns a Transform stream that decodes LZMA2 data
16
16
  *
17
- * @param dictSize - Dictionary size
18
- * @returns Transform stream for decoding, or null if native not available
17
+ * Note: Native LZMA2 decoder disabled due to LZMA_DATA_ERROR issues with
18
+ * lzma-native's rawDecoder for LZMA2. The native decoder fails partway through
19
+ * decompression on certain archives (e.g., Node.js Windows releases), reporting
20
+ * "Data is corrupt" even when the data is valid. Falls back to lzma-purejs
21
+ * which handles all LZMA2 streams correctly.
22
+ *
23
+ * @param _dictSize - Dictionary size (unused, native disabled)
24
+ * @returns null - always falls back to pure JS decoder
19
25
  */
20
- export declare function createNativeLzma2Decoder(dictSize?: number): Transform | null;
26
+ export declare function createNativeLzma2Decoder(_dictSize?: number): Transform | null;
21
27
  /**
22
28
  * Create a native LZMA1 decoder stream
23
29
  * Returns a Transform stream that decodes LZMA1 data
@@ -14,10 +14,16 @@ export declare var hasNativeLzma: boolean;
14
14
  * Create a native LZMA2 decoder stream
15
15
  * Returns a Transform stream that decodes LZMA2 data
16
16
  *
17
- * @param dictSize - Dictionary size
18
- * @returns Transform stream for decoding, or null if native not available
17
+ * Note: Native LZMA2 decoder disabled due to LZMA_DATA_ERROR issues with
18
+ * lzma-native's rawDecoder for LZMA2. The native decoder fails partway through
19
+ * decompression on certain archives (e.g., Node.js Windows releases), reporting
20
+ * "Data is corrupt" even when the data is valid. Falls back to lzma-purejs
21
+ * which handles all LZMA2 streams correctly.
22
+ *
23
+ * @param _dictSize - Dictionary size (unused, native disabled)
24
+ * @returns null - always falls back to pure JS decoder
19
25
  */
20
- export declare function createNativeLzma2Decoder(dictSize?: number): Transform | null;
26
+ export declare function createNativeLzma2Decoder(_dictSize?: number): Transform | null;
21
27
  /**
22
28
  * Create a native LZMA1 decoder stream
23
29
  * Returns a Transform stream that decodes LZMA1 data
@@ -51,21 +51,11 @@ if (major >= 10) {
51
51
  }
52
52
  }
53
53
  var hasNativeLzma = _hasNativeLzmaLib;
54
- function createNativeLzma2Decoder(dictSize) {
55
- if (!lzmaNative) {
56
- return null;
57
- }
58
- var filterOpts = {
59
- id: lzmaNative.FILTER_LZMA2
60
- };
61
- if (dictSize !== undefined) {
62
- filterOpts.dict_size = dictSize;
63
- }
64
- return lzmaNative.createStream('rawDecoder', {
65
- filters: [
66
- filterOpts
67
- ]
68
- });
54
+ function createNativeLzma2Decoder(_dictSize) {
55
+ // Native LZMA2 disabled - lzma-native's rawDecoder has issues with certain
56
+ // LZMA2 streams (LZMA_DATA_ERROR: Data is corrupt), even when data is valid.
57
+ // The pure JS lzma-purejs implementation handles all streams correctly.
58
+ return null;
69
59
  }
70
60
  function createNativeLzma1Decoder(_lc, _lp, _pb, _dictSize) {
71
61
  // Native LZMA1 disabled - lzma-native's rawDecoder has issues with 7z's LZMA1 format
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/7z-iterator/src/sevenz/codecs/lzmaCompat.ts"],"sourcesContent":["/**\n * LZMA compatibility layer - uses native lzma when available, falls back to lzma-purejs\n *\n * lzma-native provides native liblzma bindings with rawDecoder support.\n * This gives significant performance improvements on Node.js 8+ while\n * maintaining compatibility with Node.js 0.8+ via lzma-purejs fallback.\n *\n * The native decoder uses Node.js streams which integrate naturally with\n * the callback-based async pattern used throughout the iterator libraries.\n */\n\nimport Module from 'module';\nimport type { Transform } from 'readable-stream';\n\nvar _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\n\n// Try to load lzma-native (only on Node 10+ where ES6 class syntax is supported)\n// Note: We must check the version BEFORE requiring because syntax errors during\n// module parsing cannot be caught by try/catch\nvar lzmaNative: typeof import('lzma-native') | null = null;\nvar _hasNativeLzmaLib = false;\nvar major = +process.versions.node.split('.')[0];\n\nif (major >= 10) {\n try {\n lzmaNative = _require('lzma-native');\n // Verify rawDecoder support\n _hasNativeLzmaLib = lzmaNative !== null && typeof lzmaNative.createStream === 'function';\n } catch (_e) {\n // lzma-native not available - will use lzma-purejs\n }\n}\n\n// Export whether native lzma is available for streaming\nexport var hasNativeLzma = _hasNativeLzmaLib;\n\n/**\n * Create a native LZMA2 decoder stream\n * Returns a Transform stream that decodes LZMA2 data\n *\n * @param dictSize - Dictionary size\n * @returns Transform stream for decoding, or null if native not available\n */\nexport function createNativeLzma2Decoder(dictSize?: number): Transform | null {\n if (!lzmaNative) {\n return null;\n }\n\n var filterOpts: { id: string; dict_size?: number } = {\n id: lzmaNative.FILTER_LZMA2,\n };\n\n if (dictSize !== undefined) {\n filterOpts.dict_size = dictSize;\n }\n\n return lzmaNative.createStream('rawDecoder', {\n filters: [filterOpts],\n }) as unknown as Transform;\n}\n\n/**\n * Create a native LZMA1 decoder stream\n * Returns a Transform stream that decodes LZMA1 data\n *\n * Note: Native LZMA1 decoder disabled due to LZMA_BUF_ERROR issues with\n * lzma-native's rawDecoder for LZMA1. Falls back to lzma-purejs which\n * handles 7z's LZMA1 format correctly. LZMA2 native works fine.\n *\n * @param _lc - Literal context bits (0-8)\n * @param _lp - Literal position bits (0-4)\n * @param _pb - Position bits (0-4)\n * @param _dictSize - Dictionary size\n * @returns null - always falls back to pure JS decoder\n */\nexport function createNativeLzma1Decoder(_lc: number, _lp: number, _pb: number, _dictSize: number): Transform | null {\n // Native LZMA1 disabled - lzma-native's rawDecoder has issues with 7z's LZMA1 format\n // (LZMA_BUF_ERROR: No progress is possible)\n // LZMA2 native works correctly and is more common in modern 7z files\n return null;\n}\n"],"names":["createNativeLzma1Decoder","createNativeLzma2Decoder","hasNativeLzma","_require","require","Module","createRequire","lzmaNative","_hasNativeLzmaLib","major","process","versions","node","split","createStream","_e","dictSize","filterOpts","id","FILTER_LZMA2","undefined","dict_size","filters","_lc","_lp","_pb","_dictSize"],"mappings":"AAAA;;;;;;;;;CASC;;;;;;;;;;;QAkEeA;eAAAA;;QAhCAC;eAAAA;;QATLC;eAAAA;;;6DAvBQ;;;;;;AAGnB,IAAIC,WAAW,OAAOC,YAAY,cAAcC,eAAM,CAACC,aAAa,CAAC,uDAAmBF;AAExF,iFAAiF;AACjF,gFAAgF;AAChF,+CAA+C;AAC/C,IAAIG,aAAkD;AACtD,IAAIC,oBAAoB;AACxB,IAAIC,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAEhD,IAAIJ,SAAS,IAAI;IACf,IAAI;QACFF,aAAaJ,SAAS;QACtB,4BAA4B;QAC5BK,oBAAoBD,eAAe,QAAQ,OAAOA,WAAWO,YAAY,KAAK;IAChF,EAAE,OAAOC,IAAI;IACX,mDAAmD;IACrD;AACF;AAGO,IAAIb,gBAAgBM;AASpB,SAASP,yBAAyBe,QAAiB;IACxD,IAAI,CAACT,YAAY;QACf,OAAO;IACT;IAEA,IAAIU,aAAiD;QACnDC,IAAIX,WAAWY,YAAY;IAC7B;IAEA,IAAIH,aAAaI,WAAW;QAC1BH,WAAWI,SAAS,GAAGL;IACzB;IAEA,OAAOT,WAAWO,YAAY,CAAC,cAAc;QAC3CQ,SAAS;YAACL;SAAW;IACvB;AACF;AAgBO,SAASjB,yBAAyBuB,GAAW,EAAEC,GAAW,EAAEC,GAAW,EAAEC,SAAiB;IAC/F,qFAAqF;IACrF,4CAA4C;IAC5C,qEAAqE;IACrE,OAAO;AACT"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/7z-iterator/src/sevenz/codecs/lzmaCompat.ts"],"sourcesContent":["/**\n * LZMA compatibility layer - uses native lzma when available, falls back to lzma-purejs\n *\n * lzma-native provides native liblzma bindings with rawDecoder support.\n * This gives significant performance improvements on Node.js 8+ while\n * maintaining compatibility with Node.js 0.8+ via lzma-purejs fallback.\n *\n * The native decoder uses Node.js streams which integrate naturally with\n * the callback-based async pattern used throughout the iterator libraries.\n */\n\nimport Module from 'module';\nimport type { Transform } from 'readable-stream';\n\nvar _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\n\n// Try to load lzma-native (only on Node 10+ where ES6 class syntax is supported)\n// Note: We must check the version BEFORE requiring because syntax errors during\n// module parsing cannot be caught by try/catch\nvar lzmaNative: typeof import('lzma-native') | null = null;\nvar _hasNativeLzmaLib = false;\nvar major = +process.versions.node.split('.')[0];\n\nif (major >= 10) {\n try {\n lzmaNative = _require('lzma-native');\n // Verify rawDecoder support\n _hasNativeLzmaLib = lzmaNative !== null && typeof lzmaNative.createStream === 'function';\n } catch (_e) {\n // lzma-native not available - will use lzma-purejs\n }\n}\n\n// Export whether native lzma is available for streaming\nexport var hasNativeLzma = _hasNativeLzmaLib;\n\n/**\n * Create a native LZMA2 decoder stream\n * Returns a Transform stream that decodes LZMA2 data\n *\n * Note: Native LZMA2 decoder disabled due to LZMA_DATA_ERROR issues with\n * lzma-native's rawDecoder for LZMA2. The native decoder fails partway through\n * decompression on certain archives (e.g., Node.js Windows releases), reporting\n * \"Data is corrupt\" even when the data is valid. Falls back to lzma-purejs\n * which handles all LZMA2 streams correctly.\n *\n * @param _dictSize - Dictionary size (unused, native disabled)\n * @returns null - always falls back to pure JS decoder\n */\nexport function createNativeLzma2Decoder(_dictSize?: number): Transform | null {\n // Native LZMA2 disabled - lzma-native's rawDecoder has issues with certain\n // LZMA2 streams (LZMA_DATA_ERROR: Data is corrupt), even when data is valid.\n // The pure JS lzma-purejs implementation handles all streams correctly.\n return null;\n}\n\n/**\n * Create a native LZMA1 decoder stream\n * Returns a Transform stream that decodes LZMA1 data\n *\n * Note: Native LZMA1 decoder disabled due to LZMA_BUF_ERROR issues with\n * lzma-native's rawDecoder for LZMA1. Falls back to lzma-purejs which\n * handles 7z's LZMA1 format correctly. LZMA2 native works fine.\n *\n * @param _lc - Literal context bits (0-8)\n * @param _lp - Literal position bits (0-4)\n * @param _pb - Position bits (0-4)\n * @param _dictSize - Dictionary size\n * @returns null - always falls back to pure JS decoder\n */\nexport function createNativeLzma1Decoder(_lc: number, _lp: number, _pb: number, _dictSize: number): Transform | null {\n // Native LZMA1 disabled - lzma-native's rawDecoder has issues with 7z's LZMA1 format\n // (LZMA_BUF_ERROR: No progress is possible)\n // LZMA2 native works correctly and is more common in modern 7z files\n return null;\n}\n"],"names":["createNativeLzma1Decoder","createNativeLzma2Decoder","hasNativeLzma","_require","require","Module","createRequire","lzmaNative","_hasNativeLzmaLib","major","process","versions","node","split","createStream","_e","_dictSize","_lc","_lp","_pb"],"mappings":"AAAA;;;;;;;;;CASC;;;;;;;;;;;QA6DeA;eAAAA;;QArBAC;eAAAA;;QAfLC;eAAAA;;;6DAvBQ;;;;;;AAGnB,IAAIC,WAAW,OAAOC,YAAY,cAAcC,eAAM,CAACC,aAAa,CAAC,uDAAmBF;AAExF,iFAAiF;AACjF,gFAAgF;AAChF,+CAA+C;AAC/C,IAAIG,aAAkD;AACtD,IAAIC,oBAAoB;AACxB,IAAIC,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAEhD,IAAIJ,SAAS,IAAI;IACf,IAAI;QACFF,aAAaJ,SAAS;QACtB,4BAA4B;QAC5BK,oBAAoBD,eAAe,QAAQ,OAAOA,WAAWO,YAAY,KAAK;IAChF,EAAE,OAAOC,IAAI;IACX,mDAAmD;IACrD;AACF;AAGO,IAAIb,gBAAgBM;AAepB,SAASP,yBAAyBe,SAAkB;IACzD,2EAA2E;IAC3E,6EAA6E;IAC7E,wEAAwE;IACxE,OAAO;AACT;AAgBO,SAAShB,yBAAyBiB,GAAW,EAAEC,GAAW,EAAEC,GAAW,EAAEH,SAAiB;IAC/F,qFAAqF;IACrF,4CAA4C;IAC5C,qEAAqE;IACrE,OAAO;AACT"}
@@ -14,10 +14,16 @@ export declare var hasNativeLzma: boolean;
14
14
  * Create a native LZMA2 decoder stream
15
15
  * Returns a Transform stream that decodes LZMA2 data
16
16
  *
17
- * @param dictSize - Dictionary size
18
- * @returns Transform stream for decoding, or null if native not available
17
+ * Note: Native LZMA2 decoder disabled due to LZMA_DATA_ERROR issues with
18
+ * lzma-native's rawDecoder for LZMA2. The native decoder fails partway through
19
+ * decompression on certain archives (e.g., Node.js Windows releases), reporting
20
+ * "Data is corrupt" even when the data is valid. Falls back to lzma-purejs
21
+ * which handles all LZMA2 streams correctly.
22
+ *
23
+ * @param _dictSize - Dictionary size (unused, native disabled)
24
+ * @returns null - always falls back to pure JS decoder
19
25
  */
20
- export declare function createNativeLzma2Decoder(dictSize?: number): Transform | null;
26
+ export declare function createNativeLzma2Decoder(_dictSize?: number): Transform | null;
21
27
  /**
22
28
  * Create a native LZMA1 decoder stream
23
29
  * Returns a Transform stream that decodes LZMA1 data
@@ -30,23 +30,19 @@ export var hasNativeLzma = _hasNativeLzmaLib;
30
30
  * Create a native LZMA2 decoder stream
31
31
  * Returns a Transform stream that decodes LZMA2 data
32
32
  *
33
- * @param dictSize - Dictionary size
34
- * @returns Transform stream for decoding, or null if native not available
35
- */ export function createNativeLzma2Decoder(dictSize) {
36
- if (!lzmaNative) {
37
- return null;
38
- }
39
- var filterOpts = {
40
- id: lzmaNative.FILTER_LZMA2
41
- };
42
- if (dictSize !== undefined) {
43
- filterOpts.dict_size = dictSize;
44
- }
45
- return lzmaNative.createStream('rawDecoder', {
46
- filters: [
47
- filterOpts
48
- ]
49
- });
33
+ * Note: Native LZMA2 decoder disabled due to LZMA_DATA_ERROR issues with
34
+ * lzma-native's rawDecoder for LZMA2. The native decoder fails partway through
35
+ * decompression on certain archives (e.g., Node.js Windows releases), reporting
36
+ * "Data is corrupt" even when the data is valid. Falls back to lzma-purejs
37
+ * which handles all LZMA2 streams correctly.
38
+ *
39
+ * @param _dictSize - Dictionary size (unused, native disabled)
40
+ * @returns null - always falls back to pure JS decoder
41
+ */ export function createNativeLzma2Decoder(_dictSize) {
42
+ // Native LZMA2 disabled - lzma-native's rawDecoder has issues with certain
43
+ // LZMA2 streams (LZMA_DATA_ERROR: Data is corrupt), even when data is valid.
44
+ // The pure JS lzma-purejs implementation handles all streams correctly.
45
+ return null;
50
46
  }
51
47
  /**
52
48
  * Create a native LZMA1 decoder stream
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/7z-iterator/src/sevenz/codecs/lzmaCompat.ts"],"sourcesContent":["/**\n * LZMA compatibility layer - uses native lzma when available, falls back to lzma-purejs\n *\n * lzma-native provides native liblzma bindings with rawDecoder support.\n * This gives significant performance improvements on Node.js 8+ while\n * maintaining compatibility with Node.js 0.8+ via lzma-purejs fallback.\n *\n * The native decoder uses Node.js streams which integrate naturally with\n * the callback-based async pattern used throughout the iterator libraries.\n */\n\nimport Module from 'module';\nimport type { Transform } from 'readable-stream';\n\nvar _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\n\n// Try to load lzma-native (only on Node 10+ where ES6 class syntax is supported)\n// Note: We must check the version BEFORE requiring because syntax errors during\n// module parsing cannot be caught by try/catch\nvar lzmaNative: typeof import('lzma-native') | null = null;\nvar _hasNativeLzmaLib = false;\nvar major = +process.versions.node.split('.')[0];\n\nif (major >= 10) {\n try {\n lzmaNative = _require('lzma-native');\n // Verify rawDecoder support\n _hasNativeLzmaLib = lzmaNative !== null && typeof lzmaNative.createStream === 'function';\n } catch (_e) {\n // lzma-native not available - will use lzma-purejs\n }\n}\n\n// Export whether native lzma is available for streaming\nexport var hasNativeLzma = _hasNativeLzmaLib;\n\n/**\n * Create a native LZMA2 decoder stream\n * Returns a Transform stream that decodes LZMA2 data\n *\n * @param dictSize - Dictionary size\n * @returns Transform stream for decoding, or null if native not available\n */\nexport function createNativeLzma2Decoder(dictSize?: number): Transform | null {\n if (!lzmaNative) {\n return null;\n }\n\n var filterOpts: { id: string; dict_size?: number } = {\n id: lzmaNative.FILTER_LZMA2,\n };\n\n if (dictSize !== undefined) {\n filterOpts.dict_size = dictSize;\n }\n\n return lzmaNative.createStream('rawDecoder', {\n filters: [filterOpts],\n }) as unknown as Transform;\n}\n\n/**\n * Create a native LZMA1 decoder stream\n * Returns a Transform stream that decodes LZMA1 data\n *\n * Note: Native LZMA1 decoder disabled due to LZMA_BUF_ERROR issues with\n * lzma-native's rawDecoder for LZMA1. Falls back to lzma-purejs which\n * handles 7z's LZMA1 format correctly. LZMA2 native works fine.\n *\n * @param _lc - Literal context bits (0-8)\n * @param _lp - Literal position bits (0-4)\n * @param _pb - Position bits (0-4)\n * @param _dictSize - Dictionary size\n * @returns null - always falls back to pure JS decoder\n */\nexport function createNativeLzma1Decoder(_lc: number, _lp: number, _pb: number, _dictSize: number): Transform | null {\n // Native LZMA1 disabled - lzma-native's rawDecoder has issues with 7z's LZMA1 format\n // (LZMA_BUF_ERROR: No progress is possible)\n // LZMA2 native works correctly and is more common in modern 7z files\n return null;\n}\n"],"names":["Module","_require","require","createRequire","url","lzmaNative","_hasNativeLzmaLib","major","process","versions","node","split","createStream","_e","hasNativeLzma","createNativeLzma2Decoder","dictSize","filterOpts","id","FILTER_LZMA2","undefined","dict_size","filters","createNativeLzma1Decoder","_lc","_lp","_pb","_dictSize"],"mappings":"AAAA;;;;;;;;;CASC,GAED,OAAOA,YAAY,SAAS;AAG5B,IAAIC,WAAW,OAAOC,YAAY,cAAcF,OAAOG,aAAa,CAAC,YAAYC,GAAG,IAAIF;AAExF,iFAAiF;AACjF,gFAAgF;AAChF,+CAA+C;AAC/C,IAAIG,aAAkD;AACtD,IAAIC,oBAAoB;AACxB,IAAIC,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAEhD,IAAIJ,SAAS,IAAI;IACf,IAAI;QACFF,aAAaJ,SAAS;QACtB,4BAA4B;QAC5BK,oBAAoBD,eAAe,QAAQ,OAAOA,WAAWO,YAAY,KAAK;IAChF,EAAE,OAAOC,IAAI;IACX,mDAAmD;IACrD;AACF;AAEA,wDAAwD;AACxD,OAAO,IAAIC,gBAAgBR,kBAAkB;AAE7C;;;;;;CAMC,GACD,OAAO,SAASS,yBAAyBC,QAAiB;IACxD,IAAI,CAACX,YAAY;QACf,OAAO;IACT;IAEA,IAAIY,aAAiD;QACnDC,IAAIb,WAAWc,YAAY;IAC7B;IAEA,IAAIH,aAAaI,WAAW;QAC1BH,WAAWI,SAAS,GAAGL;IACzB;IAEA,OAAOX,WAAWO,YAAY,CAAC,cAAc;QAC3CU,SAAS;YAACL;SAAW;IACvB;AACF;AAEA;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASM,yBAAyBC,GAAW,EAAEC,GAAW,EAAEC,GAAW,EAAEC,SAAiB;IAC/F,qFAAqF;IACrF,4CAA4C;IAC5C,qEAAqE;IACrE,OAAO;AACT"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/7z-iterator/src/sevenz/codecs/lzmaCompat.ts"],"sourcesContent":["/**\n * LZMA compatibility layer - uses native lzma when available, falls back to lzma-purejs\n *\n * lzma-native provides native liblzma bindings with rawDecoder support.\n * This gives significant performance improvements on Node.js 8+ while\n * maintaining compatibility with Node.js 0.8+ via lzma-purejs fallback.\n *\n * The native decoder uses Node.js streams which integrate naturally with\n * the callback-based async pattern used throughout the iterator libraries.\n */\n\nimport Module from 'module';\nimport type { Transform } from 'readable-stream';\n\nvar _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\n\n// Try to load lzma-native (only on Node 10+ where ES6 class syntax is supported)\n// Note: We must check the version BEFORE requiring because syntax errors during\n// module parsing cannot be caught by try/catch\nvar lzmaNative: typeof import('lzma-native') | null = null;\nvar _hasNativeLzmaLib = false;\nvar major = +process.versions.node.split('.')[0];\n\nif (major >= 10) {\n try {\n lzmaNative = _require('lzma-native');\n // Verify rawDecoder support\n _hasNativeLzmaLib = lzmaNative !== null && typeof lzmaNative.createStream === 'function';\n } catch (_e) {\n // lzma-native not available - will use lzma-purejs\n }\n}\n\n// Export whether native lzma is available for streaming\nexport var hasNativeLzma = _hasNativeLzmaLib;\n\n/**\n * Create a native LZMA2 decoder stream\n * Returns a Transform stream that decodes LZMA2 data\n *\n * Note: Native LZMA2 decoder disabled due to LZMA_DATA_ERROR issues with\n * lzma-native's rawDecoder for LZMA2. The native decoder fails partway through\n * decompression on certain archives (e.g., Node.js Windows releases), reporting\n * \"Data is corrupt\" even when the data is valid. Falls back to lzma-purejs\n * which handles all LZMA2 streams correctly.\n *\n * @param _dictSize - Dictionary size (unused, native disabled)\n * @returns null - always falls back to pure JS decoder\n */\nexport function createNativeLzma2Decoder(_dictSize?: number): Transform | null {\n // Native LZMA2 disabled - lzma-native's rawDecoder has issues with certain\n // LZMA2 streams (LZMA_DATA_ERROR: Data is corrupt), even when data is valid.\n // The pure JS lzma-purejs implementation handles all streams correctly.\n return null;\n}\n\n/**\n * Create a native LZMA1 decoder stream\n * Returns a Transform stream that decodes LZMA1 data\n *\n * Note: Native LZMA1 decoder disabled due to LZMA_BUF_ERROR issues with\n * lzma-native's rawDecoder for LZMA1. Falls back to lzma-purejs which\n * handles 7z's LZMA1 format correctly. LZMA2 native works fine.\n *\n * @param _lc - Literal context bits (0-8)\n * @param _lp - Literal position bits (0-4)\n * @param _pb - Position bits (0-4)\n * @param _dictSize - Dictionary size\n * @returns null - always falls back to pure JS decoder\n */\nexport function createNativeLzma1Decoder(_lc: number, _lp: number, _pb: number, _dictSize: number): Transform | null {\n // Native LZMA1 disabled - lzma-native's rawDecoder has issues with 7z's LZMA1 format\n // (LZMA_BUF_ERROR: No progress is possible)\n // LZMA2 native works correctly and is more common in modern 7z files\n return null;\n}\n"],"names":["Module","_require","require","createRequire","url","lzmaNative","_hasNativeLzmaLib","major","process","versions","node","split","createStream","_e","hasNativeLzma","createNativeLzma2Decoder","_dictSize","createNativeLzma1Decoder","_lc","_lp","_pb"],"mappings":"AAAA;;;;;;;;;CASC,GAED,OAAOA,YAAY,SAAS;AAG5B,IAAIC,WAAW,OAAOC,YAAY,cAAcF,OAAOG,aAAa,CAAC,YAAYC,GAAG,IAAIF;AAExF,iFAAiF;AACjF,gFAAgF;AAChF,+CAA+C;AAC/C,IAAIG,aAAkD;AACtD,IAAIC,oBAAoB;AACxB,IAAIC,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAEhD,IAAIJ,SAAS,IAAI;IACf,IAAI;QACFF,aAAaJ,SAAS;QACtB,4BAA4B;QAC5BK,oBAAoBD,eAAe,QAAQ,OAAOA,WAAWO,YAAY,KAAK;IAChF,EAAE,OAAOC,IAAI;IACX,mDAAmD;IACrD;AACF;AAEA,wDAAwD;AACxD,OAAO,IAAIC,gBAAgBR,kBAAkB;AAE7C;;;;;;;;;;;;CAYC,GACD,OAAO,SAASS,yBAAyBC,SAAkB;IACzD,2EAA2E;IAC3E,6EAA6E;IAC7E,wEAAwE;IACxE,OAAO;AACT;AAEA;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASC,yBAAyBC,GAAW,EAAEC,GAAW,EAAEC,GAAW,EAAEJ,SAAiB;IAC/F,qFAAqF;IACrF,4CAA4C;IAC5C,qEAAqE;IACrE,OAAO;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "7z-iterator",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Extract contents from 7z archives using an iterator API. Pure JavaScript, works on Node.js 0.8+",
5
5
  "keywords": [
6
6
  "extract",
@@ -32,6 +32,7 @@
32
32
  "./package.json": "./package.json"
33
33
  },
34
34
  "main": "dist/cjs/index.js",
35
+ "source": "src/index.ts",
35
36
  "types": "dist/cjs/index.d.ts",
36
37
  "files": [
37
38
  "dist",
@@ -39,7 +40,7 @@
39
40
  ],
40
41
  "scripts": {
41
42
  "build": "tsds build",
42
- "format": "biome check --write --unsafe",
43
+ "format": "tsds format",
43
44
  "prepublishOnly": "tsds validate",
44
45
  "test": "tsds test:node --no-timeouts",
45
46
  "test:engines": "nvu engines tsds test:node --no-timeouts",
@@ -60,24 +61,21 @@
60
61
  "temp-suffix": "*"
61
62
  },
62
63
  "devDependencies": {
63
- "@biomejs/biome": "*",
64
64
  "@types/mocha": "*",
65
65
  "@types/node": "*",
66
66
  "fs-iterator": "*",
67
67
  "fs-stats-spys": "*",
68
- "get-remote": "^2.2.2",
68
+ "get-remote": "^2.2.5",
69
69
  "lzma-native": "^8.0.6",
70
70
  "node-version-use": "*",
71
71
  "pinkie-promise": "*",
72
- "ts-dev-stack": "*"
72
+ "ts-dev-stack": "*",
73
+ "tsds-config": "*"
73
74
  },
74
75
  "optionalDependencies": {
75
76
  "lzma-native": "^8.0.6"
76
77
  },
77
78
  "engines": {
78
79
  "node": ">=0.8"
79
- },
80
- "tsds": {
81
- "source": "src/index.ts"
82
80
  }
83
81
  }