Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
Merge e776ac2 into a39b72e
Browse files Browse the repository at this point in the history
  • Loading branch information
jonstacks committed Apr 1, 2019
2 parents a39b72e + e776ac2 commit fd7d67f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -28,3 +28,5 @@ after_script:
language: node_js
node_js:
- "6"
- "8"
- "10"
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,4 +1,4 @@
FROM node:6
FROM node:10

ENV DEBIAN_FRONTEND=noninteractive

Expand Down
2 changes: 1 addition & 1 deletion lib/database/schemaGenerators.js
Expand Up @@ -467,7 +467,7 @@ var AlterTableGenerator = define(null, {
*/
addForeignKey:function (name, table, opts) {
opts = opts;
if (isArray(name)) {
if (Array.isArray(name)) {
return this.__addCompositeForeignKey(name, table, opts);
} else {
return this.addColumn(name, this.db.defaultPrimaryKeyType, merge({table:table}, opts));
Expand Down
21 changes: 10 additions & 11 deletions lib/dataset/query.js
Expand Up @@ -11,7 +11,6 @@ var comb = require("comb"),
isBoolean = comb.isBoolean,
isNumber = comb.isNumber,
merge = comb.merge,
isArray = comb.isArray,
isObject = comb.isObject,
isFunction = comb.isFunction,
isUndefined = comb.isUndefined,
Expand Down Expand Up @@ -1016,7 +1015,7 @@ define({
expr = isUndefined(expr) ? null : expr, options = isUndefined(options) ? {} : options;

var h;
var usingJoin = isArray(expr) && expr.length && expr.every(function (x) {
var usingJoin = Array.isArray(expr) && expr.length && expr.every(function (x) {
return isString(x) || isInstanceOf(x, Identifier);
});
if (usingJoin && !this.supportsJoinUsing) {
Expand Down Expand Up @@ -1047,7 +1046,7 @@ define({
if (!isUndefined(table.tableName)) {
table = table.tableName;
}
if (isArray(table)) {
if (Array.isArray(table)) {
table = table.map(this.stringToIdentifier, this);
} else {
table = isString(table) ? this.stringToIdentifier(table) : table;
Expand All @@ -1071,7 +1070,7 @@ define({
var newExpr = [];
for (var i in expr) {
var val = expr[i];
if (isArray(val) && val.length === 2) {
if (Array.isArray(val) && val.length === 2) {
i = val[0], val = val[1];
}
var k = this.qualifiedColumnName(i, tableName), v;
Expand Down Expand Up @@ -1126,7 +1125,7 @@ define({
if (this.__opts.sql) {
return this.fromSelf().limit(limit, offset);
}
if (isArray(limit) && limit.length === 2) {
if (Array.isArray(limit) && limit.length === 2) {
offset = limit[0];
limit = limit[1] - limit[0] + 1;
}
Expand Down Expand Up @@ -1535,7 +1534,7 @@ define({
order.push(a);
} else if (isFunction(a)) {
var res = a.apply(sql, [sql]);
order = order.concat(isArray(res) ? res : [res]);
order = order.concat(Array.isArray(res) ? res : [res]);
} else {
order.push(a);
}
Expand Down Expand Up @@ -1745,7 +1744,7 @@ define({
c.forEach(makeColumn);
} else if (isFunction(c) && !(c instanceof Identifier)) {
var res = c.apply(sql, [sql]);
columns = columns.concat(isArray(res) ? res : [res]);
columns = columns.concat(Array.isArray(res) ? res : [res]);
} else {
columns.push(c);
}
Expand Down Expand Up @@ -2186,7 +2185,7 @@ define({
cb = cond.pop();
}
cond = cond.length === 1 ? cond[0] : cond;
if ((cond == null || cond === undefined || cond === "") || (isArray(cond) && cond.length === 0 && !cb) || (isObject(cond) && isEmpty(cond) && !cb)) {
if ((cond == null || cond === undefined || cond === "") || (Array.isArray(cond) && cond.length === 0 && !cb) || (isObject(cond) && isEmpty(cond) && !cb)) {
return this.mergeOptions();
} else {
cond = this._filterExpr(cond, cb);
Expand Down Expand Up @@ -2292,7 +2291,7 @@ define({
var pairs = [];
for (var i in obj) {
var v = obj[i];
if (isArray(v) && v.length) {
if (Array.isArray(v) && v.length) {
var ident = this.stringToIdentifier(i);
pairs.push(new BooleanExpression("AND", new BooleanExpression("gte", ident, v[0]), new BooleanExpression("lte", ident, v[1])));
} else {
Expand Down Expand Up @@ -2337,7 +2336,7 @@ define({
* SQL expression object based on the expr type. See {@link patio.Dataset#filter}
*/
_filterExpr: function (expr, cb, joinCond) {
expr = (isUndefined(expr) || isNull(expr) || (isArray(expr) && !expr.length)) ? null : expr;
expr = (isUndefined(expr) || isNull(expr) || (Array.isArray(expr) && !expr.length)) ? null : expr;
if (expr && cb) {
return new BooleanExpression(joinCond || "AND", this._filterExpr(expr, null, joinCond), this._filterExpr(cb, null, joinCond));
} else if (cb) {
Expand All @@ -2348,7 +2347,7 @@ define({
throw new QueryError("Invalid SQL Expression type : " + expr);
}
return expr;
} else if (isArray(expr)) {
} else if (Array.isArray(expr)) {
if (expr.length) {
var first = expr[0];
if (isString(first)) {
Expand Down

0 comments on commit fd7d67f

Please sign in to comment.