nextemos 4.0.5 → 4.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.
@@ -13,7 +13,9 @@ interface IThumbImage {
13
13
  }
14
14
  declare const cdn: {
15
15
  url: string;
16
+ videoUrl: string;
16
17
  thumbImage: (props: IThumbImage) => string;
17
18
  getFile: (path?: string) => string;
19
+ getVideo: (path?: string) => string;
18
20
  };
19
21
  export default cdn;
@@ -3,12 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const html_entities_1 = require("html-entities");
4
4
  // Ortam değişkenlerinden CDN URL'si alınıyor, tanımlı değilse varsayılan olarak 'https://images.proj-e.com' kullanılıyor
5
5
  const CDN_URL = process.env.CDN_URL || 'https://images.proj-e.com';
6
+ const VIDEO_CDN_URL = process.env.VIDEO_CDN_URL || CDN_URL;
6
7
  // Ortam değişkenlerinden CDN sağlayıcısı alınıyor
7
8
  const CDN_PROVIDER = process.env.CDN_PROVIDER;
8
9
  // CDN işlemleri için kullanılan nesne
9
10
  const cdn = {
10
11
  // CDN URL'sini döndüren özellik
11
12
  url: CDN_URL,
13
+ // Video CDN URL'sini döndüren özellik
14
+ videoUrl: VIDEO_CDN_URL,
12
15
  // Thumbnail URL'si oluşturan fonksiyon
13
16
  thumbImage: function (props) {
14
17
  switch (CDN_PROVIDER) { // CDN sağlayıcısına göre işlemci fonksiyonunu seçiyor
@@ -21,8 +24,12 @@ const cdn = {
21
24
  }
22
25
  },
23
26
  // CDN'deki dosyayı linkini getiren fonksiyon
24
- getFile: function name(path = '') {
27
+ getFile: function (path = '') {
25
28
  return `${this.url}/${encodeURI((0, html_entities_1.decode)(path))}`;
29
+ },
30
+ // CDN'deki video url'ini getiren fonksiyon
31
+ getVideo: function (path = '') {
32
+ return `${this.videoUrl}/${encodeURI((0, html_entities_1.decode)(path))}`;
26
33
  }
27
34
  };
28
35
  // Değerin geçerli olup olmadığını kontrol eden ve string olarak döndüren yardımcı fonksiyon
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "4.0.5",
3
+ "version": "4.0.7",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",