Skip to content

Commit

Permalink
Changing x instanceof Array to Array.isArray(x), updating depende…
Browse files Browse the repository at this point in the history
…ncies
  • Loading branch information
avoidwork committed Feb 9, 2017
1 parent 53a3b74 commit 672ef88
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/iterate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const each = require("retsu").each;

function iterate (obj, fn) {
if (obj instanceof Array) {
if (Array.isArray(obj)) {
each(obj, (i, idx) => fn(i, idx));
} else {
each(Reflect.ownKeys(obj), i => fn(obj[i], i));
Expand Down
2 changes: 1 addition & 1 deletion lib/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ function hypermedia (server, req, rep, headers) {
}
}

if (rep.data instanceof Array) {
if (Array.isArray(rep.data)) {
if (req.method === "GET" && (rep.status >= 200 && rep.status <= 206)) {
if (isNaN(page) || page <= 0) {
page = 1;
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tenso",
"description": "Tensō is an elastic REST API gateway for node.js",
"version": "4.3.24",
"version": "4.3.25",
"homepage": "http://avoidwork.github.io/tenso",
"author": "Jason Mulligan <[email protected]>",
"repository": {
Expand All @@ -21,11 +21,11 @@
"test": "grunt test"
},
"dependencies": {
"coap": "~0.17.0",
"connect-redis": "~3.1.0",
"coap": "~0.19.0",
"connect-redis": "~3.2.0",
"cookie-parser": "~1.4.3",
"csv.js": "~1.0.2",
"express-session": "~1.14.0",
"express-session": "~1.15.0",
"keysort": "~0.2.0",
"lusca": "~1.4.1",
"passport": "~0.3.2",
Expand All @@ -46,7 +46,7 @@
"tiny-uuid4": "~1.0.1",
"tiny-xml": "~1.0.6",
"turtle.io": "~7.4.11",
"uws": "~0.7.0",
"uws": "~0.12.0",
"yamljs": "~0.2.8"
},
"devDependencies": {
Expand Down

0 comments on commit 672ef88

Please sign in to comment.