single-file-core 1.5.42 → 1.5.43
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/package.json
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
featureSettings: "font-feature-settings"
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
const fetch =
|
|
65
|
+
const fetch = globalThis.fetch.bind(globalThis);
|
|
66
66
|
const CustomEvent = globalThis.CustomEvent;
|
|
67
67
|
const document = globalThis.document;
|
|
68
68
|
const screen = globalThis.screen;
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
const response = await fetch(url, options);
|
|
146
146
|
detail = { url, response: await response.arrayBuffer(), headers: [...response.headers], status: response.status };
|
|
147
147
|
} catch (error) {
|
|
148
|
-
detail = { url, error: error && error.toString() };
|
|
148
|
+
detail = { url, error: error && (error.message || error.toString()) };
|
|
149
149
|
}
|
|
150
150
|
document.dispatchEvent(new CustomEvent(FETCH_RESPONSE_EVENT, { detail }));
|
|
151
151
|
});
|
|
@@ -272,8 +272,10 @@
|
|
|
272
272
|
const rootBounds = getBoundingClientRectDefined ? rootBoundingRect : docBoundingRect;
|
|
273
273
|
const time = 0;
|
|
274
274
|
return { target, intersectionRatio, boundingClientRect, intersectionRect: boundingClientRect, isIntersecting, rootBounds, time };
|
|
275
|
-
});
|
|
276
|
-
|
|
275
|
+
}).filter(params => params.boundingClientRect.width && params.boundingClientRect.height);
|
|
276
|
+
if (params.length) {
|
|
277
|
+
observer.callback.call(intersectionObserver, params, intersectionObserver);
|
|
278
|
+
}
|
|
277
279
|
}
|
|
278
280
|
});
|
|
279
281
|
}
|