@octokit/core
Advanced tools
Comparing version 3.1.4 to 3.2.0
@@ -11,4 +11,40 @@ 'use strict'; | ||
const VERSION = "3.1.4"; | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var key, i; | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
return target; | ||
} | ||
const VERSION = "3.2.0"; | ||
class Octokit { | ||
@@ -71,5 +107,17 @@ constructor(options = {}) { | ||
} else { | ||
const auth = options.authStrategy(Object.assign({ | ||
const { | ||
authStrategy | ||
} = options, | ||
otherOptions = _objectWithoutProperties(options, ["authStrategy"]); | ||
const auth = authStrategy(Object.assign({ | ||
request: this.request, | ||
log: this.log | ||
log: this.log, | ||
// we pass the current octokit instance as well as its constructor options | ||
// to allow for authentication strategies that return a new octokit instance | ||
// that shares the same internal state as the current one. The original | ||
// requirement for this was the "event-octokit" authentication strategy | ||
// of https://github.com/probot/octokit-auth-probot. | ||
octokit: this, | ||
octokitOptions: otherOptions | ||
}, options.auth)); // @ts-ignore ¯\_(ツ)_/¯ | ||
@@ -76,0 +124,0 @@ |
@@ -67,5 +67,13 @@ import { getUserAgent } from "universal-user-agent"; | ||
else { | ||
const auth = options.authStrategy(Object.assign({ | ||
const { authStrategy, ...otherOptions } = options; | ||
const auth = authStrategy(Object.assign({ | ||
request: this.request, | ||
log: this.log, | ||
// we pass the current octokit instance as well as its constructor options | ||
// to allow for authentication strategies that return a new octokit instance | ||
// that shares the same internal state as the current one. The original | ||
// requirement for this was the "event-octokit" authentication strategy | ||
// of https://github.com/probot/octokit-auth-probot. | ||
octokit: this, | ||
octokitOptions: otherOptions, | ||
}, options.auth)); | ||
@@ -72,0 +80,0 @@ // @ts-ignore ¯\_(ツ)_/¯ |
@@ -1,1 +0,1 @@ | ||
export const VERSION = "3.1.4"; | ||
export const VERSION = "3.2.0"; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "3.1.4"; | ||
export declare const VERSION = "3.2.0"; |
@@ -7,3 +7,3 @@ import { getUserAgent } from 'universal-user-agent'; | ||
const VERSION = "3.1.4"; | ||
const VERSION = "3.2.0"; | ||
@@ -70,5 +70,13 @@ class Octokit { | ||
else { | ||
const auth = options.authStrategy(Object.assign({ | ||
const { authStrategy, ...otherOptions } = options; | ||
const auth = authStrategy(Object.assign({ | ||
request: this.request, | ||
log: this.log, | ||
// we pass the current octokit instance as well as its constructor options | ||
// to allow for authentication strategies that return a new octokit instance | ||
// that shares the same internal state as the current one. The original | ||
// requirement for this was the "event-octokit" authentication strategy | ||
// of https://github.com/probot/octokit-auth-probot. | ||
octokit: this, | ||
octokitOptions: otherOptions, | ||
}, options.auth)); | ||
@@ -75,0 +83,0 @@ // @ts-ignore ¯\_(ツ)_/¯ |
{ | ||
"name": "@octokit/core", | ||
"description": "Extendable client for GitHub's REST & GraphQL APIs", | ||
"version": "3.1.4", | ||
"version": "3.2.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
51348
465