50p82u21t54k 0.0.5 → 0.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.
@@ -1,17 +1,17 @@
1
- let u = "", n = !1;
1
+ let o = "", u = !1;
2
2
  function r(t) {
3
- u = t;
3
+ o = t;
4
4
  }
5
5
  function c() {
6
- return `${u}/api`;
6
+ return `${o}/api`;
7
7
  }
8
8
  function l(t) {
9
- n = t;
9
+ u = t;
10
10
  }
11
- function i() {
12
- return n;
11
+ function g() {
12
+ return u;
13
13
  }
14
- const g = {
14
+ const i = {
15
15
  install(t, s) {
16
16
  r(s.baseURL), l(s.status);
17
17
  }
@@ -26,11 +26,19 @@ async function f() {
26
26
  const s = `${c()}/products`, e = await fetch(s, {
27
27
  method: "GET"
28
28
  }), a = await e.text();
29
- if (i() && (console.log(e.status), console.log(a)), t.status = e.status == 200, !t.status)
29
+ if (g()) {
30
+ console.log(e.status);
31
+ try {
32
+ console.log(JSON.parse(a));
33
+ } catch {
34
+ console.log(a);
35
+ }
36
+ }
37
+ if (t.status = e.status == 200, !t.status)
30
38
  return t.message = a, t;
31
39
  if (t.status && e.ok) {
32
- const o = JSON.parse(a);
33
- return t.data = o.results.data, t;
40
+ const n = JSON.parse(a);
41
+ return t.data = n.results.data, t;
34
42
  }
35
43
  return t;
36
44
  } catch (s) {
@@ -39,5 +47,5 @@ async function f() {
39
47
  }
40
48
  export {
41
49
  f as getProducts,
42
- g as libraryPlugin
50
+ i as libraryPlugin
43
51
  };
@@ -1 +1 @@
1
- (function(e,s){typeof exports=="object"&&typeof module<"u"?s(exports):typeof define=="function"&&define.amd?define(["exports"],s):(e=typeof globalThis<"u"?globalThis:e||self,s(e["50p82u21t54k"]={}))})(this,function(e){"use strict";let s="",a=!1;function i(t){s=t}function r(){return`${s}/api`}function c(t){a=t}function f(){return a}const d={install(t,n){i(n.baseURL),c(n.status)}};async function l(){const t={status:!1,message:"",data:[]};try{const n=`${r()}/products`,u=await fetch(n,{method:"GET"}),o=await u.text();if(f()&&(console.log(u.status),console.log(o)),t.status=u.status==200,!t.status)return t.message=o,t;if(t.status&&u.ok){const g=JSON.parse(o);return t.data=g.results.data,t}return t}catch(n){return t.status=!1,t.message=`${n}`,t}}e.getProducts=l,e.libraryPlugin=d,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
1
+ (function(e,s){typeof exports=="object"&&typeof module<"u"?s(exports):typeof define=="function"&&define.amd?define(["exports"],s):(e=typeof globalThis<"u"?globalThis:e||self,s(e["50p82u21t54k"]={}))})(this,function(e){"use strict";let s="",a=!1;function r(t){s=t}function c(){return`${s}/api`}function f(t){a=t}function l(){return a}const d={install(t,n){r(n.baseURL),f(n.status)}};async function g(){const t={status:!1,message:"",data:[]};try{const n=`${c()}/products`,o=await fetch(n,{method:"GET"}),u=await o.text();if(l()){console.log(o.status);try{console.log(JSON.parse(u))}catch{console.log(u)}}if(t.status=o.status==200,!t.status)return t.message=u,t;if(t.status&&o.ok){const i=JSON.parse(u);return t.data=i.results.data,t}return t}catch(n){return t.status=!1,t.message=`${n}`,t}}e.getProducts=g,e.libraryPlugin=d,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
@@ -1 +1 @@
1
- {"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../src/products/method.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE1C,wBAAsB,WAAW,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAwC7D"}
1
+ {"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../src/products/method.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAEnD,wBAAsB,WAAW,IAAI,OAAO,CAAC,gBAAgB,CAAC,CA4C7D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "50p82u21t54k",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "A description of your library",
5
5
  "main": "dist/50p82u21t54k.umd.js",
6
6
  "module": "dist/50p82u21t54k.es.js",