wyzie-lib 1.0.0 → 1.0.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.
package/README.md CHANGED
@@ -20,7 +20,7 @@ pnpm install wyzie-lib
20
20
  ```ts
21
21
  import { type SubtitleData, searchSubtitles } from 'wyzie-lib';
22
22
 
23
- const data: SubtitleData[] = await Search({ tmdb_id: 286217, language: "en" });
23
+ const data: SubtitleData[] = await searchSubtitles({ tmdb_id: 286217, language: "en" });
24
24
  console.log(data[0].id);
25
25
  ```
26
26
 
@@ -1,29 +1,29 @@
1
- async function h(t) {
2
- const { tmdb_id: r, imdb_id: a, season: e, episode: c, language: i, format: u } = t, o = new URL("https://subs.wyzie.ru/search"), s = {
3
- id: r || a,
4
- season: e,
1
+ async function h(r) {
2
+ const { tmdb_id: t, imdb_id: o, season: a, episode: c, language: i, format: u } = r, e = new URL("https://subs.wyzie.ru/search"), s = {
3
+ id: t || o,
4
+ season: a,
5
5
  episode: c,
6
6
  language: i,
7
7
  format: u
8
8
  };
9
9
  return Object.keys(s).forEach((n) => {
10
- s[n] !== void 0 && o.searchParams.append(n, String(s[n]));
11
- }), o;
10
+ s[n] !== void 0 && e.searchParams.append(n, String(s[n]));
11
+ }), e;
12
12
  }
13
- async function f(t) {
14
- const r = await fetch(t.toString());
15
- if (!r.ok)
16
- throw new Error(`HTTP error! status: ${r.status}`);
17
- return await r.json();
13
+ async function f(r) {
14
+ const t = await fetch(r.toString());
15
+ if (!t.ok)
16
+ throw new Error(`HTTP error! status: ${t.status}`);
17
+ return await t.json();
18
18
  }
19
- async function w(t) {
19
+ async function w(r) {
20
20
  try {
21
- const r = await h(t);
22
- return await f(r);
23
- } catch (r) {
24
- throw console.error("Error fetching subtitles:", r), r;
21
+ const t = await h(r);
22
+ return await f(t);
23
+ } catch (t) {
24
+ throw console.error("Error fetching subtitles:", t), t;
25
25
  }
26
26
  }
27
27
  export {
28
- w as Search
28
+ w as searchSubtitles
29
29
  };
@@ -1 +1 @@
1
- (function(e,r){typeof exports=="object"&&typeof module<"u"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):(e=typeof globalThis<"u"?globalThis:e||self,r(e.WyzieLib={}))})(this,function(e){"use strict";async function r(n){const{tmdb_id:t,imdb_id:u,season:f,episode:d,language:h,format:l}=n,i=new URL("https://subs.wyzie.ru/search"),o={id:t||u,season:f,episode:d,language:h,format:l};return Object.keys(o).forEach(s=>{o[s]!==void 0&&i.searchParams.append(s,String(o[s]))}),i}async function a(n){const t=await fetch(n.toString());if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}async function c(n){try{const t=await r(n);return await a(t)}catch(t){throw console.error("Error fetching subtitles:",t),t}}e.Search=c,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
1
+ (function(e,r){typeof exports=="object"&&typeof module<"u"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):(e=typeof globalThis<"u"?globalThis:e||self,r(e.WyzieLib={}))})(this,function(e){"use strict";async function r(n){const{tmdb_id:t,imdb_id:u,season:f,episode:d,language:h,format:l}=n,i=new URL("https://subs.wyzie.ru/search"),s={id:t||u,season:f,episode:d,language:h,format:l};return Object.keys(s).forEach(o=>{s[o]!==void 0&&i.searchParams.append(o,String(s[o]))}),i}async function a(n){const t=await fetch(n.toString());if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}async function c(n){try{const t=await r(n);return await a(t)}catch(t){throw console.error("Error fetching subtitles:",t),t}}e.searchSubtitles=c,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wyzie-lib",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "main": "dist/wyzie-lib.umd.js",
5
5
  "module": "dist/wyzie-lib.es.js",
6
6
  "types": "dist/index.d.ts",