@mts-pjsc/image-optimize 1.1.1 → 1.1.2

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.
@@ -22,7 +22,7 @@ export declare class Image<P extends IImageOptions> extends React.Component<P> {
22
22
  * https://tb.mts.ru
23
23
  *
24
24
  */
25
- static imgOrigin: string;
25
+ static imgOrigin?: string;
26
26
  resultUrl: string;
27
27
  resizeCheckTimeout: number;
28
28
  thisComponent: HTMLImageElement | null;
@@ -98,7 +98,8 @@ export class Image extends React.Component {
98
98
  return Image.controlPoints[index];
99
99
  }
100
100
  makeResultUrl(optimalSize) {
101
- const sourceUrl = new URL(this.sourceUrl, Image.imgOrigin);
101
+ var _a;
102
+ const sourceUrl = new URL(this.sourceUrl, (_a = Image.imgOrigin) !== null && _a !== void 0 ? _a : location.origin);
102
103
  const url = new URL("/optimizer/optimize", location.origin);
103
104
  url.searchParams.set("src", sourceUrl.toString());
104
105
  url.searchParams.set("size", String(optimalSize));
@@ -181,4 +182,4 @@ Image.isWebP = null;
181
182
  *
182
183
  */
183
184
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, no-constant-binary-expression
184
- Image.imgOrigin = typeof process === void 0 ? location.origin : "";
185
+ Image.imgOrigin = void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mts-pjsc/image-optimize",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "React component for image optimizer",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",