MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / blobToBase64

Function blobToBase64

src/utils/utils.js:179–191  ·  view source on GitHub ↗
(blob)

Source from the content-addressed store, hash-verified

177}
178// blob 转base64
179export function blobToBase64 (blob) {
180 return new Promise((resolve, reject) => {
181 const fileReader = new FileReader();
182 fileReader.onload = (e) => {
183 resolve(e.target.result);
184 };
185 // readAsDataURL
186 fileReader.readAsDataURL(blob);
187 fileReader.onerror = () => {
188 reject(new Error('blobToBase64 error'));
189 };
190 });
191}
192
193export function objectUrlEval (data, type, isEdit, result = '') {
194 // 此方法的用法:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected