unhead 1.11.8 → 1.11.10
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/dist/index.cjs +6 -5
- package/dist/index.mjs +6 -5
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -594,7 +594,7 @@ function useScript(_input, _options) {
|
|
|
594
594
|
_cbs
|
|
595
595
|
});
|
|
596
596
|
loadPromise.then((api) => {
|
|
597
|
-
if (api) {
|
|
597
|
+
if (api !== false) {
|
|
598
598
|
script.instance = api;
|
|
599
599
|
_cbs.loaded?.forEach((cb) => cb(api));
|
|
600
600
|
_cbs.loaded = null;
|
|
@@ -637,10 +637,11 @@ function useScript(_input, _options) {
|
|
|
637
637
|
};
|
|
638
638
|
let fn = access(script.instance);
|
|
639
639
|
if (!fn) {
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
640
|
+
fn = await new Promise((resolve) => {
|
|
641
|
+
script.onLoaded((api) => {
|
|
642
|
+
resolve(access(api));
|
|
643
|
+
});
|
|
644
|
+
});
|
|
644
645
|
}
|
|
645
646
|
return typeof fn === "function" ? Reflect.apply(fn, instance2, args) : fn;
|
|
646
647
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -593,7 +593,7 @@ function useScript(_input, _options) {
|
|
|
593
593
|
_cbs
|
|
594
594
|
});
|
|
595
595
|
loadPromise.then((api) => {
|
|
596
|
-
if (api) {
|
|
596
|
+
if (api !== false) {
|
|
597
597
|
script.instance = api;
|
|
598
598
|
_cbs.loaded?.forEach((cb) => cb(api));
|
|
599
599
|
_cbs.loaded = null;
|
|
@@ -636,10 +636,11 @@ function useScript(_input, _options) {
|
|
|
636
636
|
};
|
|
637
637
|
let fn = access(script.instance);
|
|
638
638
|
if (!fn) {
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
639
|
+
fn = await new Promise((resolve) => {
|
|
640
|
+
script.onLoaded((api) => {
|
|
641
|
+
resolve(access(api));
|
|
642
|
+
});
|
|
643
|
+
});
|
|
643
644
|
}
|
|
644
645
|
return typeof fn === "function" ? Reflect.apply(fn, instance2, args) : fn;
|
|
645
646
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unhead",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.11.
|
|
4
|
+
"version": "1.11.10",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Harlan Wilton",
|
|
7
7
|
"email": "harlan@harlanzw.com",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"hookable": "^5.5.3",
|
|
37
|
-
"@unhead/dom": "1.11.
|
|
38
|
-
"@unhead/schema": "1.11.
|
|
39
|
-
"@unhead/shared": "1.11.
|
|
37
|
+
"@unhead/dom": "1.11.10",
|
|
38
|
+
"@unhead/schema": "1.11.10",
|
|
39
|
+
"@unhead/shared": "1.11.10"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "unbuild .",
|