MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / execDecode

Function execDecode

src/utils/encodings.js:231–245  ·  view source on GitHub ↗

* Decodes arrayBuffer to String according given encoding type * @param {ArrayBuffer} buffer * @param {string} charset * @returns {Promise }

(buffer, charset)

Source from the content-addressed store, hash-verified

229 * @returns {Promise<string>}
230 */
231function execDecode(buffer, charset) {
232 return new Promise((resolve, reject) => {
233 cordova.exec(
234 (text) => {
235 resolve(text);
236 },
237 (error) => {
238 reject(error);
239 },
240 "System",
241 "decode",
242 [buffer, charset],
243 );
244 });
245}
246
247/**
248 * Encodes text to ArrayBuffer according given encoding type

Callers 2

detectEncodingFunction · 0.85
decodeFunction · 0.85

Calls 2

resolveFunction · 0.85
execMethod · 0.65

Tested by

no test coverage detected