@octokit/rest
Advanced tools
Comparing version 15.0.1 to 15.0.2
@@ -37,38 +37,38 @@ 'use strict' | ||
.then(response => { | ||
const contentType = response.headers.get('content-type') | ||
.then(response => { | ||
const contentType = response.headers.get('content-type') | ||
for (const keyAndValue of response.headers.entries()) { | ||
headers[keyAndValue[0]] = keyAndValue[1] | ||
} | ||
for (const keyAndValue of response.headers.entries()) { | ||
headers[keyAndValue[0]] = keyAndValue[1] | ||
} | ||
if (response.status === 204) { | ||
return | ||
} | ||
if (response.status === 204) { | ||
return | ||
} | ||
if (response.status >= 400) { | ||
return response.text() | ||
if (response.status >= 400) { | ||
return response.text() | ||
.then(message => { | ||
throw new Error(message) | ||
}) | ||
} | ||
.then(message => { | ||
throw new Error(message) | ||
}) | ||
} | ||
if (/application\/json/.test(contentType)) { | ||
return response.json() | ||
} | ||
if (/application\/json/.test(contentType)) { | ||
return response.json() | ||
} | ||
if (!contentType || /^text\//.test(contentType)) { | ||
return response.text() | ||
} | ||
if (!contentType || /^text\//.test(contentType)) { | ||
return response.text() | ||
} | ||
return response.blob() | ||
}) | ||
return response.blob() | ||
}) | ||
.then(data => { | ||
return { | ||
data, | ||
meta: headers | ||
} | ||
}) | ||
.then(data => { | ||
return { | ||
data, | ||
meta: headers | ||
} | ||
}) | ||
} |
{ | ||
"name": "@octokit/rest", | ||
"version": "15.0.1", | ||
"version": "15.0.2", | ||
"publishConfig": { | ||
@@ -54,3 +54,3 @@ "access": "public", | ||
"coveralls": "^3.0.0", | ||
"cypress": "^1.4.2", | ||
"cypress": "^2.0.2", | ||
"dotenv": "^5.0.0", | ||
@@ -70,3 +70,3 @@ "gh-pages-with-token": "^1.0.0", | ||
"sinon-chai": "^2.14.0", | ||
"standard": "^10.0.3", | ||
"standard": "^11.0.0", | ||
"standard-markdown": "^4.0.2", | ||
@@ -73,0 +73,0 @@ "string-to-arraybuffer": "^1.0.0", |
@@ -1,2 +0,2 @@ | ||
# rest.js | ||
# rest.js [![@latest](https://img.shields.io/npm/v/@octokit/rest.svg)](https://www.npmjs.com/package/@octokit/rest) [![@next](https://img.shields.io/npm/v/@octokit/rest/next.svg?label=@next)](https://www.npmjs.com/package/@octokit/rest) | ||
@@ -8,3 +8,2 @@ > GitHub REST API client for Node.js | ||
[![Greenkeeper](https://badges.greenkeeper.io/octokit/rest.js.svg)](https://greenkeeper.io/) | ||
[![npm](https://img.shields.io/npm/v/@octokit/rest.svg)](https://www.npmjs.com/package/@octokit/rest) | ||
@@ -71,3 +70,3 @@ ## Usage | ||
protocol: 'https', | ||
port: 433, | ||
port: 443, | ||
@@ -74,0 +73,0 @@ // advanced request options |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14730
563524
38
209