1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export const validatePolyFilling = () => {
|
14 | if (typeof Promise === "undefined" && typeof fetch === "undefined") {
|
15 | const error = new Error("Library cannot function without Promise and fetch. So, please provide polyfill for them.");
|
16 | error.name = "PolyFillNotAvailable";
|
17 | throw error;
|
18 | }
|
19 | else if (typeof Promise === "undefined") {
|
20 | const error = new Error("Library cannot function without Promise. So, please provide polyfill for it.");
|
21 | error.name = "PolyFillNotAvailable";
|
22 | throw error;
|
23 | }
|
24 | else if (typeof fetch === "undefined") {
|
25 | const error = new Error("Library cannot function without fetch. So, please provide polyfill for it.");
|
26 | error.name = "PolyFillNotAvailable";
|
27 | throw error;
|
28 | }
|
29 | return true;
|
30 | };
|
31 |
|
\ | No newline at end of file |