@shibam/sticker-maker 1.0.6 → 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.
- package/dist/index.js +17 -12
- 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
|
-
|
|
152
|
-
|
|
151
|
+
var _a;
|
|
152
|
+
return __generator(this, function (_b) {
|
|
153
|
+
switch (_b.label) {
|
|
153
154
|
case 0:
|
|
154
|
-
|
|
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
|
-
|
|
159
|
-
|
|
160
|
-
case 2: return [4 /*yield*/,
|
|
159
|
+
_b.sent();
|
|
160
|
+
return [3 /*break*/, 4];
|
|
161
|
+
case 2: return [4 /*yield*/, this.toBuffer()];
|
|
161
162
|
case 3:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
case 4:
|
|
165
|
-
|
|
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
|
|
172
|
+
case 7: return [2 /*return*/];
|
|
168
173
|
}
|
|
169
174
|
});
|
|
170
175
|
});
|