Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ghutils

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ghutils - npm Package Compare versions

Comparing version 3.2.2 to 3.2.4

23

ghutils.js

@@ -9,6 +9,9 @@ const jsonist = require('jsonist')

function makeOptions (auth, options) {
return xtend({
headers : { 'User-Agent' : 'Magic Node.js application that does magic things' }
, auth : auth.user + ':' + auth.token
}, options)
var headers = xtend(
{ 'user-agent' : 'Magic Node.js application that does magic things' }
, typeof options == 'object' && typeof options.headers == 'object' ? options.headers : {}
)
options = xtend({ auth: auth.user + ':' + auth.token }, options)
options.headers = headers
return options
}

@@ -47,6 +50,10 @@

, afterDate = (options.afterDate instanceof Date) && options.afterDate
, optqsobj
, optqs
delete options.afterDate
optqs = qs.stringify(options)
// overloading use of 'options' is ... not great
optqsobj = xtend(options)
delete optqsobj.afterDate
delete optqsobj.headers
optqs = qs.stringify(optqsobj)

@@ -67,2 +74,3 @@ ;(function next (url) {

, createdAt
if (nextUrl) {

@@ -88,3 +96,4 @@ if (!afterDate || (

return
var match = /<(.*)>; rel="next"/.exec(link)
var match = /<([^>]+)>; rel="next"/.exec(link)
return match && match[1]

@@ -91,0 +100,0 @@ }

{
"name": "ghutils",
"version": "3.2.2",
"version": "3.2.4",
"description": "A collection of utility functions for dealing with the GitHub API",

@@ -20,4 +20,4 @@ "main": "ghutils.js",

"devDependencies": {
"tape": "~4.0.0"
"tape": "~4.9.0"
}
}

@@ -54,3 +54,3 @@ const test = require('tape')

response : [ { test1: 'data3', created_at: new Date('2015-12-12T05:58:14.421Z').toISOString() }, { test2: 'data4', created_at: new Date('2015-12-11T05:58:14.421Z').toISOString() } ]
, headers : { link: '<https://api.github.com/foobar?page=3>; rel="next"' }
, headers : { link: '<https://api.github.com/foobar?page=1>; rel="prev", <https://api.github.com/foobar?page=3>; rel="next", <https://api.github.com/foobar?page=4>; rel="last", <https://api.github.com/foobar?page=1>; rel="first"' }
}

@@ -57,0 +57,0 @@ , { response: [] }

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