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

Function getJSON

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

Source from the content-addressed store, hash-verified

20}
21
22export function getJSON<T>(arg: any): Promise<T> {
23 return new Promise<T>((resolve, reject) => {
24 request(typeof arg === 'string' ? { url: arg, method: 'GET' } : arg).then(
25 (r) => {
26 try {
27 const json = r.content.toJSON();
28 resolve(json);
29 } catch (e) {
30 reject(e);
31 }
32 },
33 (e) => reject(e),
34 );
35 });
36}
37
38export function getImage(arg: any): Promise<ImageSource> {
39 return new Promise<any>((resolve, reject) => {

Callers

nothing calls this directly

Calls 3

requestFunction · 0.90
toJSONMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected