@react-pakistan/util-functions 1.23.22 → 1.23.24
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/constants/select-value-delimiter.d.ts +6 -4
- package/constants/select-value-delimiter.js +7 -5
- package/general/index.d.ts +1 -0
- package/general/index.js +1 -0
- package/general/upload-image-blob-to-supabase.d.ts +8 -0
- package/general/upload-image-blob-to-supabase.js +27 -0
- package/package.json +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
COLON: string;
|
|
3
|
-
SEMI_COLON: string;
|
|
4
|
-
STAR: string;
|
|
1
|
+
export declare const VALUE_DELIMITER: {
|
|
5
2
|
AT: string;
|
|
3
|
+
COLON: string;
|
|
4
|
+
COMMA: string;
|
|
6
5
|
DOLLAR: string;
|
|
6
|
+
DOT: string;
|
|
7
|
+
SEMI_COLON: string;
|
|
7
8
|
SLASH: string;
|
|
9
|
+
STAR: string;
|
|
8
10
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
COLON: ':',
|
|
6
|
-
SEMI_COLON: ';',
|
|
7
|
-
STAR: '*',
|
|
3
|
+
exports.VALUE_DELIMITER = void 0;
|
|
4
|
+
exports.VALUE_DELIMITER = {
|
|
8
5
|
AT: '@',
|
|
6
|
+
COLON: ':',
|
|
7
|
+
COMMA: ',',
|
|
9
8
|
DOLLAR: '$',
|
|
9
|
+
DOT: '.',
|
|
10
|
+
SEMI_COLON: ';',
|
|
10
11
|
SLASH: '/',
|
|
12
|
+
STAR: '*',
|
|
11
13
|
};
|
package/general/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export * from './resolve-grid';
|
|
|
29
29
|
export * from './resolve-initials';
|
|
30
30
|
export * from './slugify';
|
|
31
31
|
export * from './truncate-text';
|
|
32
|
+
export * from './upload-image-blob-to-supabase';
|
|
32
33
|
export * from './upload-image-to-supabase';
|
|
33
34
|
export * from './url-to-sentence-case';
|
|
34
35
|
export * from './validate-comment';
|
package/general/index.js
CHANGED
|
@@ -46,6 +46,7 @@ __exportStar(require("./resolve-grid"), exports);
|
|
|
46
46
|
__exportStar(require("./resolve-initials"), exports);
|
|
47
47
|
__exportStar(require("./slugify"), exports);
|
|
48
48
|
__exportStar(require("./truncate-text"), exports);
|
|
49
|
+
__exportStar(require("./upload-image-blob-to-supabase"), exports);
|
|
49
50
|
__exportStar(require("./upload-image-to-supabase"), exports);
|
|
50
51
|
__exportStar(require("./url-to-sentence-case"), exports);
|
|
51
52
|
__exportStar(require("./validate-comment"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface UploadImageBlobToSupabaseArgs {
|
|
2
|
+
blob: Blob;
|
|
3
|
+
contentType: string;
|
|
4
|
+
fileRef: string;
|
|
5
|
+
supabase: any;
|
|
6
|
+
upsert: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const uploadImageBlobToSupabase: ({ blob, contentType, fileRef, supabase, upsert, }: UploadImageBlobToSupabaseArgs) => Promise<void>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.uploadImageBlobToSupabase = void 0;
|
|
14
|
+
const uploadImageBlobToSupabase = (_a) => __awaiter(void 0, [_a], void 0, function* ({ blob, contentType, fileRef, supabase, upsert, }) {
|
|
15
|
+
const { data, error } = yield supabase.storage
|
|
16
|
+
.from(process.env.NEXT_PUBLIC_SUPABASE_PRIVATE_BUCKET)
|
|
17
|
+
.upload(fileRef, blob, {
|
|
18
|
+
upsert,
|
|
19
|
+
cacheControl: process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
|
|
20
|
+
contentType,
|
|
21
|
+
});
|
|
22
|
+
if (error) {
|
|
23
|
+
return error;
|
|
24
|
+
}
|
|
25
|
+
return data;
|
|
26
|
+
});
|
|
27
|
+
exports.uploadImageBlobToSupabase = uploadImageBlobToSupabase;
|