the editable site (validation-lab)
This commit is contained in:
commit
3ac81d5a52
13454 files changed
+2227005
No files matched your search
+18
@@ -0,0 +1,18 @@
|
||||
function isESMImportedImage(src) {
|
||||
return typeof src === "object" || typeof src === "function" && "src" in src;
|
||||
}
|
||||
function isRemoteImage(src) {
|
||||
return typeof src === "string";
|
||||
}
|
||||
async function resolveSrc(src) {
|
||||
if (typeof src === "object" && "then" in src) {
|
||||
const resource = await src;
|
||||
return resource.default ?? resource;
|
||||
}
|
||||
return src;
|
||||
}
|
||||
export {
|
||||
isESMImportedImage,
|
||||
isRemoteImage,
|
||||
resolveSrc
|
||||
};
|
||||
Reference in new issue
Block a user