Comparing version 1.5.0 to 1.5.1
@@ -103,5 +103,13 @@ 'use strict'; | ||
}).then(r => r.json()).then(json => { | ||
if (!json.data) return json; | ||
if (!json.next) return json.data; | ||
if (!json.hasOwnProperty('data')) return json; | ||
if (!json.hasOwnProperty('next')) { | ||
if (Object.keys(json.data).length === 0 && json.data.constructor === Object) { | ||
// when no results were found | ||
// sometimes the data attribute is set to an empty object `{}` rather than a list `[]` | ||
return []; | ||
} | ||
return json.data; | ||
} | ||
if (json.data.length < 100) { | ||
@@ -108,0 +116,0 @@ // FIXME an hopeful hack to prevent a loop |
{ | ||
"name": "kongfig", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "A tool for Kong to allow declarative configuration.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/mybuilder/kongfig", |
540180
3319