@stemy/ngx-utils 19.9.8 → 19.9.9
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.
|
@@ -2483,30 +2483,30 @@ class Initializer {
|
|
|
2483
2483
|
|
|
2484
2484
|
class LoaderUtils {
|
|
2485
2485
|
static { this.promises = {}; }
|
|
2486
|
-
static loadScript(src, async = false, type = "text/javascript", parent) {
|
|
2486
|
+
static loadScript(src, async = false, type = "text/javascript", parent, time = true) {
|
|
2487
2487
|
return LoaderUtils.loadElement(src, parent, () => {
|
|
2488
2488
|
const script = document.createElement("script");
|
|
2489
2489
|
script.type = type;
|
|
2490
|
-
script.src = LoaderUtils.updateSrc(src);
|
|
2490
|
+
script.src = LoaderUtils.updateSrc(src, time);
|
|
2491
2491
|
script.async = async;
|
|
2492
2492
|
return script;
|
|
2493
2493
|
});
|
|
2494
2494
|
}
|
|
2495
|
-
static loadStyle(src, parent) {
|
|
2495
|
+
static loadStyle(src, parent, time = true) {
|
|
2496
2496
|
return LoaderUtils.loadElement(src, parent, () => {
|
|
2497
2497
|
const link = document.createElement("link");
|
|
2498
2498
|
link.rel = "stylesheet";
|
|
2499
2499
|
link.type = "text/css";
|
|
2500
|
-
link.href = LoaderUtils.updateSrc(src);
|
|
2500
|
+
link.href = LoaderUtils.updateSrc(src, time);
|
|
2501
2501
|
return link;
|
|
2502
2502
|
});
|
|
2503
2503
|
}
|
|
2504
|
-
static updateSrc(src) {
|
|
2505
|
-
if (src
|
|
2504
|
+
static updateSrc(src, time) {
|
|
2505
|
+
if (src.startsWith("data:") || !time) {
|
|
2506
2506
|
return src;
|
|
2507
2507
|
}
|
|
2508
2508
|
const url = new URL(src);
|
|
2509
|
-
url.searchParams.set("time", String(Date.now()));
|
|
2509
|
+
url.searchParams.set("time", typeof time === "string" ? time : String(Date.now()));
|
|
2510
2510
|
return url.toString();
|
|
2511
2511
|
}
|
|
2512
2512
|
static loadElement(src, parent, setup) {
|