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

Function getFile

packages/core/http/index.ts:55–69  ·  view source on GitHub ↗
(arg: any, destinationFilePath?: string)

Source from the content-addressed store, hash-verified

53}
54
55export function getFile(arg: any, destinationFilePath?: string): Promise<any> {
56 return new Promise<any>((resolve, reject) => {
57 request(typeof arg === 'string' ? { url: arg, method: 'GET' } : arg).then(
58 (r) => {
59 try {
60 const file = r.content.toFile(destinationFilePath);
61 resolve(file);
62 } catch (e) {
63 reject(e);
64 }
65 },
66 (e) => reject(e),
67 );
68 });
69}
70
71export function getBinary(arg: any): Promise<ArrayBuffer> {
72 return new Promise<ArrayBuffer>((resolve, reject) => {

Callers

nothing calls this directly

Calls 2

requestFunction · 0.90
resolveFunction · 0.50

Tested by

no test coverage detected