refactor: rename.
This commit is contained in:
parent
3910769de3
commit
616a672171
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue