@shibam/sticker-maker 1.0.5 → 1.0.7

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -148,23 +148,28 @@ var Sticker = /** @class */ (function () {
148
148
  Sticker.prototype.toFile = function (outputPath) {
149
149
  return __awaiter(this, void 0, void 0, function () {
150
150
  var error_3;
151
- return __generator(this, function (_a) {
152
- switch (_a.label) {
151
+ var _a;
152
+ return __generator(this, function (_b) {
153
+ switch (_b.label) {
153
154
  case 0:
154
- _a.trys.push([0, 4, , 5]);
155
- if (!(!this.activeBuff && !this.activeMeta)) return [3 /*break*/, 2];
155
+ _b.trys.push([0, 6, , 7]);
156
+ if (!(!this.activeBuff && !this.activeMeta && ((_a = this.extType) === null || _a === void 0 ? void 0 : _a.includes('webp')))) return [3 /*break*/, 2];
156
157
  return [4 /*yield*/, this.changeMetaInfo()];
157
158
  case 1:
158
- _a.sent();
159
- _a.label = 2;
160
- case 2: return [4 /*yield*/, fs_1.default.promises.writeFile(outputPath, this.outBuffer)];
159
+ _b.sent();
160
+ return [3 /*break*/, 4];
161
+ case 2: return [4 /*yield*/, this.toBuffer()];
161
162
  case 3:
162
- _a.sent();
163
- return [3 /*break*/, 5];
164
- case 4:
165
- error_3 = _a.sent();
163
+ _b.sent();
164
+ _b.label = 4;
165
+ case 4: return [4 /*yield*/, fs_1.default.promises.writeFile(outputPath, this.outBuffer)];
166
+ case 5:
167
+ _b.sent();
168
+ return [3 /*break*/, 7];
169
+ case 6:
170
+ error_3 = _b.sent();
166
171
  throw new Error("Conversion to file failed: ".concat(error_3));
167
- case 5: return [2 /*return*/];
172
+ case 7: return [2 /*return*/];
168
173
  }
169
174
  });
170
175
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shibam/sticker-maker",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "A package for creating stickers",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",