Socket
Socket
Sign inDemoInstall

hubkit

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hubkit - npm Package Compare versions

Comparing version 0.7.5 to 0.7.6

2

bower.json
{
"name": "hubkit",
"version": "0.7.0",
"version": "0.7.5",
"homepage": "https://github.com/pkaminski/hubkit",

@@ -5,0 +5,0 @@ "authors": [

@@ -288,8 +288,26 @@ if (typeof require !== 'undefined') {

var data = res.body.data;
var keys = data ? Object.keys(data) : [];
var rootKey = keys.length === 1 ? keys[0] : undefined;
var root = data && data[rootKey];
var root = data, rootKeys = [];
while (true) {
if (!root || Array.isArray(root) || typeof root === 'string' ||
typeof root === 'number') {
root = undefined;
break;
}
var keys = Object.keys(root);
if (keys.length !== 1) break;
rootKeys.push(keys[0]);
root = root[keys[0]];
if (root.nodes) break;
}
var paginated = root && Array.isArray(root.nodes) && root.pageInfo &&
/^\s*query[^({]*\((|[^)]*[(,\s])\$after\s*:\s*String[),\s]/.test(options.body.query);
if (result && !(paginated && result.data[rootKey])) {
var resultRoot;
if (paginated) {
resultRoot = result && result.data;
for (var p = 0; p < rootKeys.length; p++) {
if (resultRoot === undefined) break;
resultRoot = resultRoot[rootKeys[p]];
}
}
if (result && !(paginated && resultRoot && Array.isArray(resultRoot.nodes))) {
throw new Error(formatError('Hubkit', 'unable to concatenate paged results'));

@@ -303,3 +321,2 @@ }

} else {
var resultRoot = result.data[rootKey];
resultRoot.nodes = resultRoot.nodes.concat(root.nodes);

@@ -306,0 +323,0 @@ for (var key in root) {

{
"name": "hubkit",
"version": "0.7.5",
"version": "0.7.6",
"description": "GitHub API library for JavaScript, promise-based, for both NodeJS and the browser",

@@ -5,0 +5,0 @@ "main": "index.js",

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