stegdoc 5.4.0 → 5.5.0

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": "stegdoc",
3
- "version": "5.4.0",
3
+ "version": "5.5.0",
4
4
  "description": "Hide files inside Office documents (XLSX/DOCX) with AES-256 encryption and steganography",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -30,12 +30,14 @@ function zipFolder(folderPath) {
30
30
  */
31
31
  async function detectFileType(filePath) {
32
32
  try {
33
- const { fileTypeFromBuffer } = await import('file-type');
33
+ const fileType = await import('file-type');
34
+ const fromBuffer = fileType.fileTypeFromBuffer || fileType.default?.fromBuffer;
35
+ if (!fromBuffer) return null;
34
36
  const fd = await fs.promises.open(filePath, 'r');
35
37
  const buf = Buffer.alloc(4100);
36
38
  await fd.read(buf, 0, 4100, 0);
37
39
  await fd.close();
38
- return await fileTypeFromBuffer(buf);
40
+ return await fromBuffer(buf);
39
41
  } catch {
40
42
  return null;
41
43
  }
package/src/index.js CHANGED
@@ -11,7 +11,7 @@ const verifyCommand = require('./commands/verify');
11
11
  program
12
12
  .name('stegdoc')
13
13
  .description('CLI tool to encode files into Office documents with AES-256 encryption')
14
- .version('5.4.0');
14
+ .version('5.5.0');
15
15
 
16
16
  // Encode command
17
17
  program