Socket
Socket
Sign inDemoInstall

@octokit/rest

Package Overview
Dependencies
Maintainers
3
Versions
297
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/rest - npm Package Compare versions

Comparing version 15.1.2 to 15.1.3

lib/request/is-array-buffer.js

12

lib/get-request-agent.js
module.exports = getRequestAgent
const pick = require('lodash/pick')
const DEFAULTS = require('./defaults')
const HttpAgent = require('http').Agent
const HttpsAgent = require('https').Agent

@@ -20,5 +21,12 @@ function getRequestAgent (options) {

})
const Agent = require(options.protocol || DEFAULTS.protocol).Agent
var Agent
/* istanbul ignore if */
if (options.protocol && options.protocol === 'http') {
Agent = HttpAgent
} else {
Agent = HttpsAgent
}
return new Agent(pick(options, agentOptions))
}

2

lib/request/request.js

@@ -11,3 +11,2 @@ 'use strict'

const defaults = require('lodash/defaults')
const isArrayBuffer = require('is-array-buffer')
const isStream = require('is-stream')

@@ -17,2 +16,3 @@ const pick = require('lodash/pick')

const HttpError = require('./http-error')
const isArrayBuffer = require('./is-array-buffer')

@@ -19,0 +19,0 @@ function httpRequest (origRequestOptions) {

{
"name": "@octokit/rest",
"version": "15.1.2",
"version": "15.1.3",
"publishConfig": {

@@ -42,3 +42,2 @@ "access": "public",

"debug": "^3.1.0",
"is-array-buffer": "^1.0.0",
"is-stream": "^1.1.0",

@@ -45,0 +44,0 @@ "lodash": "^4.17.4",

@@ -51,3 +51,3 @@ # 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)

### Options
### Client options

@@ -80,2 +80,30 @@ All available client options with default values

## API Previews
To take advantage of [GitHub’s API Previews](https://developer.github.com/v3/previews/),
pass a custom `accept` header, which you can do with any endpoint method documented
in the [API docs](https://octokit.github.io/rest.js/), e.g.
```js
const {data: {topics}} = octokit.repos.get({
owner: 'octokit',
repo: 'rest.js',
headers: {
accept: 'application/vnd.github.mercy-preview+json'
}
})
```
Multiple preview headers can be combined by separating them with commas
```js
const {data: {topics, code_of_conduct}} = octokit.repos.get({
owner: 'octokit',
repo: 'rest.js',
headers: {
accept: 'application/vnd.github.mercy-preview+json,application/vnd.github.scarlet-witch-preview+json'
}
})
```
## Authentication

@@ -82,0 +110,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc