@sprucelabs/spruce-image-utils 10.0.164 → 10.0.165

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,14 +23,13 @@ class FakeImageUploader {
23
23
  this._shouldThrow = true;
24
24
  }
25
25
  async upload(options) {
26
- var _a;
27
26
  if (FakeImageUploader._shouldThrow) {
28
27
  throw new SpruceError_1.default({
29
28
  code: 'INVALID_IMAGE',
30
29
  });
31
30
  }
32
31
  FakeImageUploader.lastUploadOptions = options;
33
- return ((_a = FakeImageUploader.fakeUploadedImage) !== null && _a !== void 0 ? _a : generateUploadedImageValues());
32
+ return (FakeImageUploader.fakeUploadedImage ?? generateUploadedImageValues());
34
33
  }
35
34
  static setUploadResponse(image) {
36
35
  this.fakeUploadedImage = image;
@@ -8,7 +8,7 @@ class SpruceError extends error_1.default {
8
8
  friendlyMessage() {
9
9
  const { options } = this;
10
10
  let message;
11
- switch (options === null || options === void 0 ? void 0 : options.code) {
11
+ switch (options?.code) {
12
12
  case 'EMPTY_BUFFER':
13
13
  message = `Empty buffer found - file failed to convert!`;
14
14
  break;
@@ -6,9 +6,8 @@ class RemoteImageUploader {
6
6
  this.client = client;
7
7
  }
8
8
  static Uploader(options) {
9
- var _a;
10
9
  const { client } = (0, schema_1.assertOptions)(options, ['client']);
11
- return new ((_a = this.UploaderClass) !== null && _a !== void 0 ? _a : this)(client);
10
+ return new (this.UploaderClass ?? this)(client);
12
11
  }
13
12
  static setClass(Class) {
14
13
  this.UploaderClass = Class;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-image-utils",
3
3
  "description": "Support for working with images and Sprucebot. 📈",
4
- "version": "10.0.164",
4
+ "version": "10.0.165",
5
5
  "skill": {
6
6
  "namespace": "images"
7
7
  },