@openardf/radio-oracle 1.0.3 → 1.0.5

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.
Files changed (641) hide show
  1. package/jdeploy-bundle/Radio-Oracle-jdeploy.jar +0 -0
  2. package/node_modules/@isaacs/fs-minipass/LICENSE +15 -0
  3. package/node_modules/@isaacs/fs-minipass/README.md +71 -0
  4. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts +118 -0
  5. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts.map +1 -0
  6. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +430 -0
  7. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js.map +1 -0
  8. package/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +3 -0
  9. package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts +118 -0
  10. package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts.map +1 -0
  11. package/node_modules/@isaacs/fs-minipass/dist/esm/index.js +420 -0
  12. package/node_modules/@isaacs/fs-minipass/dist/esm/index.js.map +1 -0
  13. package/node_modules/@isaacs/fs-minipass/dist/esm/package.json +3 -0
  14. package/node_modules/@isaacs/fs-minipass/package.json +72 -0
  15. package/node_modules/balanced-match/.github/FUNDING.yml +2 -0
  16. package/node_modules/balanced-match/LICENSE.md +21 -0
  17. package/node_modules/balanced-match/README.md +97 -0
  18. package/node_modules/balanced-match/index.js +62 -0
  19. package/node_modules/balanced-match/package.json +48 -0
  20. package/node_modules/brace-expansion/LICENSE +21 -0
  21. package/node_modules/brace-expansion/README.md +129 -0
  22. package/node_modules/brace-expansion/index.js +203 -0
  23. package/node_modules/brace-expansion/package.json +50 -0
  24. package/node_modules/chownr/LICENSE.md +63 -0
  25. package/node_modules/chownr/README.md +3 -0
  26. package/node_modules/chownr/dist/commonjs/index.d.ts +3 -0
  27. package/node_modules/chownr/dist/commonjs/index.d.ts.map +1 -0
  28. package/node_modules/chownr/dist/commonjs/index.js +93 -0
  29. package/node_modules/chownr/dist/commonjs/index.js.map +1 -0
  30. package/node_modules/chownr/dist/commonjs/package.json +3 -0
  31. package/node_modules/chownr/dist/esm/index.d.ts +3 -0
  32. package/node_modules/chownr/dist/esm/index.d.ts.map +1 -0
  33. package/node_modules/chownr/dist/esm/index.js +85 -0
  34. package/node_modules/chownr/dist/esm/index.js.map +1 -0
  35. package/node_modules/chownr/dist/esm/package.json +3 -0
  36. package/node_modules/chownr/package.json +69 -0
  37. package/node_modules/concat-map/.travis.yml +4 -0
  38. package/node_modules/concat-map/LICENSE +18 -0
  39. package/node_modules/concat-map/README.markdown +62 -0
  40. package/node_modules/concat-map/example/map.js +6 -0
  41. package/node_modules/concat-map/index.js +13 -0
  42. package/node_modules/concat-map/package.json +43 -0
  43. package/node_modules/concat-map/test/map.js +39 -0
  44. package/node_modules/es-errors/.eslintrc +5 -0
  45. package/node_modules/es-errors/.github/FUNDING.yml +12 -0
  46. package/node_modules/es-errors/CHANGELOG.md +40 -0
  47. package/node_modules/es-errors/LICENSE +21 -0
  48. package/node_modules/es-errors/README.md +55 -0
  49. package/node_modules/es-errors/eval.d.ts +3 -0
  50. package/node_modules/es-errors/eval.js +4 -0
  51. package/node_modules/es-errors/index.d.ts +3 -0
  52. package/node_modules/es-errors/index.js +4 -0
  53. package/node_modules/es-errors/package.json +80 -0
  54. package/node_modules/es-errors/range.d.ts +3 -0
  55. package/node_modules/es-errors/range.js +4 -0
  56. package/node_modules/es-errors/ref.d.ts +3 -0
  57. package/node_modules/es-errors/ref.js +4 -0
  58. package/node_modules/es-errors/syntax.d.ts +3 -0
  59. package/node_modules/es-errors/syntax.js +4 -0
  60. package/node_modules/es-errors/test/index.js +19 -0
  61. package/node_modules/es-errors/tsconfig.json +49 -0
  62. package/node_modules/es-errors/type.d.ts +3 -0
  63. package/node_modules/es-errors/type.js +4 -0
  64. package/node_modules/es-errors/uri.d.ts +3 -0
  65. package/node_modules/es-errors/uri.js +4 -0
  66. package/node_modules/fs.realpath/LICENSE +43 -0
  67. package/node_modules/fs.realpath/README.md +33 -0
  68. package/node_modules/fs.realpath/index.js +66 -0
  69. package/node_modules/fs.realpath/old.js +303 -0
  70. package/node_modules/fs.realpath/package.json +26 -0
  71. package/node_modules/function-bind/.eslintrc +21 -0
  72. package/node_modules/function-bind/.github/FUNDING.yml +12 -0
  73. package/node_modules/function-bind/.github/SECURITY.md +3 -0
  74. package/node_modules/function-bind/.nycrc +13 -0
  75. package/node_modules/function-bind/CHANGELOG.md +136 -0
  76. package/node_modules/function-bind/LICENSE +20 -0
  77. package/node_modules/function-bind/README.md +46 -0
  78. package/node_modules/function-bind/implementation.js +84 -0
  79. package/node_modules/function-bind/index.js +5 -0
  80. package/node_modules/function-bind/package.json +87 -0
  81. package/node_modules/function-bind/test/.eslintrc +9 -0
  82. package/node_modules/function-bind/test/index.js +252 -0
  83. package/node_modules/glob/LICENSE +21 -0
  84. package/node_modules/glob/README.md +378 -0
  85. package/node_modules/glob/common.js +238 -0
  86. package/node_modules/glob/glob.js +790 -0
  87. package/node_modules/glob/package.json +55 -0
  88. package/node_modules/glob/sync.js +486 -0
  89. package/node_modules/hasown/.github/FUNDING.yml +12 -0
  90. package/node_modules/hasown/.nycrc +13 -0
  91. package/node_modules/hasown/CHANGELOG.md +58 -0
  92. package/node_modules/hasown/LICENSE +21 -0
  93. package/node_modules/hasown/README.md +40 -0
  94. package/node_modules/hasown/eslint.config.mjs +6 -0
  95. package/node_modules/hasown/index.d.ts +3 -0
  96. package/node_modules/hasown/index.js +8 -0
  97. package/node_modules/hasown/package.json +91 -0
  98. package/node_modules/hasown/tsconfig.json +6 -0
  99. package/node_modules/inflight/LICENSE +15 -0
  100. package/node_modules/inflight/README.md +37 -0
  101. package/node_modules/inflight/inflight.js +54 -0
  102. package/node_modules/inflight/package.json +29 -0
  103. package/node_modules/inherits/LICENSE +16 -0
  104. package/node_modules/inherits/README.md +42 -0
  105. package/node_modules/inherits/inherits.js +9 -0
  106. package/node_modules/inherits/inherits_browser.js +27 -0
  107. package/node_modules/inherits/package.json +29 -0
  108. package/node_modules/interpret/CHANGELOG +115 -0
  109. package/node_modules/interpret/LICENSE +22 -0
  110. package/node_modules/interpret/README.md +187 -0
  111. package/node_modules/interpret/index.js +168 -0
  112. package/node_modules/interpret/mjs-stub.js +1 -0
  113. package/node_modules/interpret/package.json +75 -0
  114. package/node_modules/is-core-module/.eslintrc +18 -0
  115. package/node_modules/is-core-module/.nycrc +9 -0
  116. package/node_modules/is-core-module/CHANGELOG.md +349 -0
  117. package/node_modules/is-core-module/LICENSE +20 -0
  118. package/node_modules/is-core-module/README.md +40 -0
  119. package/node_modules/is-core-module/core.json +162 -0
  120. package/node_modules/is-core-module/index.js +69 -0
  121. package/node_modules/is-core-module/package.json +76 -0
  122. package/node_modules/is-core-module/test/index.js +258 -0
  123. package/node_modules/minimatch/LICENSE +15 -0
  124. package/node_modules/minimatch/README.md +267 -0
  125. package/node_modules/minimatch/minimatch.js +1005 -0
  126. package/node_modules/minimatch/package.json +33 -0
  127. package/node_modules/minipass/LICENSE.md +55 -0
  128. package/node_modules/minipass/README.md +825 -0
  129. package/node_modules/minipass/dist/commonjs/index.d.ts +545 -0
  130. package/node_modules/minipass/dist/commonjs/index.d.ts.map +1 -0
  131. package/node_modules/minipass/dist/commonjs/index.js +1038 -0
  132. package/node_modules/minipass/dist/commonjs/index.js.map +1 -0
  133. package/node_modules/minipass/dist/commonjs/package.json +3 -0
  134. package/node_modules/minipass/dist/esm/index.d.ts +545 -0
  135. package/node_modules/minipass/dist/esm/index.d.ts.map +1 -0
  136. package/node_modules/minipass/dist/esm/index.js +1020 -0
  137. package/node_modules/minipass/dist/esm/index.js.map +1 -0
  138. package/node_modules/minipass/dist/esm/package.json +3 -0
  139. package/node_modules/minipass/package.json +77 -0
  140. package/node_modules/minizlib/LICENSE +26 -0
  141. package/node_modules/minizlib/README.md +64 -0
  142. package/node_modules/minizlib/dist/commonjs/constants.d.ts +2 -0
  143. package/node_modules/minizlib/dist/commonjs/constants.d.ts.map +1 -0
  144. package/node_modules/minizlib/dist/commonjs/constants.js +123 -0
  145. package/node_modules/minizlib/dist/commonjs/constants.js.map +1 -0
  146. package/node_modules/minizlib/dist/commonjs/index.d.ts +99 -0
  147. package/node_modules/minizlib/dist/commonjs/index.d.ts.map +1 -0
  148. package/node_modules/minizlib/dist/commonjs/index.js +416 -0
  149. package/node_modules/minizlib/dist/commonjs/index.js.map +1 -0
  150. package/node_modules/minizlib/dist/commonjs/package.json +3 -0
  151. package/node_modules/minizlib/dist/esm/constants.d.ts +2 -0
  152. package/node_modules/minizlib/dist/esm/constants.d.ts.map +1 -0
  153. package/node_modules/minizlib/dist/esm/constants.js +117 -0
  154. package/node_modules/minizlib/dist/esm/constants.js.map +1 -0
  155. package/node_modules/minizlib/dist/esm/index.d.ts +99 -0
  156. package/node_modules/minizlib/dist/esm/index.d.ts.map +1 -0
  157. package/node_modules/minizlib/dist/esm/index.js +363 -0
  158. package/node_modules/minizlib/dist/esm/index.js.map +1 -0
  159. package/node_modules/minizlib/dist/esm/package.json +3 -0
  160. package/node_modules/minizlib/package.json +80 -0
  161. package/node_modules/node-fetch/LICENSE.md +22 -0
  162. package/node_modules/node-fetch/README.md +634 -0
  163. package/node_modules/node-fetch/browser.js +25 -0
  164. package/node_modules/node-fetch/lib/index.es.js +1777 -0
  165. package/node_modules/node-fetch/lib/index.js +1787 -0
  166. package/node_modules/node-fetch/lib/index.mjs +1775 -0
  167. package/node_modules/node-fetch/package.json +89 -0
  168. package/node_modules/once/LICENSE +15 -0
  169. package/node_modules/once/README.md +79 -0
  170. package/node_modules/once/once.js +42 -0
  171. package/node_modules/once/package.json +33 -0
  172. package/node_modules/path-is-absolute/index.js +20 -0
  173. package/node_modules/path-is-absolute/license +21 -0
  174. package/node_modules/path-is-absolute/package.json +43 -0
  175. package/node_modules/path-is-absolute/readme.md +59 -0
  176. package/node_modules/path-parse/LICENSE +21 -0
  177. package/node_modules/path-parse/README.md +42 -0
  178. package/node_modules/path-parse/index.js +75 -0
  179. package/node_modules/path-parse/package.json +33 -0
  180. package/node_modules/pend/LICENSE +23 -0
  181. package/node_modules/pend/README.md +41 -0
  182. package/node_modules/pend/index.js +55 -0
  183. package/node_modules/pend/package.json +18 -0
  184. package/node_modules/pend/test.js +137 -0
  185. package/node_modules/rechoir/.npmignore +1 -0
  186. package/node_modules/rechoir/.travis.yml +24 -0
  187. package/node_modules/rechoir/CHANGELOG +38 -0
  188. package/node_modules/rechoir/LICENSE +22 -0
  189. package/node_modules/rechoir/README.md +42 -0
  190. package/node_modules/rechoir/index.js +59 -0
  191. package/node_modules/rechoir/lib/extension.js +11 -0
  192. package/node_modules/rechoir/lib/normalize.js +15 -0
  193. package/node_modules/rechoir/lib/register.js +15 -0
  194. package/node_modules/rechoir/package.json +88 -0
  195. package/node_modules/resolve/.claude/notes.md +26 -0
  196. package/node_modules/resolve/.claude/settings.local.json +26 -0
  197. package/node_modules/resolve/.editorconfig +38 -0
  198. package/node_modules/resolve/.eslintrc +65 -0
  199. package/node_modules/resolve/.github/FUNDING.yml +12 -0
  200. package/node_modules/resolve/.github/INCIDENT_RESPONSE_PROCESS.md +119 -0
  201. package/node_modules/resolve/.github/THREAT_MODEL.md +74 -0
  202. package/node_modules/resolve/LICENSE +21 -0
  203. package/node_modules/resolve/SECURITY.md +13 -0
  204. package/node_modules/resolve/async.js +3 -0
  205. package/node_modules/resolve/bin/resolve +50 -0
  206. package/node_modules/resolve/eslint.config.mjs +80 -0
  207. package/node_modules/resolve/example/async.js +5 -0
  208. package/node_modules/resolve/example/sync.js +3 -0
  209. package/node_modules/resolve/index.js +6 -0
  210. package/node_modules/resolve/lib/async.js +336 -0
  211. package/node_modules/resolve/lib/caller.js +12 -0
  212. package/node_modules/resolve/lib/core.js +12 -0
  213. package/node_modules/resolve/lib/core.json +162 -0
  214. package/node_modules/resolve/lib/homedir.js +31 -0
  215. package/node_modules/resolve/lib/is-core.js +5 -0
  216. package/node_modules/resolve/lib/node-modules-paths.js +45 -0
  217. package/node_modules/resolve/lib/normalize-options.js +10 -0
  218. package/node_modules/resolve/lib/sync.js +216 -0
  219. package/node_modules/resolve/package.json +78 -0
  220. package/node_modules/resolve/readme.markdown +300 -0
  221. package/node_modules/resolve/sync.js +3 -0
  222. package/node_modules/resolve/test/core.js +88 -0
  223. package/node_modules/resolve/test/default_paths.js +49 -0
  224. package/node_modules/resolve/test/dotdot/abc/index.js +2 -0
  225. package/node_modules/resolve/test/dotdot/index.js +1 -0
  226. package/node_modules/resolve/test/dotdot.js +29 -0
  227. package/node_modules/resolve/test/faulty_basedir.js +29 -0
  228. package/node_modules/resolve/test/filter.js +34 -0
  229. package/node_modules/resolve/test/filter_sync.js +33 -0
  230. package/node_modules/resolve/test/home_paths.js +127 -0
  231. package/node_modules/resolve/test/home_paths_sync.js +114 -0
  232. package/node_modules/resolve/test/homedir.js +112 -0
  233. package/node_modules/resolve/test/mock.js +353 -0
  234. package/node_modules/resolve/test/mock_sync.js +234 -0
  235. package/node_modules/resolve/test/module_dir/xmodules/aaa/index.js +1 -0
  236. package/node_modules/resolve/test/module_dir/ymodules/aaa/index.js +1 -0
  237. package/node_modules/resolve/test/module_dir/zmodules/bbb/main.js +1 -0
  238. package/node_modules/resolve/test/module_dir/zmodules/bbb/package.json +3 -0
  239. package/node_modules/resolve/test/module_dir.js +56 -0
  240. package/node_modules/resolve/test/node-modules-paths.js +143 -0
  241. package/node_modules/resolve/test/node_path/x/aaa/index.js +1 -0
  242. package/node_modules/resolve/test/node_path/x/ccc/index.js +1 -0
  243. package/node_modules/resolve/test/node_path/y/bbb/index.js +1 -0
  244. package/node_modules/resolve/test/node_path/y/ccc/index.js +1 -0
  245. package/node_modules/resolve/test/node_path.js +70 -0
  246. package/node_modules/resolve/test/nonstring.js +9 -0
  247. package/node_modules/resolve/test/pathfilter/deep_ref/main.js +0 -0
  248. package/node_modules/resolve/test/pathfilter.js +75 -0
  249. package/node_modules/resolve/test/pathfilter_sync.js +24 -0
  250. package/node_modules/resolve/test/precedence/aaa/index.js +1 -0
  251. package/node_modules/resolve/test/precedence/aaa/main.js +1 -0
  252. package/node_modules/resolve/test/precedence/aaa.js +1 -0
  253. package/node_modules/resolve/test/precedence/bbb/main.js +1 -0
  254. package/node_modules/resolve/test/precedence/bbb.js +1 -0
  255. package/node_modules/resolve/test/precedence.js +23 -0
  256. package/node_modules/resolve/test/resolver/baz/doom.js +0 -0
  257. package/node_modules/resolve/test/resolver/baz/package.json +4 -0
  258. package/node_modules/resolve/test/resolver/baz/quux.js +1 -0
  259. package/node_modules/resolve/test/resolver/browser_field/a.js +0 -0
  260. package/node_modules/resolve/test/resolver/browser_field/b.js +0 -0
  261. package/node_modules/resolve/test/resolver/browser_field/package.json +5 -0
  262. package/node_modules/resolve/test/resolver/cup.coffee +1 -0
  263. package/node_modules/resolve/test/resolver/dot_main/index.js +1 -0
  264. package/node_modules/resolve/test/resolver/dot_main/package.json +3 -0
  265. package/node_modules/resolve/test/resolver/dot_slash_main/index.js +1 -0
  266. package/node_modules/resolve/test/resolver/dot_slash_main/package.json +3 -0
  267. package/node_modules/resolve/test/resolver/false_main/index.js +0 -0
  268. package/node_modules/resolve/test/resolver/false_main/package.json +4 -0
  269. package/node_modules/resolve/test/resolver/foo.js +1 -0
  270. package/node_modules/resolve/test/resolver/incorrect_main/index.js +2 -0
  271. package/node_modules/resolve/test/resolver/incorrect_main/package.json +3 -0
  272. package/node_modules/resolve/test/resolver/invalid_main/package.json +7 -0
  273. package/node_modules/resolve/test/resolver/mug.coffee +0 -0
  274. package/node_modules/resolve/test/resolver/mug.js +0 -0
  275. package/node_modules/resolve/test/resolver/multirepo/lerna.json +6 -0
  276. package/node_modules/resolve/test/resolver/multirepo/package.json +20 -0
  277. package/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js +35 -0
  278. package/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json +14 -0
  279. package/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js +0 -0
  280. package/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json +14 -0
  281. package/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js +26 -0
  282. package/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json +15 -0
  283. package/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js +12 -0
  284. package/node_modules/resolve/test/resolver/other_path/lib/other-lib.js +0 -0
  285. package/node_modules/resolve/test/resolver/other_path/root.js +0 -0
  286. package/node_modules/resolve/test/resolver/quux/foo/index.js +1 -0
  287. package/node_modules/resolve/test/resolver/same_names/foo/index.js +1 -0
  288. package/node_modules/resolve/test/resolver/same_names/foo.js +1 -0
  289. package/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js +0 -0
  290. package/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep +0 -0
  291. package/node_modules/resolve/test/resolver/symlinked/package/bar.js +1 -0
  292. package/node_modules/resolve/test/resolver/symlinked/package/package.json +3 -0
  293. package/node_modules/resolve/test/resolver/without_basedir/main.js +5 -0
  294. package/node_modules/resolve/test/resolver.js +597 -0
  295. package/node_modules/resolve/test/resolver_sync.js +730 -0
  296. package/node_modules/resolve/test/shadowed_core/node_modules/util/index.js +0 -0
  297. package/node_modules/resolve/test/shadowed_core.js +54 -0
  298. package/node_modules/resolve/test/subdirs.js +13 -0
  299. package/node_modules/resolve/test/symlinks.js +176 -0
  300. package/node_modules/shelljs/CHANGELOG.md +942 -0
  301. package/node_modules/shelljs/LICENSE +26 -0
  302. package/node_modules/shelljs/README.md +835 -0
  303. package/node_modules/shelljs/bin/shjs +48 -0
  304. package/node_modules/shelljs/commands.js +29 -0
  305. package/node_modules/shelljs/global.js +12 -0
  306. package/node_modules/shelljs/make.js +57 -0
  307. package/node_modules/shelljs/package.json +79 -0
  308. package/node_modules/shelljs/plugin.js +16 -0
  309. package/node_modules/shelljs/shell.js +156 -0
  310. package/node_modules/shelljs/src/cat.js +76 -0
  311. package/node_modules/shelljs/src/cd.js +39 -0
  312. package/node_modules/shelljs/src/chmod.js +216 -0
  313. package/node_modules/shelljs/src/common.js +468 -0
  314. package/node_modules/shelljs/src/cp.js +304 -0
  315. package/node_modules/shelljs/src/dirs.js +212 -0
  316. package/node_modules/shelljs/src/echo.js +63 -0
  317. package/node_modules/shelljs/src/error.js +15 -0
  318. package/node_modules/shelljs/src/exec-child.js +39 -0
  319. package/node_modules/shelljs/src/exec.js +226 -0
  320. package/node_modules/shelljs/src/find.js +61 -0
  321. package/node_modules/shelljs/src/grep.js +73 -0
  322. package/node_modules/shelljs/src/head.js +107 -0
  323. package/node_modules/shelljs/src/ln.js +73 -0
  324. package/node_modules/shelljs/src/ls.js +141 -0
  325. package/node_modules/shelljs/src/mkdir.js +100 -0
  326. package/node_modules/shelljs/src/mv.js +118 -0
  327. package/node_modules/shelljs/src/popd.js +1 -0
  328. package/node_modules/shelljs/src/pushd.js +1 -0
  329. package/node_modules/shelljs/src/pwd.js +16 -0
  330. package/node_modules/shelljs/src/rm.js +201 -0
  331. package/node_modules/shelljs/src/sed.js +87 -0
  332. package/node_modules/shelljs/src/set.js +56 -0
  333. package/node_modules/shelljs/src/sort.js +97 -0
  334. package/node_modules/shelljs/src/tail.js +80 -0
  335. package/node_modules/shelljs/src/tempdir.js +75 -0
  336. package/node_modules/shelljs/src/test.js +85 -0
  337. package/node_modules/shelljs/src/to.js +37 -0
  338. package/node_modules/shelljs/src/toEnd.js +36 -0
  339. package/node_modules/shelljs/src/touch.js +111 -0
  340. package/node_modules/shelljs/src/uniq.js +92 -0
  341. package/node_modules/shelljs/src/which.js +118 -0
  342. package/node_modules/supports-preserve-symlinks-flag/.eslintrc +14 -0
  343. package/node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml +12 -0
  344. package/node_modules/supports-preserve-symlinks-flag/.nycrc +9 -0
  345. package/node_modules/supports-preserve-symlinks-flag/CHANGELOG.md +22 -0
  346. package/node_modules/supports-preserve-symlinks-flag/LICENSE +21 -0
  347. package/node_modules/supports-preserve-symlinks-flag/README.md +42 -0
  348. package/node_modules/supports-preserve-symlinks-flag/browser.js +3 -0
  349. package/node_modules/supports-preserve-symlinks-flag/index.js +9 -0
  350. package/node_modules/supports-preserve-symlinks-flag/package.json +70 -0
  351. package/node_modules/supports-preserve-symlinks-flag/test/index.js +29 -0
  352. package/node_modules/tar/LICENSE.md +55 -0
  353. package/node_modules/tar/README.md +1224 -0
  354. package/node_modules/tar/dist/commonjs/create.d.ts +3 -0
  355. package/node_modules/tar/dist/commonjs/create.d.ts.map +1 -0
  356. package/node_modules/tar/dist/commonjs/create.js +82 -0
  357. package/node_modules/tar/dist/commonjs/create.js.map +1 -0
  358. package/node_modules/tar/dist/commonjs/cwd-error.d.ts +8 -0
  359. package/node_modules/tar/dist/commonjs/cwd-error.d.ts.map +1 -0
  360. package/node_modules/tar/dist/commonjs/cwd-error.js +18 -0
  361. package/node_modules/tar/dist/commonjs/cwd-error.js.map +1 -0
  362. package/node_modules/tar/dist/commonjs/extract.d.ts +3 -0
  363. package/node_modules/tar/dist/commonjs/extract.d.ts.map +1 -0
  364. package/node_modules/tar/dist/commonjs/extract.js +88 -0
  365. package/node_modules/tar/dist/commonjs/extract.js.map +1 -0
  366. package/node_modules/tar/dist/commonjs/get-write-flag.d.ts +2 -0
  367. package/node_modules/tar/dist/commonjs/get-write-flag.d.ts.map +1 -0
  368. package/node_modules/tar/dist/commonjs/get-write-flag.js +32 -0
  369. package/node_modules/tar/dist/commonjs/get-write-flag.js.map +1 -0
  370. package/node_modules/tar/dist/commonjs/header.d.ts +53 -0
  371. package/node_modules/tar/dist/commonjs/header.d.ts.map +1 -0
  372. package/node_modules/tar/dist/commonjs/header.js +312 -0
  373. package/node_modules/tar/dist/commonjs/header.js.map +1 -0
  374. package/node_modules/tar/dist/commonjs/index.d.ts +20 -0
  375. package/node_modules/tar/dist/commonjs/index.d.ts.map +1 -0
  376. package/node_modules/tar/dist/commonjs/index.js +64 -0
  377. package/node_modules/tar/dist/commonjs/index.js.map +1 -0
  378. package/node_modules/tar/dist/commonjs/index.min.js +4 -0
  379. package/node_modules/tar/dist/commonjs/index.min.js.map +7 -0
  380. package/node_modules/tar/dist/commonjs/large-numbers.d.ts +3 -0
  381. package/node_modules/tar/dist/commonjs/large-numbers.d.ts.map +1 -0
  382. package/node_modules/tar/dist/commonjs/large-numbers.js +99 -0
  383. package/node_modules/tar/dist/commonjs/large-numbers.js.map +1 -0
  384. package/node_modules/tar/dist/commonjs/list.d.ts +7 -0
  385. package/node_modules/tar/dist/commonjs/list.d.ts.map +1 -0
  386. package/node_modules/tar/dist/commonjs/list.js +145 -0
  387. package/node_modules/tar/dist/commonjs/list.js.map +1 -0
  388. package/node_modules/tar/dist/commonjs/make-command.d.ts +49 -0
  389. package/node_modules/tar/dist/commonjs/make-command.d.ts.map +1 -0
  390. package/node_modules/tar/dist/commonjs/make-command.js +52 -0
  391. package/node_modules/tar/dist/commonjs/make-command.js.map +1 -0
  392. package/node_modules/tar/dist/commonjs/mkdir.d.ts +25 -0
  393. package/node_modules/tar/dist/commonjs/mkdir.d.ts.map +1 -0
  394. package/node_modules/tar/dist/commonjs/mkdir.js +187 -0
  395. package/node_modules/tar/dist/commonjs/mkdir.js.map +1 -0
  396. package/node_modules/tar/dist/commonjs/mode-fix.d.ts +2 -0
  397. package/node_modules/tar/dist/commonjs/mode-fix.d.ts.map +1 -0
  398. package/node_modules/tar/dist/commonjs/mode-fix.js +29 -0
  399. package/node_modules/tar/dist/commonjs/mode-fix.js.map +1 -0
  400. package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts +2 -0
  401. package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts.map +1 -0
  402. package/node_modules/tar/dist/commonjs/normalize-unicode.js +38 -0
  403. package/node_modules/tar/dist/commonjs/normalize-unicode.js.map +1 -0
  404. package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +2 -0
  405. package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts.map +1 -0
  406. package/node_modules/tar/dist/commonjs/normalize-windows-path.js +12 -0
  407. package/node_modules/tar/dist/commonjs/normalize-windows-path.js.map +1 -0
  408. package/node_modules/tar/dist/commonjs/options.d.ts +596 -0
  409. package/node_modules/tar/dist/commonjs/options.d.ts.map +1 -0
  410. package/node_modules/tar/dist/commonjs/options.js +66 -0
  411. package/node_modules/tar/dist/commonjs/options.js.map +1 -0
  412. package/node_modules/tar/dist/commonjs/pack.d.ts +105 -0
  413. package/node_modules/tar/dist/commonjs/pack.d.ts.map +1 -0
  414. package/node_modules/tar/dist/commonjs/pack.js +545 -0
  415. package/node_modules/tar/dist/commonjs/pack.js.map +1 -0
  416. package/node_modules/tar/dist/commonjs/package.json +3 -0
  417. package/node_modules/tar/dist/commonjs/parse.d.ts +85 -0
  418. package/node_modules/tar/dist/commonjs/parse.d.ts.map +1 -0
  419. package/node_modules/tar/dist/commonjs/parse.js +610 -0
  420. package/node_modules/tar/dist/commonjs/parse.js.map +1 -0
  421. package/node_modules/tar/dist/commonjs/path-reservations.d.ts +11 -0
  422. package/node_modules/tar/dist/commonjs/path-reservations.d.ts.map +1 -0
  423. package/node_modules/tar/dist/commonjs/path-reservations.js +170 -0
  424. package/node_modules/tar/dist/commonjs/path-reservations.js.map +1 -0
  425. package/node_modules/tar/dist/commonjs/pax.d.ts +26 -0
  426. package/node_modules/tar/dist/commonjs/pax.d.ts.map +1 -0
  427. package/node_modules/tar/dist/commonjs/pax.js +158 -0
  428. package/node_modules/tar/dist/commonjs/pax.js.map +1 -0
  429. package/node_modules/tar/dist/commonjs/process-umask.d.ts +2 -0
  430. package/node_modules/tar/dist/commonjs/process-umask.d.ts.map +1 -0
  431. package/node_modules/tar/dist/commonjs/process-umask.js +7 -0
  432. package/node_modules/tar/dist/commonjs/process-umask.js.map +1 -0
  433. package/node_modules/tar/dist/commonjs/read-entry.d.ts +36 -0
  434. package/node_modules/tar/dist/commonjs/read-entry.d.ts.map +1 -0
  435. package/node_modules/tar/dist/commonjs/read-entry.js +136 -0
  436. package/node_modules/tar/dist/commonjs/read-entry.js.map +1 -0
  437. package/node_modules/tar/dist/commonjs/replace.d.ts +2 -0
  438. package/node_modules/tar/dist/commonjs/replace.d.ts.map +1 -0
  439. package/node_modules/tar/dist/commonjs/replace.js +227 -0
  440. package/node_modules/tar/dist/commonjs/replace.js.map +1 -0
  441. package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +2 -0
  442. package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts.map +1 -0
  443. package/node_modules/tar/dist/commonjs/strip-absolute-path.js +29 -0
  444. package/node_modules/tar/dist/commonjs/strip-absolute-path.js.map +1 -0
  445. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts +2 -0
  446. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts.map +1 -0
  447. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +18 -0
  448. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js.map +1 -0
  449. package/node_modules/tar/dist/commonjs/symlink-error.d.ts +9 -0
  450. package/node_modules/tar/dist/commonjs/symlink-error.d.ts.map +1 -0
  451. package/node_modules/tar/dist/commonjs/symlink-error.js +19 -0
  452. package/node_modules/tar/dist/commonjs/symlink-error.js.map +1 -0
  453. package/node_modules/tar/dist/commonjs/types.d.ts +7 -0
  454. package/node_modules/tar/dist/commonjs/types.d.ts.map +1 -0
  455. package/node_modules/tar/dist/commonjs/types.js +50 -0
  456. package/node_modules/tar/dist/commonjs/types.js.map +1 -0
  457. package/node_modules/tar/dist/commonjs/unpack.d.ts +101 -0
  458. package/node_modules/tar/dist/commonjs/unpack.d.ts.map +1 -0
  459. package/node_modules/tar/dist/commonjs/unpack.js +932 -0
  460. package/node_modules/tar/dist/commonjs/unpack.js.map +1 -0
  461. package/node_modules/tar/dist/commonjs/update.d.ts +2 -0
  462. package/node_modules/tar/dist/commonjs/update.d.ts.map +1 -0
  463. package/node_modules/tar/dist/commonjs/update.js +33 -0
  464. package/node_modules/tar/dist/commonjs/update.js.map +1 -0
  465. package/node_modules/tar/dist/commonjs/warn-method.d.ts +24 -0
  466. package/node_modules/tar/dist/commonjs/warn-method.d.ts.map +1 -0
  467. package/node_modules/tar/dist/commonjs/warn-method.js +31 -0
  468. package/node_modules/tar/dist/commonjs/warn-method.js.map +1 -0
  469. package/node_modules/tar/dist/commonjs/winchars.d.ts +3 -0
  470. package/node_modules/tar/dist/commonjs/winchars.d.ts.map +1 -0
  471. package/node_modules/tar/dist/commonjs/winchars.js +14 -0
  472. package/node_modules/tar/dist/commonjs/winchars.js.map +1 -0
  473. package/node_modules/tar/dist/commonjs/write-entry.d.ts +129 -0
  474. package/node_modules/tar/dist/commonjs/write-entry.d.ts.map +1 -0
  475. package/node_modules/tar/dist/commonjs/write-entry.js +698 -0
  476. package/node_modules/tar/dist/commonjs/write-entry.js.map +1 -0
  477. package/node_modules/tar/dist/esm/create.d.ts +3 -0
  478. package/node_modules/tar/dist/esm/create.d.ts.map +1 -0
  479. package/node_modules/tar/dist/esm/create.js +76 -0
  480. package/node_modules/tar/dist/esm/create.js.map +1 -0
  481. package/node_modules/tar/dist/esm/cwd-error.d.ts +8 -0
  482. package/node_modules/tar/dist/esm/cwd-error.d.ts.map +1 -0
  483. package/node_modules/tar/dist/esm/cwd-error.js +14 -0
  484. package/node_modules/tar/dist/esm/cwd-error.js.map +1 -0
  485. package/node_modules/tar/dist/esm/extract.d.ts +3 -0
  486. package/node_modules/tar/dist/esm/extract.d.ts.map +1 -0
  487. package/node_modules/tar/dist/esm/extract.js +49 -0
  488. package/node_modules/tar/dist/esm/extract.js.map +1 -0
  489. package/node_modules/tar/dist/esm/get-write-flag.d.ts +2 -0
  490. package/node_modules/tar/dist/esm/get-write-flag.d.ts.map +1 -0
  491. package/node_modules/tar/dist/esm/get-write-flag.js +26 -0
  492. package/node_modules/tar/dist/esm/get-write-flag.js.map +1 -0
  493. package/node_modules/tar/dist/esm/header.d.ts +53 -0
  494. package/node_modules/tar/dist/esm/header.d.ts.map +1 -0
  495. package/node_modules/tar/dist/esm/header.js +275 -0
  496. package/node_modules/tar/dist/esm/header.js.map +1 -0
  497. package/node_modules/tar/dist/esm/index.d.ts +20 -0
  498. package/node_modules/tar/dist/esm/index.d.ts.map +1 -0
  499. package/node_modules/tar/dist/esm/index.js +20 -0
  500. package/node_modules/tar/dist/esm/index.js.map +1 -0
  501. package/node_modules/tar/dist/esm/index.min.js +4 -0
  502. package/node_modules/tar/dist/esm/index.min.js.map +7 -0
  503. package/node_modules/tar/dist/esm/large-numbers.d.ts +3 -0
  504. package/node_modules/tar/dist/esm/large-numbers.d.ts.map +1 -0
  505. package/node_modules/tar/dist/esm/large-numbers.js +94 -0
  506. package/node_modules/tar/dist/esm/large-numbers.js.map +1 -0
  507. package/node_modules/tar/dist/esm/list.d.ts +7 -0
  508. package/node_modules/tar/dist/esm/list.d.ts.map +1 -0
  509. package/node_modules/tar/dist/esm/list.js +105 -0
  510. package/node_modules/tar/dist/esm/list.js.map +1 -0
  511. package/node_modules/tar/dist/esm/make-command.d.ts +49 -0
  512. package/node_modules/tar/dist/esm/make-command.d.ts.map +1 -0
  513. package/node_modules/tar/dist/esm/make-command.js +48 -0
  514. package/node_modules/tar/dist/esm/make-command.js.map +1 -0
  515. package/node_modules/tar/dist/esm/mkdir.d.ts +25 -0
  516. package/node_modules/tar/dist/esm/mkdir.d.ts.map +1 -0
  517. package/node_modules/tar/dist/esm/mkdir.js +179 -0
  518. package/node_modules/tar/dist/esm/mkdir.js.map +1 -0
  519. package/node_modules/tar/dist/esm/mode-fix.d.ts +2 -0
  520. package/node_modules/tar/dist/esm/mode-fix.d.ts.map +1 -0
  521. package/node_modules/tar/dist/esm/mode-fix.js +25 -0
  522. package/node_modules/tar/dist/esm/mode-fix.js.map +1 -0
  523. package/node_modules/tar/dist/esm/normalize-unicode.d.ts +2 -0
  524. package/node_modules/tar/dist/esm/normalize-unicode.d.ts.map +1 -0
  525. package/node_modules/tar/dist/esm/normalize-unicode.js +34 -0
  526. package/node_modules/tar/dist/esm/normalize-unicode.js.map +1 -0
  527. package/node_modules/tar/dist/esm/normalize-windows-path.d.ts +2 -0
  528. package/node_modules/tar/dist/esm/normalize-windows-path.d.ts.map +1 -0
  529. package/node_modules/tar/dist/esm/normalize-windows-path.js +9 -0
  530. package/node_modules/tar/dist/esm/normalize-windows-path.js.map +1 -0
  531. package/node_modules/tar/dist/esm/options.d.ts +596 -0
  532. package/node_modules/tar/dist/esm/options.d.ts.map +1 -0
  533. package/node_modules/tar/dist/esm/options.js +54 -0
  534. package/node_modules/tar/dist/esm/options.js.map +1 -0
  535. package/node_modules/tar/dist/esm/pack.d.ts +105 -0
  536. package/node_modules/tar/dist/esm/pack.d.ts.map +1 -0
  537. package/node_modules/tar/dist/esm/pack.js +503 -0
  538. package/node_modules/tar/dist/esm/pack.js.map +1 -0
  539. package/node_modules/tar/dist/esm/package.json +3 -0
  540. package/node_modules/tar/dist/esm/parse.d.ts +85 -0
  541. package/node_modules/tar/dist/esm/parse.d.ts.map +1 -0
  542. package/node_modules/tar/dist/esm/parse.js +606 -0
  543. package/node_modules/tar/dist/esm/parse.js.map +1 -0
  544. package/node_modules/tar/dist/esm/path-reservations.d.ts +11 -0
  545. package/node_modules/tar/dist/esm/path-reservations.d.ts.map +1 -0
  546. package/node_modules/tar/dist/esm/path-reservations.js +166 -0
  547. package/node_modules/tar/dist/esm/path-reservations.js.map +1 -0
  548. package/node_modules/tar/dist/esm/pax.d.ts +26 -0
  549. package/node_modules/tar/dist/esm/pax.d.ts.map +1 -0
  550. package/node_modules/tar/dist/esm/pax.js +154 -0
  551. package/node_modules/tar/dist/esm/pax.js.map +1 -0
  552. package/node_modules/tar/dist/esm/process-umask.d.ts +2 -0
  553. package/node_modules/tar/dist/esm/process-umask.d.ts.map +1 -0
  554. package/node_modules/tar/dist/esm/process-umask.js +3 -0
  555. package/node_modules/tar/dist/esm/process-umask.js.map +1 -0
  556. package/node_modules/tar/dist/esm/read-entry.d.ts +36 -0
  557. package/node_modules/tar/dist/esm/read-entry.d.ts.map +1 -0
  558. package/node_modules/tar/dist/esm/read-entry.js +132 -0
  559. package/node_modules/tar/dist/esm/read-entry.js.map +1 -0
  560. package/node_modules/tar/dist/esm/replace.d.ts +2 -0
  561. package/node_modules/tar/dist/esm/replace.d.ts.map +1 -0
  562. package/node_modules/tar/dist/esm/replace.js +221 -0
  563. package/node_modules/tar/dist/esm/replace.js.map +1 -0
  564. package/node_modules/tar/dist/esm/strip-absolute-path.d.ts +2 -0
  565. package/node_modules/tar/dist/esm/strip-absolute-path.d.ts.map +1 -0
  566. package/node_modules/tar/dist/esm/strip-absolute-path.js +25 -0
  567. package/node_modules/tar/dist/esm/strip-absolute-path.js.map +1 -0
  568. package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts +2 -0
  569. package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts.map +1 -0
  570. package/node_modules/tar/dist/esm/strip-trailing-slashes.js +14 -0
  571. package/node_modules/tar/dist/esm/strip-trailing-slashes.js.map +1 -0
  572. package/node_modules/tar/dist/esm/symlink-error.d.ts +9 -0
  573. package/node_modules/tar/dist/esm/symlink-error.d.ts.map +1 -0
  574. package/node_modules/tar/dist/esm/symlink-error.js +15 -0
  575. package/node_modules/tar/dist/esm/symlink-error.js.map +1 -0
  576. package/node_modules/tar/dist/esm/types.d.ts +7 -0
  577. package/node_modules/tar/dist/esm/types.d.ts.map +1 -0
  578. package/node_modules/tar/dist/esm/types.js +45 -0
  579. package/node_modules/tar/dist/esm/types.js.map +1 -0
  580. package/node_modules/tar/dist/esm/unpack.d.ts +101 -0
  581. package/node_modules/tar/dist/esm/unpack.d.ts.map +1 -0
  582. package/node_modules/tar/dist/esm/unpack.js +891 -0
  583. package/node_modules/tar/dist/esm/unpack.js.map +1 -0
  584. package/node_modules/tar/dist/esm/update.d.ts +2 -0
  585. package/node_modules/tar/dist/esm/update.d.ts.map +1 -0
  586. package/node_modules/tar/dist/esm/update.js +30 -0
  587. package/node_modules/tar/dist/esm/update.js.map +1 -0
  588. package/node_modules/tar/dist/esm/warn-method.d.ts +24 -0
  589. package/node_modules/tar/dist/esm/warn-method.d.ts.map +1 -0
  590. package/node_modules/tar/dist/esm/warn-method.js +27 -0
  591. package/node_modules/tar/dist/esm/warn-method.js.map +1 -0
  592. package/node_modules/tar/dist/esm/winchars.d.ts +3 -0
  593. package/node_modules/tar/dist/esm/winchars.d.ts.map +1 -0
  594. package/node_modules/tar/dist/esm/winchars.js +9 -0
  595. package/node_modules/tar/dist/esm/winchars.js.map +1 -0
  596. package/node_modules/tar/dist/esm/write-entry.d.ts +129 -0
  597. package/node_modules/tar/dist/esm/write-entry.d.ts.map +1 -0
  598. package/node_modules/tar/dist/esm/write-entry.js +656 -0
  599. package/node_modules/tar/dist/esm/write-entry.js.map +1 -0
  600. package/node_modules/tar/package.json +297 -0
  601. package/node_modules/tr46/.npmignore +4 -0
  602. package/node_modules/tr46/index.js +193 -0
  603. package/node_modules/tr46/lib/.gitkeep +0 -0
  604. package/node_modules/tr46/lib/mappingTable.json +1 -0
  605. package/node_modules/tr46/package.json +31 -0
  606. package/node_modules/webidl-conversions/LICENSE.md +12 -0
  607. package/node_modules/webidl-conversions/README.md +53 -0
  608. package/node_modules/webidl-conversions/lib/index.js +189 -0
  609. package/node_modules/webidl-conversions/package.json +23 -0
  610. package/node_modules/whatwg-url/LICENSE.txt +21 -0
  611. package/node_modules/whatwg-url/README.md +67 -0
  612. package/node_modules/whatwg-url/lib/URL-impl.js +200 -0
  613. package/node_modules/whatwg-url/lib/URL.js +196 -0
  614. package/node_modules/whatwg-url/lib/public-api.js +11 -0
  615. package/node_modules/whatwg-url/lib/url-state-machine.js +1297 -0
  616. package/node_modules/whatwg-url/lib/utils.js +20 -0
  617. package/node_modules/whatwg-url/package.json +32 -0
  618. package/node_modules/wrappy/LICENSE +15 -0
  619. package/node_modules/wrappy/README.md +36 -0
  620. package/node_modules/wrappy/package.json +29 -0
  621. package/node_modules/wrappy/wrappy.js +33 -0
  622. package/node_modules/yallist/LICENSE.md +63 -0
  623. package/node_modules/yallist/README.md +205 -0
  624. package/node_modules/yallist/dist/commonjs/index.d.ts +39 -0
  625. package/node_modules/yallist/dist/commonjs/index.d.ts.map +1 -0
  626. package/node_modules/yallist/dist/commonjs/index.js +384 -0
  627. package/node_modules/yallist/dist/commonjs/index.js.map +1 -0
  628. package/node_modules/yallist/dist/commonjs/package.json +3 -0
  629. package/node_modules/yallist/dist/esm/index.d.ts +39 -0
  630. package/node_modules/yallist/dist/esm/index.d.ts.map +1 -0
  631. package/node_modules/yallist/dist/esm/index.js +379 -0
  632. package/node_modules/yallist/dist/esm/index.js.map +1 -0
  633. package/node_modules/yallist/dist/esm/package.json +3 -0
  634. package/node_modules/yallist/package.json +68 -0
  635. package/node_modules/yauzl/LICENSE +21 -0
  636. package/node_modules/yauzl/README.md +871 -0
  637. package/node_modules/yauzl/crc32.js +45 -0
  638. package/node_modules/yauzl/fd-slicer.js +188 -0
  639. package/node_modules/yauzl/index.js +970 -0
  640. package/node_modules/yauzl/package.json +40 -0
  641. package/package.json +7 -1
