@shibam/sticker-maker 1.1.8 → 1.1.10

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/dist/index.js CHANGED
@@ -115,4 +115,4 @@ class Sticker {
115
115
  }
116
116
  }
117
117
  }
118
- export default { Sticker, StickerTypes };
118
+ export { Sticker, StickerTypes };
@@ -1,4 +1,4 @@
1
- import sharp, { fit } from 'sharp';
1
+ import sharp from 'sharp';
2
2
  import { StickerTypes } from '../types/StickerTypes.js';
3
3
  import toGif from './toGif.js';
4
4
  /**
@@ -21,7 +21,7 @@ const ToWebp = async (buffer, metaInfo, mimeExt, mimeType) => {
21
21
  const res = sharp(data, { animated: isAnimated });
22
22
  if (metaInfo.type === StickerTypes.CIRCLE) {
23
23
  res.resize(512, 512, {
24
- fit: fit.cover
24
+ fit: sharp.fit.cover
25
25
  }).composite([
26
26
  {
27
27
  input: Buffer.from(`<svg width="512" height="512"><circle cx="256" cy="256" r="256" fill=""/></svg>`),
@@ -33,12 +33,12 @@ const ToWebp = async (buffer, metaInfo, mimeExt, mimeType) => {
33
33
  }
34
34
  else if (metaInfo.type === StickerTypes.SQUARE && !mimeType?.includes('video')) {
35
35
  res.resize(512, 512, {
36
- fit: fit.fill
36
+ fit: sharp.fit.fill
37
37
  });
38
38
  }
39
39
  else {
40
40
  res.resize(512, 512, {
41
- fit: fit.contain,
41
+ fit: sharp.fit.contain,
42
42
  background: { r: 0, g: 0, b: 0, alpha: 0 }
43
43
  });
44
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shibam/sticker-maker",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "description": "A package for creating stickers",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",