@react-pakistan/util-functions 1.23.73 → 1.23.75

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.
@@ -5,6 +5,6 @@ export interface FetchDataParams {
5
5
  body?: string;
6
6
  }
7
7
  export declare const fetchData: ({ url, method, body, }: FetchDataParams) => Promise<{
8
- data: any | Array<any> | undefined;
8
+ data: any | undefined;
9
9
  error: Error | undefined;
10
10
  }>;
@@ -72,7 +72,7 @@ var fetchData = function (_a) { return __awaiter(void 0, [_a], void 0, function
72
72
  error = err_1;
73
73
  return [3 /*break*/, 4];
74
74
  case 4: return [2 /*return*/, {
75
- data: data.data,
75
+ data: data,
76
76
  error: error,
77
77
  }];
78
78
  }
@@ -3,6 +3,5 @@ export interface fetchSupabasePrivateImageArgs {
3
3
  callback: (url: string | Blob) => void;
4
4
  fetchUrl: string;
5
5
  token: string;
6
- mode?: 'web' | 'mobile';
7
6
  }
8
- export declare const fetchSupabasePrivateImage: ({ apikey, callback, fetchUrl, token, mode, }: fetchSupabasePrivateImageArgs) => Promise<void>;
7
+ export declare const fetchSupabasePrivateImage: ({ apikey, callback, fetchUrl, token, }: fetchSupabasePrivateImageArgs) => Promise<void>;
@@ -41,9 +41,9 @@ exports.fetchSupabasePrivateImage = void 0;
41
41
  var constants_1 = require("../constants");
42
42
  var fetchSupabasePrivateImage = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
43
43
  var response, blob, url;
44
- var apikey = _b.apikey, callback = _b.callback, fetchUrl = _b.fetchUrl, token = _b.token, _c = _b.mode, mode = _c === void 0 ? 'web' : _c;
45
- return __generator(this, function (_d) {
46
- switch (_d.label) {
44
+ var apikey = _b.apikey, callback = _b.callback, fetchUrl = _b.fetchUrl, token = _b.token;
45
+ return __generator(this, function (_c) {
46
+ switch (_c.label) {
47
47
  case 0: return [4 /*yield*/, fetch(fetchUrl, {
48
48
  method: constants_1.API_METHODS.GET,
49
49
  headers: {
@@ -53,18 +53,14 @@ var fetchSupabasePrivateImage = function (_a) { return __awaiter(void 0, [_a], v
53
53
  },
54
54
  })];
55
55
  case 1:
56
- response = _d.sent();
56
+ response = _c.sent();
57
57
  if (!response.ok) return [3 /*break*/, 3];
58
58
  return [4 /*yield*/, response.blob()];
59
59
  case 2:
60
- blob = _d.sent();
61
- if (mode === 'mobile') {
62
- callback(blob);
63
- return [2 /*return*/];
64
- }
60
+ blob = _c.sent();
65
61
  url = URL.createObjectURL(blob);
66
62
  callback(url);
67
- _d.label = 3;
63
+ _c.label = 3;
68
64
  case 3: return [2 /*return*/];
69
65
  }
70
66
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.23.73",
3
+ "version": "1.23.75",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {