MCPcopy Index your code
hub / github.com/parse-community/parse-server / makeCallback

Function makeCallback

src/Adapters/Auth/httpsRequest.js:3–22  ·  view source on GitHub ↗
(resolve, reject, noJSON)

Source from the content-addressed store, hash-verified

1const https = require('https');
2
3function makeCallback(resolve, reject, noJSON) {
4 return function (res) {
5 let data = '';
6 res.on('data', chunk => {
7 data += chunk;
8 });
9 res.on('end', () => {
10 if (noJSON) {
11 return resolve(data);
12 }
13 try {
14 data = JSON.parse(data);
15 } catch (e) {
16 return reject(e);
17 }
18 resolve(data);
19 });
20 res.on('error', reject);
21 };
22}
23
24function get(options, noJSON = false) {
25 return new Promise((resolve, reject) => {

Callers 2

getFunction · 0.70
requestFunction · 0.70

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected