@onslaughtsnail/caelis 0.0.8 → 0.0.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onslaughtsnail/caelis",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "caelis CLI distributed via npm",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -95,11 +95,19 @@ async function download(url, toFile, redirects = 0) {
95
95
 
96
96
  async function extractArchive(archivePath, tempDir, target) {
97
97
  if (target.archiveExt === 'zip') {
98
- const extract = (await import('extract-zip')).default;
98
+ const extractMod = await import('extract-zip');
99
+ const extract = extractMod.default || extractMod;
100
+ if (typeof extract !== 'function') {
101
+ throw new Error('extract-zip module does not export a callable extractor');
102
+ }
99
103
  await extract(archivePath, { dir: tempDir });
100
104
  return;
101
105
  }
102
- const tar = (await import('tar')).default;
106
+ const tarMod = await import('tar');
107
+ const tar = tarMod.default || tarMod;
108
+ if (!tar || typeof tar.x !== 'function') {
109
+ throw new Error('tar module does not export x() extractor');
110
+ }
103
111
  await tar.x({
104
112
  file: archivePath,
105
113
  cwd: tempDir,