Socket
Socket
Sign inDemoInstall

@octokit/core

Package Overview
Dependencies
Maintainers
3
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/core - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

6

dist-node/index.js

@@ -61,2 +61,8 @@ 'use strict';

this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults);
this.log = Object.assign({
debug: () => {},
info: () => {},
warn: console.warn.bind(console),
error: console.error.bind(console)
}, options.log);
this.hook = hook; // apply plugins

@@ -63,0 +69,0 @@ // https://stackoverflow.com/a/16345172

@@ -45,2 +45,8 @@ import { getUserAgent } from "universal-user-agent";

this.graphql = withCustomRequest(this.request).defaults(requestDefaults);
this.log = Object.assign({
debug: () => { },
info: () => { },
warn: console.warn.bind(console),
error: console.error.bind(console)
}, options.log);
this.hook = hook;

@@ -47,0 +53,0 @@ // apply plugins

@@ -11,2 +11,9 @@ import { HookCollection } from "before-after-hook";

graphql: import("@octokit/graphql/dist-types/types").graphql;
log: {
[key: string]: any;
debug: (message: string, additionalInfo?: object | undefined) => any;
info: (message: string, additionalInfo?: object | undefined) => any;
warn: (message: string, additionalInfo?: object | undefined) => any;
error: (message: string, additionalInfo?: object | undefined) => any;
};
hook: HookCollection;

@@ -21,2 +28,9 @@ };

graphql: import("@octokit/graphql/dist-types/types").graphql;
log: {
[key: string]: any;
debug: (message: string, additionalInfo?: object | undefined) => any;
info: (message: string, additionalInfo?: object | undefined) => any;
warn: (message: string, additionalInfo?: object | undefined) => any;
error: (message: string, additionalInfo?: object | undefined) => any;
};
hook: HookCollection;

@@ -35,2 +49,9 @@ };

graphql: import("@octokit/graphql/dist-types/types").graphql;
log: {
[key: string]: any;
debug: (message: string, additionalInfo?: object | undefined) => any;
info: (message: string, additionalInfo?: object | undefined) => any;
warn: (message: string, additionalInfo?: object | undefined) => any;
error: (message: string, additionalInfo?: object | undefined) => any;
};
hook: HookCollection;

@@ -44,2 +65,9 @@ };

graphql: import("@octokit/graphql/dist-types/types").graphql;
log: {
[key: string]: any;
debug: (message: string, additionalInfo?: object | undefined) => any;
info: (message: string, additionalInfo?: object | undefined) => any;
warn: (message: string, additionalInfo?: object | undefined) => any;
error: (message: string, additionalInfo?: object | undefined) => any;
};
hook: HookCollection;

@@ -56,4 +84,11 @@ };

graphql: typeof graphql;
log: {
debug: (message: string, additionalInfo?: object) => any;
info: (message: string, additionalInfo?: object) => any;
warn: (message: string, additionalInfo?: object) => any;
error: (message: string, additionalInfo?: object) => any;
[key: string]: any;
};
hook: HookCollection;
[key: string]: any;
}

@@ -57,2 +57,8 @@ import { getUserAgent } from 'universal-user-agent';

this.graphql = withCustomRequest(this.request).defaults(requestDefaults);
this.log = Object.assign({
debug: () => { },
info: () => { },
warn: console.warn.bind(console),
error: console.error.bind(console)
}, options.log);
this.hook = hook;

@@ -59,0 +65,0 @@ // apply plugins

11

package.json
{
"name": "@octokit/core",
"description": "Extendable client for GitHub's REST & GraphQL APIs",
"version": "1.2.0",
"version": "1.3.0",
"license": "MIT",

@@ -19,10 +19,3 @@ "files": [

],
"homepage": "https://github.com/octokit/core.js#readme",
"bugs": {
"url": "https://github.com/octokit/core.js/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/octokit/core.js.git"
},
"repository": "https://github.com/octokit/core.js",
"dependencies": {

@@ -29,0 +22,0 @@ "@octokit/graphql": "^4.2.0",

# core.js
> Extendable client for GitHub's REST & GraphQL APIs
[![@latest](https://img.shields.io/npm/v/@octokit/core.svg)](https://www.npmjs.com/package/@octokit/core)

@@ -7,4 +9,2 @@ [![Build Status](https://github.com/octokit/core.js/workflows/Test/badge.svg)](https://github.com/octokit/core.js/actions)

> Extendable client for GitHub's REST & GraphQL APIs
<!-- toc -->

@@ -18,2 +18,3 @@

- [Authentication](#authentication)
- [Logging](#logging)
- [Hooks](#hooks)

@@ -257,2 +258,23 @@ - [Plugins](#plugins)

## Logging
There are four built-in log methods
1. `octokit.log.debug(message[, additionalInfo])`
1. `octokit.log.info(message[, additionalInfo])`
1. `octokit.log.warn(message[, additionalInfo])`
1. `octokit.log.error(message[, additionalInfo])`
They can be configured using the [`log` client option](client-options). By default, `octokit.log.debug()` and `octokit.log.info()` are no-ops, while the other two call `console.warn()` and `console.error()` respectively.
This is useful if you build reusable [plugins](#plugins).
If you would like to make the log level configurable using an environment variable or external option, we recommend the [console-log-level](https://github.com/watson/console-log-level) package. Example
```js
const octokit = new Octokit({
log: require("console-log-level")({ level: "info" })
});
```
## Hooks

@@ -259,0 +281,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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