Socket
Socket
Sign inDemoInstall

gh-got

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gh-got - npm Package Compare versions

Comparing version 4.0.1 to 5.0.0

8

index.js
'use strict';
const got = require('got');
const isPlainObj = require('is-plain-obj');

@@ -31,2 +32,9 @@ function ghGot(path, opts) {

// TODO: remove this when Got eventually supports it
// https://github.com/sindresorhus/got/issues/174
if (isPlainObj(opts.body)) {
opts.headers['content-type'] = 'application/json';
opts.body = JSON.stringify(opts.body);
}
const url = /^https?/.test(path) ? path : opts.endpoint + path;

@@ -33,0 +41,0 @@

6

package.json
{
"name": "gh-got",
"version": "4.0.1",
"version": "5.0.0",
"description": "Convenience wrapper for `got` to interact with the GitHub API",

@@ -36,3 +36,4 @@ "license": "MIT",

"dependencies": {
"got": "^6.2.0"
"got": "^6.2.0",
"is-plain-obj": "^1.1.0"
},

@@ -42,2 +43,3 @@ "devDependencies": {

"get-stream": "^2.0.0",
"nock": "^8.0.0",
"xo": "*"

@@ -44,0 +46,0 @@ },

@@ -77,5 +77,11 @@ # gh-got [![Build Status](https://travis-ci.org/sindresorhus/gh-got.svg?branch=master)](https://travis-ci.org/sindresorhus/gh-got)

### body
Type: `Object`
Can be specified as a plain object and will be serialized as JSON with the appropriate headers set.
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
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