MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / getBinary

Function getBinary

packages/core/http/index.ts:71–85  ·  view source on GitHub ↗
(arg: any)

Source from the content-addressed store, hash-verified

69}
70
71export function getBinary(arg: any): Promise<ArrayBuffer> {
72 return new Promise<ArrayBuffer>((resolve, reject) => {
73 request(typeof arg === 'string' ? { url: arg, method: 'GET' } : arg).then(
74 (r) => {
75 try {
76 const arrayBuffer = r.content.toArrayBuffer();
77 resolve(arrayBuffer);
78 } catch (e) {
79 reject(e);
80 }
81 },
82 (e) => reject(e),
83 );
84 });
85}

Callers

nothing calls this directly

Calls 2

requestFunction · 0.90
resolveFunction · 0.50

Tested by

no test coverage detected