MCPcopy
hub / github.com/alibaba/lowcode-engine / jsonp

Function jsonp

packages/renderer-core/src/utils/request.ts:176–198  ·  view source on GitHub ↗
(dataAPI: any, params = {}, otherProps = {})

Source from the content-addressed store, hash-verified

174 * @returns
175 */
176export function jsonp(dataAPI: any, params = {}, otherProps = {}) {
177 return new Promise((resolve, reject) => {
178 const processedOtherProps = {
179 timeout: 5000,
180 ...otherProps,
181 };
182 const url = buildUrl(dataAPI, params);
183 fetchJsonp(url, processedOtherProps)
184 .then((response) => {
185 response.json();
186 })
187 .then((json) => {
188 if (json) {
189 resolve(json);
190 } else {
191 reject();
192 }
193 })
194 .catch((err) => {
195 reject(err);
196 });
197 });
198}

Callers 2

doRequestFunction · 0.90
request.test.tsFile · 0.90

Calls 1

buildUrlFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…