@push.rocks/smartarchive 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartarchive',
6
- version: '5.0.0',
6
+ version: '5.0.1',
7
7
  description: 'A library for working with archive files, providing utilities for compressing and decompressing data.'
8
8
  }
@@ -118,26 +118,21 @@ export class GzipTools {
118
118
 
119
119
  /**
120
120
  * Compress data asynchronously
121
+ * Note: Uses sync version for Deno compatibility (fflate async uses Web Workers
122
+ * which have issues in Deno)
121
123
  */
122
124
  public async compress(data: Buffer, level?: TCompressionLevel): Promise<Buffer> {
123
- return new Promise((resolve, reject) => {
124
- const options = level !== undefined ? { level } : undefined;
125
- plugins.fflate.gzip(data, options as plugins.fflate.AsyncGzipOptions, (err, result) => {
126
- if (err) reject(err);
127
- else resolve(Buffer.from(result));
128
- });
129
- });
125
+ // Use sync version wrapped in Promise for cross-runtime compatibility
126
+ return this.compressSync(data, level);
130
127
  }
131
128
 
132
129
  /**
133
130
  * Decompress data asynchronously
131
+ * Note: Uses sync version for Deno compatibility (fflate async uses Web Workers
132
+ * which have issues in Deno)
134
133
  */
135
134
  public async decompress(data: Buffer): Promise<Buffer> {
136
- return new Promise((resolve, reject) => {
137
- plugins.fflate.gunzip(data, (err, result) => {
138
- if (err) reject(err);
139
- else resolve(Buffer.from(result));
140
- });
141
- });
135
+ // Use sync version wrapped in Promise for cross-runtime compatibility
136
+ return this.decompressSync(data);
142
137
  }
143
138
  }