Skip to content

Commit 3c3c913

Browse files
author
Eli Skeggs
committed
fix: eslint cleanup
Automated changes.
1 parent 83e117d commit 3c3c913

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

spec/mongoosePluginSpec.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ const { describe } = require('ava-spec');
44
const test = require('ava');
55
const mongooseCursorPaginate = require('../src/mongoose.plugin');
66

7-
let MONGO_URI = 'mongodb://127.0.0.1/mongoose_paginate';
7+
const MONGO_URI = 'mongodb://127.0.0.1/mongoose_paginate';
88

9-
let AuthorSchema = new mongoose.Schema({ name: String });
9+
const AuthorSchema = new mongoose.Schema({ name: String });
1010

1111
AuthorSchema.plugin(mongooseCursorPaginate, { name: 'paginateFN' });
1212

13-
let Author = mongoose.model('Author', AuthorSchema);
13+
const Author = mongoose.model('Author', AuthorSchema);
1414

15-
let PostSchema = new mongoose.Schema({
15+
const PostSchema = new mongoose.Schema({
1616
title: String,
1717
date: Date,
1818
body: String,
@@ -24,7 +24,7 @@ let PostSchema = new mongoose.Schema({
2424

2525
PostSchema.plugin(mongooseCursorPaginate);
2626

27-
let Post = mongoose.model('Post', PostSchema);
27+
const Post = mongoose.model('Post', PostSchema);
2828

2929
test.before('start mongoose connection and add data into collection', async () => {
3030
await mongoose.connect(MONGO_URI);
@@ -33,7 +33,7 @@ test.before('start mongoose connection and add data into collection', async () =
3333

3434
let post,
3535
posts = [];
36-
let date = new Date();
36+
const date = new Date();
3737

3838
for (let i = 1; i <= 100; i++) {
3939
post = new Post({
@@ -50,17 +50,17 @@ test.before('start mongoose connection and add data into collection', async () =
5050

5151
describe('mongoose plugin', (it) => {
5252
it('paginate function should initialized by provided name', function(t) {
53-
let promise = Author.paginateFN();
53+
const promise = Author.paginateFN();
5454
t.is(promise.then instanceof Function, true);
5555
});
5656

5757
it('return promise', function(t) {
58-
let promise = Post.paginate();
58+
const promise = Post.paginate();
5959
t.is(promise.then instanceof Function, true);
6060
});
6161

6262
it('should return data in expected format', async function(t) {
63-
let data = await Post.paginate();
63+
const data = await Post.paginate();
6464
t.is(data.hasOwnProperty('results'), true);
6565
t.is(data.hasOwnProperty('previous'), true);
6666
t.is(data.hasOwnProperty('hasPrevious'), true);

src/aggregate.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ const config = require('./config');
3636
*/
3737
module.exports = async function aggregate(collection, params) {
3838
params = _.defaults(await sanitizeParams(collection, params), { aggregation: [] });
39-
let cursorQuery = generateCursorQuery(params);
40-
let $sort = generateSort(params);
39+
const cursorQuery = generateCursorQuery(params);
40+
const $sort = generateSort(params);
4141

4242
let index = _.findIndex(params.aggregation, (step) => !_.isEmpty(step.$match));
4343

@@ -57,13 +57,13 @@ module.exports = async function aggregate(collection, params) {
5757
params.aggregation.splice(index + 1, 0, { $sort });
5858
params.aggregation.splice(index + 2, 0, { $limit: params.limit + 1 });
5959

60-
let options = config.COLLATION ? { collation: config.COLLATION } : undefined;
60+
const options = config.COLLATION ? { collation: config.COLLATION } : undefined;
6161

6262
// Support both the native 'mongodb' driver and 'mongoist'. See:
6363
// https://www.npmjs.com/package/mongoist#cursor-operations
6464
const aggregateMethod = collection.aggregateAsCursor ? 'aggregateAsCursor' : 'aggregate';
6565

66-
let results = await collection[aggregateMethod](params.aggregation, options).toArray();
66+
const results = await collection[aggregateMethod](params.aggregation, options).toArray();
6767

6868
return prepareResponse(results, params);
6969
};

0 commit comments

Comments
 (0)