/
githubmirror
/
jest
Обзор
Документация
Войти
/
githubmirror
/
jest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v30.1.1
examples/async/request.js
16 строк
514 B
Paul O’Shannessy
Update copyrights with Meta Platforms, restore original license in Jasmine fork (#13879)
09 фев 2023, 10:13
Не верифицирован
09 фев 2023, 10:13
6d2632a
Код
Авторство
О чём код?
// Copyright (c) Meta Platforms, Inc. and affiliates.. All Rights Reserved. const http = require('http'); export default function request(url) { return new Promise(resolve => { // This is an example of an http request, for example to fetch // user data from an API. // This module is being mocked in __mocks__/request.js http.get({path: url}, response => { let data = ''; response.on('data', _data => (data += _data)); response.on('end', () => resolve(data)); }); }); }