@runnerpro/backend 1.2.4 → 1.2.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.
@@ -23,7 +23,7 @@ const reduceSizeImage = (file, newWidth = 100, quality = 80) => __awaiter(void 0
23
23
  if (typeof file === 'object') {
24
24
  // Write this image to a file in uploads
25
25
  const uid = (0, uuid_1.v4)();
26
- filePath = path_1.default.join(process.cwd(), 'uploads', `${uid}.jpg`);
26
+ filePath = path_1.default.join(process.cwd(), 'uploads', `${uid}.webp`);
27
27
  fs_1.default.writeFileSync(filePath, file);
28
28
  }
29
29
  else {
@@ -40,7 +40,7 @@ const reduceSizeImage = (file, newWidth = 100, quality = 80) => __awaiter(void 0
40
40
  image = yield image.quality(quality);
41
41
  // @ts-ignore
42
42
  image = yield image.getBufferAsync(jimp_1.default.MIME_JPEG);
43
- if (typeof filePath === 'object')
43
+ if (typeof file === 'object')
44
44
  fs_1.default.unlinkSync(filePath);
45
45
  return image;
46
46
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runnerpro/backend",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "A collection of common backend functions",
5
5
  "exports": {
6
6
  ".": "./lib/cjs/index.js"