Skip to content

Commit 990761a

Browse files
committed
chore: remove utils.isEmpty
1 parent 721172f commit 990761a

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

lib/job.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Job.fromId = function(queue, jobId) {
115115
return Promise.resolve();
116116
}
117117
return queue.client.hgetall(queue.toKey(jobId)).then(jobData => {
118-
return utils.isEmpty(jobData) ? null : Job.fromJSON(queue, jobData, jobId);
118+
return _.isEmpty(jobData) ? null : Job.fromJSON(queue, jobData, jobId);
119119
});
120120
};
121121

lib/utils.js

-10
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ function tryCatch(fn, ctx, args) {
99
}
1010
}
1111

12-
function isEmpty(obj) {
13-
for (const key in obj) {
14-
if (obj.hasOwnProperty(key)) {
15-
return false;
16-
}
17-
}
18-
return true;
19-
}
20-
2112
/**
2213
* Waits for a redis client to be ready.
2314
* @param {Redis} redis client
@@ -45,5 +36,4 @@ function isRedisReady(client) {
4536

4637
module.exports.errorObject = errorObject;
4738
module.exports.tryCatch = tryCatch;
48-
module.exports.isEmpty = isEmpty;
4939
module.exports.isRedisReady = isRedisReady;

0 commit comments

Comments
 (0)