@zennify/sdk-js 1.31.0 → 1.32.0

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/images.js CHANGED
@@ -8,9 +8,9 @@ const sources = {
8
8
  'null': null,
9
9
  'empty': ""
10
10
  };
11
- function GetImageURL(source, hash, domain = "zennify.app") {
11
+ function GetImageURL(source, hash, domain = "zennify.app", extension = ".webp") {
12
12
  if (!hash)
13
13
  return sources[source];
14
14
  else
15
- return `https://cdn.${domain}/media/${hash}`;
15
+ return `https://cdn.${domain}/media/${hash}${extension}`;
16
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zennify/sdk-js",
3
- "version": "1.31.0",
3
+ "version": "1.32.0",
4
4
  "description": "A simple package to work with https://api.zennify.app",
5
5
  "main": "dist/main.js",
6
6
  "keywords": [],
package/src/images.ts CHANGED
@@ -17,8 +17,9 @@ const sources: Record<keyof ImageSources, ImageSources[keyof ImageSources]> = {
17
17
  export function GetImageURL<Source extends keyof ImageSources>(
18
18
  source: Source,
19
19
  hash?: string | null,
20
- domain: string = "zennify.app"
20
+ domain: string = "zennify.app",
21
+ extension = ".webp"
21
22
  ): ImageSources[Source] | string {
22
23
  if (!hash) return sources[source] as ImageSources[Source];
23
- else return `https://cdn.${domain}/media/${hash}`;
24
+ else return `https://cdn.${domain}/media/${hash}${extension}`;
24
25
  }
package/types/images.d.ts CHANGED
@@ -5,5 +5,5 @@ interface ImageSources {
5
5
  product_icon: string;
6
6
  general: string;
7
7
  }
8
- export declare function GetImageURL<Source extends keyof ImageSources>(source: Source, hash?: string | null, domain?: string): ImageSources[Source] | string;
8
+ export declare function GetImageURL<Source extends keyof ImageSources>(source: Source, hash?: string | null, domain?: string, extension?: string): ImageSources[Source] | string;
9
9
  export {};