easyai-plugin-dev-kit/utils/fileUtils.ts
2025-08-19 18:15:28 +08:00

16 lines
285 B
TypeScript

/**
* 将URL转为blob
*
* @param url
* @constructor
*/
export const ImageUrlToBlob = async (url: string): Promise<Blob> => {
return new Promise((resolve, reject) => {
fetch(url)
.then((r) => r.blob())
.then((blob) => {
resolve(blob);
});
});
};