@@ -0,0 +1,970 @@
1
+ var fs = require("fs");
2
+ var zlib = require("zlib");
3
+ var fd_slicer = require("./fd-slicer");
4
+ var util = require("util");
5
+ var EventEmitter = require("events").EventEmitter;
6
+ var Transform = require("stream").Transform;
7
+ var PassThrough = require("stream").PassThrough;
8
+ var Writable = require("stream").Writable;
9
+
10
+ // Node 20 added zlib.crc32.
11
+ const crc32 = typeof zlib.crc32 === "function" ? zlib.crc32 : require("./crc32");
12
+
13
+ exports.open = open;
14
+ exports.fromFd = fromFd;
15
+ exports.fromBuffer = fromBuffer;
16
+ exports.fromRandomAccessReader = fromRandomAccessReader;
17
+ exports.dosDateTimeToDate = dosDateTimeToDate;
18
+ exports.getFileNameLowLevel = getFileNameLowLevel;
19
+ exports.validateFileName = validateFileName;
20
+ exports.parseExtraFields = parseExtraFields;
21
+ exports.ZipFile = ZipFile;
22
+ exports.Entry = Entry;
23
+ exports.LocalFileHeader = LocalFileHeader;
24
+ exports.RandomAccessReader = RandomAccessReader;
25
+
26
+ function open(path, options, callback) {
27
+ if (typeof options === "function") {
28
+ callback = options;
29
+ options = null;
30
+ }
31
+ if (options == null) options = {};
32
+ if (options.autoClose == null) options.autoClose = true;
33
+ if (options.lazyEntries == null) options.lazyEntries = false;
34
+ if (options.decodeStrings == null) options.decodeStrings = true;
35
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
36
+ if (options.strictFileNames == null) options.strictFileNames = false;
37
+ if (callback == null) callback = defaultCallback;
38
+ fs.open(path, "r", function(err, fd) {
39
+ if (err) return callback(err);
40
+ fromFd(fd, options, function(err, zipfile) {
41
+ if (err) fs.close(fd, defaultCallback);
42
+ callback(err, zipfile);
43
+ });
44
+ });
45
+ }
46
+
47
+ function fromFd(fd, options, callback) {
48
+ if (typeof options === "function") {
49
+ callback = options;
50
+ options = null;
51
+ }
52
+ if (options == null) options = {};
53
+ if (options.autoClose == null) options.autoClose = false;
54
+ if (options.lazyEntries == null) options.lazyEntries = false;
55
+ if (options.decodeStrings == null) options.decodeStrings = true;
56
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
57
+ if (options.strictFileNames == null) options.strictFileNames = false;
58
+ if (callback == null) callback = defaultCallback;
59
+ fs.fstat(fd, function(err, stats) {
60
+ if (err) return callback(err);
61
+ var reader = new fd_slicer.FdSlicer(fd);
62
+ fromRandomAccessReader(reader, stats.size, options, callback);
63
+ });
64
+ }
65
+
66
+ function fromBuffer(buffer, options, callback) {
67
+ if (typeof options === "function") {
68
+ callback = options;
69
+ options = null;
70
+ }
71
+ if (options == null) options = {};
72
+ options.autoClose = false;
73
+ if (options.lazyEntries == null) options.lazyEntries = false;
74
+ if (options.decodeStrings == null) options.decodeStrings = true;
75
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
76
+ if (options.strictFileNames == null) options.strictFileNames = false;
77
+ var reader = new fd_slicer.BufferSlicer(buffer);
78
+ fromRandomAccessReader(reader, buffer.length, options, callback);
79
+ }
80
+
81
+ function fromRandomAccessReader(reader, totalSize, options, callback) {
82
+ if (typeof options === "function") {
83
+ callback = options;
84
+ options = null;
85
+ }
86
+ if (options == null) options = {};
87
+ if (options.autoClose == null) options.autoClose = true;
88
+ if (options.lazyEntries == null) options.lazyEntries = false;
89
+ if (options.decodeStrings == null) options.decodeStrings = true;
90
+ var decodeStrings = !!options.decodeStrings;
91
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
92
+ if (options.strictFileNames == null) options.strictFileNames = false;
93
+ if (callback == null) callback = defaultCallback;
94
+ if (typeof totalSize !== "number") throw new Error("expected totalSize parameter to be a number");
95
+ if (totalSize > Number.MAX_SAFE_INTEGER) {
96
+ throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");
97
+ }
98
+
99
+ // the matching unref() call is in zipfile.close()
100
+ reader.ref();
101
+
102
+ // eocdr means End of Central Directory Record.
103
+ // search backwards for the eocdr signature.
104
+ // the last field of the eocdr is a variable-length comment.
105
+ // the comment size is encoded in a 2-byte field in the eocdr, which we can't find without trudging backwards through the comment to find it.
106
+ // as a consequence of this design decision, it's possible to have ambiguous zip file metadata if a coherent eocdr was in the comment.
107
+ // we search backwards for a eocdr signature, and hope that whoever made the zip file was smart enough to forbid the eocdr signature in the comment.
108
+ var eocdrWithoutCommentSize = 22;
109
+ var zip64EocdlSize = 20; // Zip64 end of central directory locator
110
+ var maxCommentSize = 0xffff; // 2-byte size
111
+ var bufferSize = Math.min(zip64EocdlSize + eocdrWithoutCommentSize + maxCommentSize, totalSize);
112
+ var buffer = newBuffer(bufferSize);
113
+ var bufferReadStart = totalSize - buffer.length;
114
+ readAndAssertNoEof(reader, buffer, 0, bufferSize, bufferReadStart, function(err) {
115
+ if (err) return callback(err);
116
+ for (var i = bufferSize - eocdrWithoutCommentSize; i >= 0; i -= 1) {
117
+ if (buffer.readUInt32LE(i) !== 0x06054b50) continue;
118
+ // found eocdr
119
+ var eocdrBuffer = buffer.subarray(i);
120
+
121
+ // 0 - End of central directory signature = 0x06054b50
122
+ // 4 - Number of this disk
123
+ var diskNumber = eocdrBuffer.readUInt16LE(4);
124
+ // 6 - Disk where central directory starts
125
+ // 8 - Number of central directory records on this disk
126
+ // 10 - Total number of central directory records
127
+ var entryCount = eocdrBuffer.readUInt16LE(10);
128
+ // 12 - Size of central directory (bytes)
129
+ // 16 - Offset of start of central directory, relative to start of archive
130
+ var centralDirectoryOffset = eocdrBuffer.readUInt32LE(16);
131
+ // 20 - Comment length
132
+ var commentLength = eocdrBuffer.readUInt16LE(20);
133
+ var expectedCommentLength = eocdrBuffer.length - eocdrWithoutCommentSize;
134
+ if (commentLength !== expectedCommentLength) {
135
+ return callback(new Error("Invalid comment length. Expected: " + expectedCommentLength + ". Found: " + commentLength + ". Are there extra bytes at the end of the file? Or is the end of central dir signature `PK☺☻` in the comment?"));
136
+ }
137
+ // 22 - Comment
138
+ // the encoding is always cp437.
139
+ var comment = decodeStrings ? decodeBuffer(eocdrBuffer.subarray(22), false)
140
+ : eocdrBuffer.subarray(22);
141
+
142
+ // Look for a Zip64 end of central directory locator
143
+ if (i - zip64EocdlSize >= 0 && buffer.readUInt32LE(i - zip64EocdlSize) === 0x07064b50) {
144
+ // ZIP64 format
145
+ var zip64EocdlBuffer = buffer.subarray(i - zip64EocdlSize, i - zip64EocdlSize + zip64EocdlSize);
146
+ // 0 - zip64 end of central dir locator signature = 0x07064b50
147
+ // 4 - number of the disk with the start of the zip64 end of central directory
148
+ // 8 - relative offset of the zip64 end of central directory record
149
+ var zip64EocdrOffset = readUInt64LE(zip64EocdlBuffer, 8);
150
+ // 16 - total number of disks
151
+
152
+ // ZIP64 end of central directory record
153
+ var zip64EocdrBuffer = newBuffer(56);
154
+ return readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, function(err) {
155
+ if (err) return callback(err);
156
+
157
+ // 0 - zip64 end of central dir signature 4 bytes (0x06064b50)
158
+ if (zip64EocdrBuffer.readUInt32LE(0) !== 0x06064b50) {
159
+ return callback(new Error("invalid zip64 end of central directory record signature"));
160
+ }
161
+ // 4 - size of zip64 end of central directory record 8 bytes
162
+ // 12 - version made by 2 bytes
163
+ // 14 - version needed to extract 2 bytes
164
+ // 16 - number of this disk 4 bytes
165
+ diskNumber = zip64EocdrBuffer.readUInt32LE(16);
166
+ if (diskNumber !== 0) {
167
+ // Check this only after zip64 overrides. See #118.
168
+ return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber));
169
+ }
170
+ // 20 - number of the disk with the start of the central directory 4 bytes
171
+ // 24 - total number of entries in the central directory on this disk 8 bytes
172
+ // 32 - total number of entries in the central directory 8 bytes
173
+ entryCount = readUInt64LE(zip64EocdrBuffer, 32);
174
+ // 40 - size of the central directory 8 bytes
175
+ // 48 - offset of start of central directory with respect to the starting disk number 8 bytes
176
+ centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48);
177
+ // 56 - zip64 extensible data sector (variable size)
178
+ return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));
179
+ });
180
+ }
181
+
182
+ // Not ZIP64 format
183
+ if (diskNumber !== 0) {
184
+ return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber));
185
+ }
186
+ return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));
187
+
188
+ }
189
+
190
+ // Not a zip file.
191
+ callback(new Error("End of central directory record signature not found. Either not a zip file, or file is truncated."));
192
+ });
193
+ }
194
+
195
+ util.inherits(ZipFile, EventEmitter);
196
+ function ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {
197
+ var self = this;
198
+ EventEmitter.call(self);
199
+ self.reader = reader;
200
+ // forward close events
201
+ self.reader.on("error", function(err) {
202
+ // error closing the fd
203
+ emitError(self, err);
204
+ });
205
+ self.reader.once("close", function() {
206
+ self.emit("close");
207
+ });
208
+ self.readEntryCursor = centralDirectoryOffset;
209
+ self.fileSize = fileSize;
210
+ self.entryCount = entryCount;
211
+ self.comment = comment;
212
+ self.entriesRead = 0;
213
+ self.autoClose = !!autoClose;
214
+ self.lazyEntries = !!lazyEntries;
215
+ self.decodeStrings = !!decodeStrings;
216
+ self.validateEntrySizes = !!validateEntrySizes;
217
+ self.strictFileNames = !!strictFileNames;
218
+ self.isOpen = true;
219
+ self.emittedError = false;
220
+
221
+ if (!self.lazyEntries) self._readEntry();
222
+ }
223
+ ZipFile.prototype.close = function() {
224
+ if (!this.isOpen) return;
225
+ this.isOpen = false;
226
+ this.reader.unref();
227
+ };
228
+
229
+ function emitErrorAndAutoClose(self, err) {
230
+ if (self.autoClose) self.close();
231
+ emitError(self, err);
232
+ }
233
+ function emitError(self, err) {
234
+ if (self.emittedError) return;
235
+ self.emittedError = true;
236
+ self.emit("error", err);
237
+ }
238
+
239
+ ZipFile.prototype.readEntry = function() {
240
+ if (!this.lazyEntries) throw new Error("readEntry() called without lazyEntries:true");
241
+ this._readEntry();
242
+ };
243
+ ZipFile.prototype._readEntry = function() {
244
+ var self = this;
245
+ if (self.entryCount === self.entriesRead) {
246
+ // done with metadata
247
+ setImmediate(function() {
248
+ if (self.autoClose) self.close();
249
+ if (self.emittedError) return;
250
+ self.emit("end");
251
+ });
252
+ return;
253
+ }
254
+ if (self.emittedError) return;
255
+ var buffer = newBuffer(46);
256
+ readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {
257
+ if (err) return emitErrorAndAutoClose(self, err);
258
+ if (self.emittedError) return;
259
+ var entry = new Entry();
260
+ // 0 - Central directory file header signature
261
+ var signature = buffer.readUInt32LE(0);
262
+ if (signature !== 0x02014b50) return emitErrorAndAutoClose(self, new Error("invalid central directory file header signature: 0x" + signature.toString(16)));
263
+ // 4 - Version made by
264
+ entry.versionMadeBy = buffer.readUInt16LE(4);
265
+ // 6 - Version needed to extract (minimum)
266
+ entry.versionNeededToExtract = buffer.readUInt16LE(6);
267
+ // 8 - General purpose bit flag
268
+ entry.generalPurposeBitFlag = buffer.readUInt16LE(8);
269
+ // 10 - Compression method
270
+ entry.compressionMethod = buffer.readUInt16LE(10);
271
+ // 12 - File last modification time
272
+ entry.lastModFileTime = buffer.readUInt16LE(12);
273
+ // 14 - File last modification date
274
+ entry.lastModFileDate = buffer.readUInt16LE(14);
275
+ // 16 - CRC-32
276
+ entry.crc32 = buffer.readUInt32LE(16);
277
+ // 20 - Compressed size
278
+ entry.compressedSize = buffer.readUInt32LE(20);
279
+ // 24 - Uncompressed size
280
+ entry.uncompressedSize = buffer.readUInt32LE(24);
281
+ // 28 - File name length (n)
282
+ entry.fileNameLength = buffer.readUInt16LE(28);
283
+ // 30 - Extra field length (m)
284
+ entry.extraFieldLength = buffer.readUInt16LE(30);
285
+ // 32 - File comment length (k)
286
+ entry.fileCommentLength = buffer.readUInt16LE(32);
287
+ // 34 - Disk number where file starts
288
+ // 36 - Internal file attributes
289
+ entry.internalFileAttributes = buffer.readUInt16LE(36);
290
+ // 38 - External file attributes
291
+ entry.externalFileAttributes = buffer.readUInt32LE(38);
292
+ // 42 - Relative offset of local file header
293
+ entry.relativeOffsetOfLocalHeader = buffer.readUInt32LE(42);
294
+
295
+ if (entry.generalPurposeBitFlag & 0x40) return emitErrorAndAutoClose(self, new Error("strong encryption is not supported"));
296
+
297
+ self.readEntryCursor += 46;
298
+
299
+ buffer = newBuffer(entry.fileNameLength + entry.extraFieldLength + entry.fileCommentLength);
300
+ readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {
301
+ if (err) return emitErrorAndAutoClose(self, err);
302
+ if (self.emittedError) return;
303
+ // 46 - File name
304
+ entry.fileNameRaw = buffer.subarray(0, entry.fileNameLength);
305
+ // 46+n - Extra field
306
+ var fileCommentStart = entry.fileNameLength + entry.extraFieldLength;
307
+ entry.extraFieldRaw = buffer.subarray(entry.fileNameLength, fileCommentStart);
308
+ // 46+n+m - File comment
309
+ entry.fileCommentRaw = buffer.subarray(fileCommentStart, fileCommentStart + entry.fileCommentLength);
310
+
311
+ // Parse the extra fields, which we need for processing other fields.
312
+ try {
313
+ entry.extraFields = parseExtraFields(entry.extraFieldRaw);
314
+ } catch (err) {
315
+ return emitErrorAndAutoClose(self, err);
316
+ }
317
+
318
+ // Interpret strings according to bit flags, extra fields, and options.
319
+ if (self.decodeStrings) {
320
+ var isUtf8 = (entry.generalPurposeBitFlag & 0x800) !== 0;
321
+ entry.fileComment = decodeBuffer(entry.fileCommentRaw, isUtf8);
322
+ entry.fileName = getFileNameLowLevel(entry.generalPurposeBitFlag, entry.fileNameRaw, entry.extraFields, self.strictFileNames);
323
+ var errorMessage = validateFileName(entry.fileName);
324
+ if (errorMessage != null) return emitErrorAndAutoClose(self, new Error(errorMessage));
325
+ } else {
326
+ entry.fileComment = entry.fileCommentRaw;
327
+ entry.fileName = entry.fileNameRaw;
328
+ }
329
+ // Maintain API compatibility. See https://github.com/thejoshwolfe/yauzl/issues/47
330
+ entry.comment = entry.fileComment;
331
+
332
+ self.readEntryCursor += buffer.length;
333
+ self.entriesRead += 1;
334
+
335
+ // Check for the Zip64 Extended Information Extra Field.
336
+ for (var i = 0; i < entry.extraFields.length; i++) {
337
+ var extraField = entry.extraFields[i];
338
+ if (extraField.id !== 0x0001) continue;
339
+ // Found it.
340
+
341
+ var zip64EiefBuffer = extraField.data;
342
+ var index = 0;
343
+ // 0 - Original Size 8 bytes
344
+ if (entry.uncompressedSize === 0xffffffff) {
345
+ if (index + 8 > zip64EiefBuffer.length) {
346
+ return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include uncompressed size"));
347
+ }
348
+ entry.uncompressedSize = readUInt64LE(zip64EiefBuffer, index);
349
+ index += 8;
350
+ }
351
+ // 8 - Compressed Size 8 bytes
352
+ if (entry.compressedSize === 0xffffffff) {
353
+ if (index + 8 > zip64EiefBuffer.length) {
354
+ return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include compressed size"));
355
+ }
356
+ entry.compressedSize = readUInt64LE(zip64EiefBuffer, index);
357
+ index += 8;
358
+ }
359
+ // 16 - Relative Header Offset 8 bytes
360
+ if (entry.relativeOffsetOfLocalHeader === 0xffffffff) {
361
+ if (index + 8 > zip64EiefBuffer.length) {
362
+ return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include relative header offset"));
363
+ }
364
+ entry.relativeOffsetOfLocalHeader = readUInt64LE(zip64EiefBuffer, index);
365
+ index += 8;
366
+ }
367
+ // 24 - Disk Start Number 4 bytes
368
+
369
+ break;
370
+ }
371
+
372
+ // validate file size
373
+ if (self.validateEntrySizes && entry.compressionMethod === 0) {
374
+ var expectedCompressedSize = entry.uncompressedSize;
375
+ if (entry.isEncrypted()) {
376
+ // traditional encryption prefixes the file data with a header
377
+ expectedCompressedSize += 12;
378
+ }
379
+ if (entry.compressedSize !== expectedCompressedSize) {
380
+ var msg = "compressed/uncompressed size mismatch for stored file: " + entry.compressedSize + " != " + entry.uncompressedSize;
381
+ return emitErrorAndAutoClose(self, new Error(msg));
382
+ }
383
+ }
384
+
385
+ self.emit("entry", entry);
386
+
387
+ if (!self.lazyEntries) self._readEntry();
388
+ });
389
+ });
390
+ };
391
+
392
+ ZipFile.prototype.openReadStream = function(entry, options, callback) {
393
+ var self = this;
394
+ // parameter validation
395
+ var relativeStart = 0;
396
+ var relativeEnd = entry.compressedSize;
397
+ if (callback == null) {
398
+ callback = options;
399
+ options = null;
400
+ }
401
+ if (options == null) {
402
+ options = {};
403
+ } else {
404
+ if (options.decodeFileData === false) {
405
+ // new, simple option
406
+ if (options.decrypt != null) {
407
+ throw new Error("cannot use options.decrypt when options.decodeFileData === false");
408
+ }
409
+ if (options.decompress != null) {
410
+ throw new Error("cannot use options.decompress when options.decodeFileData === false");
411
+ }
412
+ // start and end are allowed
413
+ } else {
414
+ // old, complicated options
415
+ if (options.decrypt != null) {
416
+ if (!entry.isEncrypted()) {
417
+ throw new Error("options.decrypt can only be specified for encrypted entries. See also option decodeFileData.");
418
+ }
419
+ if (options.decrypt !== false) throw new Error("invalid options.decrypt value: " + options.decrypt);
420
+ if (entry.isCompressed()) {
421
+ if (options.decompress !== false) throw new Error("entry is encrypted and compressed, and options.decompress !== false. See also option decodeFileData.");
422
+ }
423
+ }
424
+ if (options.decompress != null) {
425
+ if (!entry.isCompressed()) {
426
+ throw new Error("options.decompress can only be specified for compressed entries. See also option decodeFileData.");
427
+ }
428
+ if (!(options.decompress === false || options.decompress === true)) {
429
+ throw new Error("invalid options.decompress value: " + options.decompress);
430
+ }
431
+ decompress = options.decompress;
432
+ }
433
+ }
434
+ if (options.start != null) {
435
+ relativeStart = options.start;
436
+ if (relativeStart < 0) throw new Error("options.start < 0");
437
+ if (relativeStart > entry.compressedSize) throw new Error("options.start > entry.compressedSize");
438
+ }
439
+ if (options.end != null) {
440
+ relativeEnd = options.end;
441
+ if (relativeEnd < 0) throw new Error("options.end < 0");
442
+ if (relativeEnd > entry.compressedSize) throw new Error("options.end > entry.compressedSize");
443
+ if (relativeEnd < relativeStart) throw new Error("options.end < options.start");
444
+ }
445
+ }
446
+ var rawMode = (
447
+ options.decodeFileData === false || // Explicitly requested raw.
448
+ (
449
+ (entry.compressionMethod === 0 || // Naturally without compression.
450
+ (entry.compressionMethod === 8 && options.decompress === false) // Deprecated compression bypass option.
451
+ ) &&
452
+ (!entry.isEncrypted() || // Naturally without encryption.
453
+ options.decrypt === false // Deprecated encryption bypass option.
454
+ )
455
+ )
456
+ );
457
+ if (options.start != null || options.end != null) {
458
+ // Ensure slicing deals with raw data.
459
+ if (!rawMode) throw new Error("start/end range require options.decodeFileData === false for non-trivial encoded entries.");
460
+ }
461
+
462
+ // any further errors can either be caused by the zipfile,
463
+ // or were introduced in a minor version of yauzl,
464
+ // so should be passed to the client rather than thrown.
465
+ if (!self.isOpen) return callback(new Error("closed"));
466
+ if (entry.isEncrypted() && !rawMode) {
467
+ if (options.decrypt !== false) return callback(new Error("entry is encrypted, and options.decodeFileData !== false"));
468
+ }
469
+ var decompress;
470
+ if (rawMode) {
471
+ decompress = false;
472
+ } else if (entry.compressionMethod === 8) {
473
+ // 8 - The file is Deflated
474
+ decompress = options.decodeFileData !== true;
475
+ } else {
476
+ return callback(new Error("unsupported compression method: " + entry.compressionMethod));
477
+ }
478
+
479
+ self.readLocalFileHeader(entry, {minimal: true}, function(err, localFileHeader) {
480
+ if (err) return callback(err);
481
+ self.openReadStreamLowLevel(
482
+ localFileHeader.fileDataStart, entry.compressedSize,
483
+ relativeStart, relativeEnd,
484
+ decompress, entry.uncompressedSize,
485
+ callback);
486
+ });
487
+ };
488
+
489
+ ZipFile.prototype.openReadStreamLowLevel = function(fileDataStart, compressedSize, relativeStart, relativeEnd, decompress, uncompressedSize, callback) {
490
+ var self = this;
491
+
492
+ var fileDataEnd = fileDataStart + compressedSize;
493
+ var readStream = self.reader.createReadStream({
494
+ start: fileDataStart + relativeStart,
495
+ end: fileDataStart + relativeEnd,
496
+ });
497
+ var endpointStream = readStream;
498
+ if (decompress) {
499
+ var destroyed = false;
500
+ var inflateFilter = zlib.createInflateRaw();
501
+ readStream.on("error", function(err) {
502
+ // setImmediate here because errors can be emitted during the first call to pipe()
503
+ setImmediate(function() {
504
+ if (!destroyed) inflateFilter.emit("error", err);
505
+ });
506
+ });
507
+ readStream.pipe(inflateFilter);
508
+
509
+ if (self.validateEntrySizes) {
510
+ endpointStream = new AssertByteCountStream(uncompressedSize);
511
+ inflateFilter.on("error", function(err) {
512
+ // forward zlib errors to the client-visible stream
513
+ setImmediate(function() {
514
+ if (!destroyed) endpointStream.emit("error", err);
515
+ });
516
+ });
517
+ inflateFilter.pipe(endpointStream);
518
+ } else {
519
+ // the zlib filter is the client-visible stream
520
+ endpointStream = inflateFilter;
521
+ }
522
+ // this is part of yauzl's API, so implement this function on the client-visible stream
523
+ installDestroyFn(endpointStream, function() {
524
+ destroyed = true;
525
+ if (inflateFilter !== endpointStream) inflateFilter.unpipe(endpointStream);
526
+ readStream.unpipe(inflateFilter);
527
+ // TODO: the inflateFilter may cause a memory leak. see Issue #27.
528
+ readStream.destroy();
529
+ });
530
+ }
531
+ callback(null, endpointStream);
532
+ };
533
+
534
+ ZipFile.prototype.readLocalFileHeader = function(entry, options, callback) {
535
+ var self = this;
536
+ if (callback == null) {
537
+ callback = options;
538
+ options = null;
539
+ }
540
+ if (options == null) options = {};
541
+
542
+ self.reader.ref();
543
+ var buffer = newBuffer(30);
544
+ readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader, function(err) {
545
+ try {
546
+ if (err) return callback(err);
547
+ // 0 - Local file header signature = 0x04034b50
548
+ var signature = buffer.readUInt32LE(0);
549
+ if (signature !== 0x04034b50) {
550
+ return callback(new Error("invalid local file header signature: 0x" + signature.toString(16)));
551
+ }
552
+
553
+ var fileNameLength = buffer.readUInt16LE(26);
554
+ var extraFieldLength = buffer.readUInt16LE(28);
555
+ var fileDataStart = entry.relativeOffsetOfLocalHeader + 30 + fileNameLength + extraFieldLength;
556
+ // We now have enough information to do this bounds check.
557
+ if (fileDataStart + entry.compressedSize > self.fileSize) {
558
+ return callback(new Error("file data overflows file bounds: " +
559
+ fileDataStart + " + " + entry.compressedSize + " > " + self.fileSize));
560
+ }
561
+
562
+ if (options.minimal) {
563
+ return callback(null, {fileDataStart: fileDataStart});
564
+ }
565
+
566
+ var localFileHeader = new LocalFileHeader();
567
+ localFileHeader.fileDataStart = fileDataStart;
568
+
569
+ // 4 - Version needed to extract (minimum)
570
+ localFileHeader.versionNeededToExtract = buffer.readUInt16LE(4);
571
+ // 6 - General purpose bit flag
572
+ localFileHeader.generalPurposeBitFlag = buffer.readUInt16LE(6);
573
+ // 8 - Compression method
574
+ localFileHeader.compressionMethod = buffer.readUInt16LE(8);
575
+ // 10 - File last modification time
576
+ localFileHeader.lastModFileTime = buffer.readUInt16LE(10);
577
+ // 12 - File last modification date
578
+ localFileHeader.lastModFileDate = buffer.readUInt16LE(12);
579
+ // 14 - CRC-32
580
+ localFileHeader.crc32 = buffer.readUInt32LE(14);
581
+ // 18 - Compressed size
582
+ localFileHeader.compressedSize = buffer.readUInt32LE(18);
583
+ // 22 - Uncompressed size
584
+ localFileHeader.uncompressedSize = buffer.readUInt32LE(22);
585
+ // 26 - File name length (n)
586
+ localFileHeader.fileNameLength = fileNameLength;
587
+ // 28 - Extra field length (m)
588
+ localFileHeader.extraFieldLength = extraFieldLength;
589
+ // 30 - File name
590
+ // 30+n - Extra field
591
+
592
+ buffer = newBuffer(fileNameLength + extraFieldLength);
593
+ self.reader.ref();
594
+ readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader + 30, function(err) {
595
+ try {
596
+ if (err) return callback(err);
597
+ localFileHeader.fileName = buffer.subarray(0, fileNameLength);
598
+ localFileHeader.extraField = buffer.subarray(fileNameLength);
599
+ return callback(null, localFileHeader);
600
+ } finally {
601
+ self.reader.unref();
602
+ }
603
+ });
604
+ } finally {
605
+ self.reader.unref();
606
+ }
607
+ });
608
+ };
609
+
610
+ function Entry() {
611
+ }
612
+ Entry.prototype.getLastModDate = function(options) {
613
+ if (options == null) options = {};
614
+
615
+ if (!options.forceDosFormat) {
616
+ // Check extended fields.
617
+ for (var i = 0; i < this.extraFields.length; i++) {
618
+ var extraField = this.extraFields[i];
619
+ if (extraField.id === 0x5455) {
620
+ // Info-ZIP "universal timestamp" extended field (`0x5455` aka `"UT"`).
621
+ // See the Info-ZIP source code unix/unix.c:set_extra_field() and zipfile.c:ef_scan_ut_time().
622
+ var data = extraField.data;
623
+ if (data.length < 5) continue; // Too short.
624
+ // The flags define which of the three fields are present: mtime, atime, ctime.
625
+ // We only care about mtime.
626
+ // Also, ctime is never included in practice.
627
+ // And also, atime is only included in the local file header for some reason
628
+ // despite the flags lying about its inclusion in the central header.
629
+ var flags = data[0];
630
+ var HAS_MTIME = 1;
631
+ if (!(flags & HAS_MTIME)) continue; // This will realistically never happen.
632
+ // Although the positions of all of the fields shift around depending on the presence of other fields,
633
+ // mtime is always first if present, and that's the only one we care about.
634
+ var posixTimestamp = data.readInt32LE(1);
635
+ return new Date(posixTimestamp * 1000);
636
+ } else if (extraField.id === 0x000a) {
637
+ var data = extraField.data;
638
+ if (data.length !== 32) continue; // The length is always the same.
639
+ // 4 bytes reserved
640
+ // 2 bytes Tag
641
+ if (data.readUInt16LE(4) !== 1) continue; // Tag1 is actually the only defined Tag.
642
+ // 2 bytes Size
643
+ if (data.readUInt16LE(6) !== 24) continue; // Size is always 24.
644
+ // 8 bytes Mtime
645
+ var hundredNanoSecondsSince1601 = data.readUInt32LE(8) + 4294967296 * data.readInt32LE(12);
646
+ // Convert from NTFS to POSIX milliseconds.
647
+ // The big number below is the milliseconds between year 1601 and year 1970
648
+ // (i.e. the negative POSIX timestamp of 1601-01-01 00:00:00Z)
649
+ var millisecondsSince1970 = hundredNanoSecondsSince1601 / 10000 - 11644473600000;
650
+ // Note on numeric precision: JavaScript Number objects lose precision above Number.MAX_SAFE_INTEGER,
651
+ // and NTFS timestamps are typically much bigger than that limit.
652
+ // (MAX_SAFE_INTEGER would represent 1629-07-17T23:58:45.475Z.)
653
+ // However, we're losing precision in the conversion from 100nanosecond units to millisecond units anyway,
654
+ // and the time at which we also lose 1-millisecond precision is year 275760, the JavaScript Date limit (by design).
655
+ // Up through the year 2057, this conversion only drops 4 bits of precision,
656
+ // which is well under the 13-14 bits ratio between the milliseconds and 100nanoseconds.
657
+ return new Date(millisecondsSince1970);
658
+ }
659
+ }
660
+ }
661
+
662
+ // Fallback to non-extended encoding.
663
+ return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime, options.timezone);
664
+ };
665
+
666
+ Entry.prototype.canDecodeFileData = function() {
667
+ return (
668
+ !this.isEncrypted() &&
669
+ (this.compressionMethod === 0 || this.compressionMethod === 8)
670
+ );
671
+ };
672
+ Entry.prototype.isEncrypted = function() {
673
+ return (this.generalPurposeBitFlag & 0x1) !== 0;
674
+ };
675
+ Entry.prototype.isCompressed = function() {
676
+ return this.compressionMethod === 8;
677
+ };
678
+
679
+ function LocalFileHeader() {
680
+ }
681
+
682
+ function dosDateTimeToDate(date, time, timezone) {
683
+ var day = date & 0x1f; // 1-31
684
+ var month = (date >> 5 & 0xf) - 1; // 1-12, 0-11
685
+ var year = (date >> 9 & 0x7f) + 1980; // 0-128, 1980-2108
686
+
687
+ var millisecond = 0;
688
+ var second = (time & 0x1f) * 2; // 0-29, 0-58 (even numbers)
689
+ var minute = time >> 5 & 0x3f; // 0-59
690
+ var hour = time >> 11 & 0x1f; // 0-23
691
+
692
+ if (timezone == null || timezone === "local") {
693
+ return new Date(year, month, day, hour, minute, second, millisecond);
694
+ } else if (timezone === "UTC") {
695
+ return new Date(Date.UTC(year, month, day, hour, minute, second, millisecond));
696
+ } else {
697
+ throw new Error("unrecognized options.timezone: " + options.timezone);
698
+ }
699
+ }
700
+
701
+ function getFileNameLowLevel(generalPurposeBitFlag, fileNameBuffer, extraFields, strictFileNames) {
702
+ var fileName = null;
703
+
704
+ // check for Info-ZIP Unicode Path Extra Field (0x7075)
705
+ // see https://github.com/thejoshwolfe/yauzl/issues/33
706
+ for (var i = 0; i < extraFields.length; i++) {
707
+ var extraField = extraFields[i];
708
+ if (extraField.id === 0x7075) {
709
+ if (extraField.data.length < 6) {
710
+ // too short to be meaningful
711
+ continue;
712
+ }
713
+ // Version 1 byte version of this extra field, currently 1
714
+ if (extraField.data.readUInt8(0) !== 1) {
715
+ // > Changes may not be backward compatible so this extra
716
+ // > field should not be used if the version is not recognized.
717
+ continue;
718
+ }
719
+ // NameCRC32 4 bytes File Name Field CRC32 Checksum
720
+ var oldNameCrc32 = extraField.data.readUInt32LE(1);
721
+ if (crc32(fileNameBuffer) !== oldNameCrc32) {
722
+ // > If the CRC check fails, this UTF-8 Path Extra Field should be
723
+ // > ignored and the File Name field in the header should be used instead.
724
+ continue;
725
+ }
726
+ // UnicodeName Variable UTF-8 version of the entry File Name
727
+ fileName = decodeBuffer(extraField.data.subarray(5), true);
728
+ break;
729
+ }
730
+ }
731
+
732
+ if (fileName == null) {
733
+ // The typical case.
734
+ var isUtf8 = (generalPurposeBitFlag & 0x800) !== 0;
735
+ fileName = decodeBuffer(fileNameBuffer, isUtf8);
736
+ }
737
+
738
+ if (!strictFileNames) {
739
+ // Allow backslash.
740
+ fileName = fileName.replace(/\\/g, "/");
741
+ }
742
+ return fileName;
743
+ }
744
+
745
+ function validateFileName(fileName) {
746
+ if (fileName.indexOf("\\") !== -1) {
747
+ return "invalid characters in fileName: " + fileName;
748
+ }
749
+ if (/^[a-zA-Z]:/.test(fileName) || /^\//.test(fileName)) {
750
+ return "absolute path: " + fileName;
751
+ }
752
+ if (fileName.split("/").indexOf("..") !== -1) {
753
+ return "invalid relative path: " + fileName;
754
+ }
755
+ // all good
756
+ return null;
757
+ }
758
+
759
+ function parseExtraFields(extraFieldBuffer) {
760
+ var extraFields = [];
761
+ var i = 0;
762
+ while (i < extraFieldBuffer.length - 3) {
763
+ var headerId = extraFieldBuffer.readUInt16LE(i + 0);
764
+ var dataSize = extraFieldBuffer.readUInt16LE(i + 2);
765
+ var dataStart = i + 4;
766
+ var dataEnd = dataStart + dataSize;
767
+ if (dataEnd > extraFieldBuffer.length) throw new Error("extra field length exceeds extra field buffer size");
768
+ var dataBuffer = extraFieldBuffer.subarray(dataStart, dataEnd);
769
+ extraFields.push({
770
+ id: headerId,
771
+ data: dataBuffer,
772
+ });
773
+ i = dataEnd;
774
+ }
775
+ return extraFields;
776
+ }
777
+
778
+ function readAndAssertNoEof(reader, buffer, offset, length, position, callback) {
779
+ if (length === 0) {
780
+ // fs.read will throw an out-of-bounds error if you try to read 0 bytes from a 0 byte file
781
+ return setImmediate(function() { callback(null, newBuffer(0)); });
782
+ }
783
+ reader.read(buffer, offset, length, position, function(err, bytesRead) {
784
+ if (err) return callback(err);
785
+ if (bytesRead < length) {
786
+ return callback(new Error("unexpected EOF"));
787
+ }
788
+ callback();
789
+ });
790
+ }
791
+
792
+ util.inherits(AssertByteCountStream, Transform);
793
+ function AssertByteCountStream(byteCount) {
794
+ Transform.call(this);
795
+ this.actualByteCount = 0;
796
+ this.expectedByteCount = byteCount;
797
+ }
798
+ AssertByteCountStream.prototype._transform = function(chunk, encoding, cb) {
799
+ this.actualByteCount += chunk.length;
800
+ if (this.actualByteCount > this.expectedByteCount) {
801
+ var msg = "too many bytes in the stream. expected " + this.expectedByteCount + ". got at least " + this.actualByteCount;
802
+ return cb(new Error(msg));
803
+ }
804
+ cb(null, chunk);
805
+ };
806
+ AssertByteCountStream.prototype._flush = function(cb) {
807
+ if (this.actualByteCount < this.expectedByteCount) {
808
+ var msg = "not enough bytes in the stream. expected " + this.expectedByteCount + ". got only " + this.actualByteCount;
809
+ return cb(new Error(msg));
810
+ }
811
+ cb();
812
+ };
813
+
814
+ util.inherits(RandomAccessReader, EventEmitter);
815
+ function RandomAccessReader() {
816
+ EventEmitter.call(this);
817
+ this.refCount = 0;
818
+ }
819
+ RandomAccessReader.prototype.ref = function() {
820
+ this.refCount += 1;
821
+ };
822
+ RandomAccessReader.prototype.unref = function() {
823
+ var self = this;
824
+ self.refCount -= 1;
825
+
826
+ if (self.refCount > 0) return;
827
+ if (self.refCount < 0) throw new Error("invalid unref");
828
+
829
+ self.close(onCloseDone);
830
+
831
+ function onCloseDone(err) {
832
+ if (err) return self.emit('error', err);
833
+ self.emit('close');
834
+ }
835
+ };
836
+ RandomAccessReader.prototype.createReadStream = function(options) {
837
+ if (options == null) options = {};
838
+ var start = options.start;
839
+ var end = options.end;
840
+ if (start === end) {
841
+ var emptyStream = new PassThrough();
842
+ setImmediate(function() {
843
+ emptyStream.end();
844
+ });
845
+ return emptyStream;
846
+ }
847
+ var stream = this._readStreamForRange(start, end);
848
+
849
+ var destroyed = false;
850
+ var refUnrefFilter = new RefUnrefFilter(this);
851
+ stream.on("error", function(err) {
852
+ setImmediate(function() {
853
+ if (!destroyed) refUnrefFilter.emit("error", err);
854
+ });
855
+ });
856
+ installDestroyFn(refUnrefFilter, function() {
857
+ stream.unpipe(refUnrefFilter);
858
+ refUnrefFilter.unref();
859
+ stream.destroy();
860
+ });
861
+
862
+ var byteCounter = new AssertByteCountStream(end - start);
863
+ refUnrefFilter.on("error", function(err) {
864
+ setImmediate(function() {
865
+ if (!destroyed) byteCounter.emit("error", err);
866
+ });
867
+ });
868
+ installDestroyFn(byteCounter, function() {
869
+ destroyed = true;
870
+ refUnrefFilter.unpipe(byteCounter);
871
+ refUnrefFilter.destroy();
872
+ });
873
+
874
+ return stream.pipe(refUnrefFilter).pipe(byteCounter);
875
+ };
876
+ RandomAccessReader.prototype._readStreamForRange = function(start, end) {
877
+ throw new Error("not implemented");
878
+ };
879
+ RandomAccessReader.prototype.read = function(buffer, offset, length, position, callback) {
880
+ var readStream = this.createReadStream({start: position, end: position + length});
881
+ var writeStream = new Writable();
882
+ var written = 0;
883
+ writeStream._write = function(chunk, encoding, cb) {
884
+ chunk.copy(buffer, offset + written, 0, chunk.length);
885
+ written += chunk.length;
886
+ cb();
887
+ };
888
+ writeStream.on("finish", callback);
889
+ readStream.on("error", function(error) {
890
+ callback(error);
891
+ });
892
+ readStream.pipe(writeStream);
893
+ };
894
+ RandomAccessReader.prototype.close = function(callback) {
895
+ setImmediate(callback);
896
+ };
897
+
898
+ util.inherits(RefUnrefFilter, PassThrough);
899
+ function RefUnrefFilter(context) {
900
+ PassThrough.call(this);
901
+ this.context = context;
902
+ this.context.ref();
903
+ this.unreffedYet = false;
904
+ }
905
+ RefUnrefFilter.prototype._flush = function(cb) {
906
+ this.unref();
907
+ cb();
908
+ };
909
+ RefUnrefFilter.prototype.unref = function(cb) {
910
+ if (this.unreffedYet) return;
911
+ this.unreffedYet = true;
912
+ this.context.unref();
913
+ };
914
+
915
+ var cp437 = '\u0000☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ';
916
+ function decodeBuffer(buffer, isUtf8) {
917
+ if (isUtf8) {
918
+ return buffer.toString("utf8");
919
+ } else {
920
+ var result = "";
921
+ for (var i = 0; i < buffer.length; i++) {
922
+ result += cp437[buffer[i]];
923
+ }
924
+ return result;
925
+ }
926
+ }
927
+
928
+ function readUInt64LE(buffer, offset) {
929
+ // There is no native function for this, because we can't actually store 64-bit integers precisely.
930
+ // after 53 bits, JavaScript's Number type (IEEE 754 double) can't store individual integers anymore.
931
+ // but since 53 bits is a whole lot more than 32 bits, we do our best anyway.
932
+ // As of 2020, Node has added support for BigInt, which obviates this whole function,
933
+ // but yauzl hasn't been updated to depend on BigInt (yet?).
934
+ var lower32 = buffer.readUInt32LE(offset);
935
+ var upper32 = buffer.readUInt32LE(offset + 4);
936
+ // we can't use bitshifting here, because JavaScript bitshifting only works on 32-bit integers.
937
+ return upper32 * 0x100000000 + lower32;
938
+ // as long as we're bounds checking the result of this function against the total file size,
939
+ // we'll catch any overflow errors, because we already made sure the total file size was within reason.
940
+ }
941
+
942
+ // Node 10 deprecated new Buffer().
943
+ var newBuffer;
944
+ if (typeof Buffer.allocUnsafe === "function") {
945
+ newBuffer = function(len) {
946
+ return Buffer.allocUnsafe(len);
947
+ };
948
+ } else {
949
+ newBuffer = function(len) {
950
+ return new Buffer(len);
951
+ };
952
+ }
953
+
954
+ // Node 8 introduced a proper destroy() implementation on writable streams.
955
+ function installDestroyFn(stream, fn) {
956
+ if (typeof stream.destroy === "function") {
957
+ // New API.
958
+ stream._destroy = function(err, cb) {
959
+ fn();
960
+ if (cb != null) cb(err);
961
+ };
962
+ } else {
963
+ // Old API.
964
+ stream.destroy = fn;
965
+ }
966
+ }
967
+
968
+ function defaultCallback(err) {
969
+ if (err) throw err;
970
+ }