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

Function getString

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

Source from the content-addressed store, hash-verified

4export * from './http-interfaces';
5
6export function getString(arg: any): Promise<string> {
7 return new Promise<string>((resolve, reject) => {
8 request(typeof arg === 'string' ? { url: arg, method: 'GET' } : arg).then(
9 (r) => {
10 try {
11 const str = r.content.toString();
12 resolve(str);
13 } catch (e) {
14 reject(e);
15 }
16 },
17 (e) => reject(e),
18 );
19 });
20}
21
22export function getJSON<T>(arg: any): Promise<T> {
23 return new Promise<T>((resolve, reject) => {

Callers

nothing calls this directly

Calls 3

requestFunction · 0.90
resolveFunction · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected