@react-pakistan/util-functions 1.25.28 → 1.25.30
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/api/stellar-solutions/type.d.ts +130 -183
- package/api/stellar-solutions/type.js +17 -44
- package/constants/dial-codes.d.ts +7 -0
- package/constants/dial-codes.js +1216 -0
- package/constants/index.d.ts +1 -0
- package/constants/index.js +1 -0
- package/general/get-dial-code.d.ts +1 -0
- package/general/get-dial-code.js +8 -0
- package/general/index.d.ts +3 -2
- package/general/index.js +3 -2
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/package.json +1 -1
- package/api/cors/index.d.ts +0 -1
- package/api/cors/index.js +0 -26
package/constants/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './api-methods';
|
|
|
2
2
|
export * from './cache-time';
|
|
3
3
|
export * from './countries-timezones';
|
|
4
4
|
export * from './currencies';
|
|
5
|
+
export * from './dial-codes';
|
|
5
6
|
export * from './layout-direction';
|
|
6
7
|
export * from './react-pakistan-meta';
|
|
7
8
|
export * from './react-pakistan';
|
package/constants/index.js
CHANGED
|
@@ -18,6 +18,7 @@ __exportStar(require("./api-methods"), exports);
|
|
|
18
18
|
__exportStar(require("./cache-time"), exports);
|
|
19
19
|
__exportStar(require("./countries-timezones"), exports);
|
|
20
20
|
__exportStar(require("./currencies"), exports);
|
|
21
|
+
__exportStar(require("./dial-codes"), exports);
|
|
21
22
|
__exportStar(require("./layout-direction"), exports);
|
|
22
23
|
__exportStar(require("./react-pakistan-meta"), exports);
|
|
23
24
|
__exportStar(require("./react-pakistan"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getDialCode: (countryCode: string) => string | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDialCode = void 0;
|
|
4
|
+
var dial_codes_1 = require("../constants/dial-codes");
|
|
5
|
+
var getDialCode = function (countryCode) {
|
|
6
|
+
return dial_codes_1.dialCodeMap.get(countryCode);
|
|
7
|
+
};
|
|
8
|
+
exports.getDialCode = getDialCode;
|
package/general/index.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ export * from './basic-post';
|
|
|
3
3
|
export * from './calculate-pages';
|
|
4
4
|
export * from './camel-to-sentence-case';
|
|
5
5
|
export * from './check-even-odd-length';
|
|
6
|
+
export * from './cnic-formatter';
|
|
6
7
|
export * from './countries';
|
|
8
|
+
export * from './crypto';
|
|
7
9
|
export * from './delete-image-from-private-supabase';
|
|
8
10
|
export * from './delete-image-from-public-supabase';
|
|
9
11
|
export * from './download-from-url';
|
|
@@ -15,7 +17,6 @@ export * from './fetch-supabase-private-assets';
|
|
|
15
17
|
export * from './format-date';
|
|
16
18
|
export * from './format-number';
|
|
17
19
|
export * from './format-phone';
|
|
18
|
-
export * from './cnic-formatter';
|
|
19
20
|
export * from './format-pricing';
|
|
20
21
|
export * from './format-secs';
|
|
21
22
|
export * from './format-time';
|
|
@@ -65,6 +66,7 @@ export * from './get-calendar-next-month';
|
|
|
65
66
|
export * from './get-calendar-previous-month';
|
|
66
67
|
export * from './get-current-year';
|
|
67
68
|
export * from './get-day-name';
|
|
69
|
+
export * from './get-dial-code';
|
|
68
70
|
export * from './get-full-name';
|
|
69
71
|
export * from './get-href';
|
|
70
72
|
export * from './get-month-name';
|
|
@@ -91,7 +93,6 @@ export * from './text-to-enum';
|
|
|
91
93
|
export * from './time-out';
|
|
92
94
|
export * from './truncate-text';
|
|
93
95
|
export * from './type';
|
|
94
|
-
export * from './crypto';
|
|
95
96
|
export * from './upload-blob-to-private-supabase';
|
|
96
97
|
export * from './upload-blob-to-public-supabase';
|
|
97
98
|
export * from './upload-image-to-private-supabase';
|
package/general/index.js
CHANGED
|
@@ -19,7 +19,9 @@ __exportStar(require("./basic-post"), exports);
|
|
|
19
19
|
__exportStar(require("./calculate-pages"), exports);
|
|
20
20
|
__exportStar(require("./camel-to-sentence-case"), exports);
|
|
21
21
|
__exportStar(require("./check-even-odd-length"), exports);
|
|
22
|
+
__exportStar(require("./cnic-formatter"), exports);
|
|
22
23
|
__exportStar(require("./countries"), exports);
|
|
24
|
+
__exportStar(require("./crypto"), exports);
|
|
23
25
|
__exportStar(require("./delete-image-from-private-supabase"), exports);
|
|
24
26
|
__exportStar(require("./delete-image-from-public-supabase"), exports);
|
|
25
27
|
__exportStar(require("./download-from-url"), exports);
|
|
@@ -31,7 +33,6 @@ __exportStar(require("./fetch-supabase-private-assets"), exports);
|
|
|
31
33
|
__exportStar(require("./format-date"), exports);
|
|
32
34
|
__exportStar(require("./format-number"), exports);
|
|
33
35
|
__exportStar(require("./format-phone"), exports);
|
|
34
|
-
__exportStar(require("./cnic-formatter"), exports);
|
|
35
36
|
__exportStar(require("./format-pricing"), exports);
|
|
36
37
|
__exportStar(require("./format-secs"), exports);
|
|
37
38
|
__exportStar(require("./format-time"), exports);
|
|
@@ -81,6 +82,7 @@ __exportStar(require("./get-calendar-next-month"), exports);
|
|
|
81
82
|
__exportStar(require("./get-calendar-previous-month"), exports);
|
|
82
83
|
__exportStar(require("./get-current-year"), exports);
|
|
83
84
|
__exportStar(require("./get-day-name"), exports);
|
|
85
|
+
__exportStar(require("./get-dial-code"), exports);
|
|
84
86
|
__exportStar(require("./get-full-name"), exports);
|
|
85
87
|
__exportStar(require("./get-href"), exports);
|
|
86
88
|
__exportStar(require("./get-month-name"), exports);
|
|
@@ -107,7 +109,6 @@ __exportStar(require("./text-to-enum"), exports);
|
|
|
107
109
|
__exportStar(require("./time-out"), exports);
|
|
108
110
|
__exportStar(require("./truncate-text"), exports);
|
|
109
111
|
__exportStar(require("./type"), exports);
|
|
110
|
-
__exportStar(require("./crypto"), exports);
|
|
111
112
|
__exportStar(require("./upload-blob-to-private-supabase"), exports);
|
|
112
113
|
__exportStar(require("./upload-blob-to-public-supabase"), exports);
|
|
113
114
|
__exportStar(require("./upload-image-to-private-supabase"), exports);
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./api/cors"), exports);
|
|
18
17
|
__exportStar(require("./api/stellar-solutions/app-user"), exports);
|
|
19
18
|
__exportStar(require("./api/stellar-solutions/bank"), exports);
|
|
20
19
|
__exportStar(require("./api/stellar-solutions/branch"), exports);
|
package/package.json
CHANGED
package/api/cors/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getCorsHeaders: (origin: string) => unknown;
|
package/api/cors/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCorsHeaders = void 0;
|
|
4
|
-
var getCorsHeaders = function (origin) {
|
|
5
|
-
// Default options
|
|
6
|
-
var headers = {
|
|
7
|
-
'Access-Control-Allow-Methods': "".concat(process.env.ALLOWED_METHODS),
|
|
8
|
-
'Access-Control-Allow-Headers': "".concat(process.env.ALLOWED_HEADERS),
|
|
9
|
-
'Access-Control-Allow-Origin': "".concat(process.env.ALLOWED_ORIGIN),
|
|
10
|
-
};
|
|
11
|
-
// If no allowed origin is set to default server origin
|
|
12
|
-
if (!process.env.ALLOWED_ORIGIN || !origin)
|
|
13
|
-
return headers;
|
|
14
|
-
// If allowed origin is set, check if origin is in allowed origins
|
|
15
|
-
var allowedOrigins = process.env.ALLOWED_ORIGIN.split(',');
|
|
16
|
-
// Validate server origin
|
|
17
|
-
if (allowedOrigins.includes('*')) {
|
|
18
|
-
headers['Access-Control-Allow-Origin'] = '*';
|
|
19
|
-
}
|
|
20
|
-
else if (allowedOrigins.includes(origin)) {
|
|
21
|
-
headers['Access-Control-Allow-Origin'] = origin;
|
|
22
|
-
}
|
|
23
|
-
// Return result
|
|
24
|
-
return headers;
|
|
25
|
-
};
|
|
26
|
-
exports.getCorsHeaders = getCorsHeaders;
|