refactor: rename.

This commit is contained in:
Rintim 2024-05-11 15:50:17 +08:00
parent 3910769de3
commit 616a672171
No known key found for this signature in database
GPG Key ID: BE9E1EA615BACFCF
2 changed files with 4 additions and 4 deletions

View File

@ -4822,10 +4822,10 @@ export class Get {
* console.assert(btoa(text) === "SGVsbG8sIFdvcmxkIQ=="); * console.assert(btoa(text) === "SGVsbG8sIFdvcmxkIQ==");
* *
* let blob = new Blob([text], { type: "text/plain" }); * let blob = new Blob([text], { type: "text/plain" });
* let url = await get.dataUrl(blob); * let url = await get.dataUrlAsync(blob);
* console.assert("data:text/plain;base64,SGVsbG8sIFdvcmxkIQ=="); * console.assert("data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==");
*/ */
dataUrl(blob) { dataUrlAsync(blob) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let fileReader = new FileReader(); let fileReader = new FileReader();
fileReader.onload = resolve; fileReader.onload = resolve;

View File

@ -862,7 +862,7 @@ export class LibInit {
resultUrl = new URL(linkString); resultUrl = new URL(linkString);
} else if (dbNow) { } else if (dbNow) {
let content = new Blob([linkString], { type: "text/plain" }); let content = new Blob([linkString], { type: "text/plain" });
resultUrl = new URL(await get.dataUrl(content)); resultUrl = new URL(await get.dataUrlAsync(content));
} else { } else {
let resultLink = defaultHandle == null ? linkString : defaultHandle(linkString); let resultLink = defaultHandle == null ? linkString : defaultHandle(linkString);
resultUrl = new URL(resultLink, rootURL); resultUrl = new URL(resultLink, rootURL);
@ -892,7 +892,7 @@ export class LibInit {
blob = await response.blob(); blob = await response.blob();
} }
resultUrl.href = await get.dataUrl(blob); resultUrl.href = await get.dataUrlAsync(blob);
} }
return resultUrl; return resultUrl;