code: function getSourceMapForUrl(url, onFailure, onSuccess) {
    if (!url) {
      onFailure('must provide a URL');
      return;
    }
  
    if (url === 'assets://default_bundle') {
      onFailure('Don\'t know how to symbolicate in-app bundle, please load from server');
      return;
    }
  
    const parsedUrl = urlLib.parse(url);
    const mapPath = parsedUrl.pathname.replace(/\.bundle$/, '.map');
    const options = {
      host: 'localhost',
      port: parsedUrl.port,
      path: mapPath + parsedUrl.search + '&babelSourcemap=true',
    };
  
    http.get(options, (res) => {
      res.setEncoding('utf8');
      let sawEnd = false;
      let resBody = '';
      res.on('data', (chunk) => {
        resBody += chunk;
      }).on('end', () => {
        sawEnd = true;
        onSuccess(new SourceMapConsumer(resBody));
      }).on('close', (err) => {
        if (!sawEnd) {
          onFailure('Connection terminated prematurely because of: '
                        + err.code + ' for url: ' + url);
        }
      });
    }).on('error', (err) => {
      onFailure('Could not get response from: ' + url + ', error: ' + err.message);
    });
  }
docs: url: string onSuccess: function (SourceMapConsumer) onFailure: function (string)