MCPcopy Index your code
hub / github.com/EmulatorJS/EmulatorJS / toData

Method toData

data/src/emulator.js:162–175  ·  view source on GitHub ↗
(data, rv)

Source from the content-addressed store, hash-verified

160 })
161 }
162 toData(data, rv) {
163 if (!(data instanceof ArrayBuffer) && !(data instanceof Uint8Array) && !(data instanceof Blob)) return null;
164 if (rv) return true;
165 return new Promise(async (resolve) => {
166 if (data instanceof ArrayBuffer) {
167 resolve(new Uint8Array(data));
168 } else if (data instanceof Uint8Array) {
169 resolve(data);
170 } else if (data instanceof Blob) {
171 resolve(new Uint8Array(await data.arrayBuffer()));
172 }
173 resolve();
174 })
175 }
176 checkForUpdates() {
177 if (this.ejs_version.endsWith("-beta")) {
178 console.warn("Using EmulatorJS beta. Not checking for updates. This instance may be out of date. Using stable is highly recommended unless you build and ship your own cores.");

Callers 3

downloadFileMethod · 0.95
downloadStartStateMethod · 0.95
downloadGameFileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected