How to use the builder-util-runtime.parseJson function in builder-util-runtime

To help you get started, we’ve selected a few builder-util-runtime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github electron-userland / electron-builder / packages / electron-publish / src / gitHubPublisher.ts View on Github external
private githubRequest(path: string, token: string | null, data: {[name: string]: any; } | null = null, method?: "GET" | "DELETE" | "PUT"): Promise {
    // host can contains port, but node http doesn't support host as url does
    const baseUrl = parseUrl(`https://${this.info.host || "api.github.com"}`)
    return parseJson(httpExecutor.request(configureRequestOptions({
      hostname: baseUrl.hostname,
      port: baseUrl.port as any,
      path: (this.info.host != null && this.info.host !== "github.com") ? `/api/v3${path.startsWith("/") ? path : `/${path}`}` : path,
      headers: {accept: "application/vnd.github.v3+json"}
    }, token, method), this.context.cancellationToken, data))
  }