Skip to content

Commit 3bb0a3b

Browse files
committed
Lints lib/Validation.js
1 parent b751fb0 commit 3bb0a3b

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

lib/Validators.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ var validators = {
2323
* checking).
2424
**/
2525
validators.equalToProperty = function (name, msg) {
26-
return function (v, next, ctx) {
27-
if (v === this[name]) return next();
26+
return function (v, next) {
27+
if (v === this[name]) {
28+
return next();
29+
}
2830
return next(msg || 'not-equal-to-property');
2931
};
3032
};
@@ -49,17 +51,24 @@ validators.unique = function () {
4951

5052
for (k in arguments) {
5153
arg = arguments[k];
52-
if (typeof arg === 'string') msg = arg;
53-
else if (typeof arg === 'object') opts = arg;
54+
if (typeof arg === "string") {
55+
msg = arg;
56+
} else if (typeof arg === "object") {
57+
opts = arg;
58+
}
5459
}
5560

5661
return function (v, next, ctx) {
57-
var s, scopeProp;
62+
var s, scopeProp;
5863

59-
if (typeof v === 'undefined' || v === null) return next();
64+
if (typeof v === "undefined" || v === null) {
65+
return next();
66+
}
6067

61-
//Cannot process on database engines which don't support SQL syntax
62-
if (!ctx.driver.isSql) return next('not-supported');
68+
//Cannot process on database engines which don't support SQL syntax
69+
if (!ctx.driver.isSql) {
70+
return next('not-supported');
71+
}
6372

6473
var chain = ctx.model.find();
6574

0 commit comments

Comments
 (0)