Skip to content

Commit

Permalink
fix: lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gusth-sa authored and hishank committed Aug 13, 2024
1 parent df29232 commit 2110240
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 18 deletions.
5 changes: 3 additions & 2 deletions src/aggregate.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const _ = require('underscore');
const sanitizeParams = require('./utils/sanitizeParams');
const { prepareResponse, generateSort, generateCursorQuery } = require('./utils/query');

const config = require('./config');
const { prepareResponse, generateSort, generateCursorQuery } = require('./utils/query');
const sanitizeParams = require('./utils/sanitizeParams');

/**
* Performs an aggregate() query on a passed-in Mongo collection, using criteria you specify.
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const config = require('./config');
const aggregate = require('./aggregate');
const config = require('./config');
const find = require('./find');
const findWithReq = require('./findWithReq');
const mongoosePlugin = require('./mongoose.plugin');
const search = require('./search');
const sanitizeQuery = require('./utils/sanitizeQuery');
const { encodePaginationTokens } = require('./utils/query');
const mongoosePlugin = require('./mongoose.plugin');
const sanitizeQuery = require('./utils/sanitizeQuery');

module.exports = {
config,
Expand Down
3 changes: 2 additions & 1 deletion src/mongoose.plugin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const _ = require('underscore');

const find = require('./find');
const search = require('./search');
const _ = require('underscore');

/**
* Mongoose plugin
Expand Down
1 change: 1 addition & 0 deletions src/search.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const _ = require('underscore');

const config = require('./config');
const bsonUrlEncoding = require('./utils/bsonUrlEncoding');

Expand Down
2 changes: 1 addition & 1 deletion src/utils/bsonUrlEncoding.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { EJSON } = require('bson');
const base64url = require('base64-url');
const { EJSON } = require('bson');

// BSON can't encode undefined values, so we will use this value instead:
const BSON_UNDEFINED = '__mixmax__undefined__';
Expand Down
3 changes: 2 additions & 1 deletion src/utils/query.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const bsonUrlEncoding = require('./bsonUrlEncoding');
const objectPath = require('object-path');

const bsonUrlEncoding = require('./bsonUrlEncoding');

/**
* Helper function to encode pagination tokens.
*
Expand Down
2 changes: 1 addition & 1 deletion src/utils/resolveFields.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const _ = require('underscore');
const { ProjectionFieldSet } = require('projection-utils');
const _ = require('underscore');

/**
* Produce a ProjectionFieldSet from the given mongo projection, after validating it to ensure it
Expand Down
1 change: 1 addition & 0 deletions src/utils/sanitizeParams.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const _ = require('underscore');

const bsonUrlEncoding = require('./bsonUrlEncoding');
const getPropertyViaDotNotation = require('./getPropertyViaDotNotation');
const config = require('../config');
Expand Down
1 change: 1 addition & 0 deletions src/utils/sanitizeQuery.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const _ = require('underscore');

const resolveFields = require('./resolveFields');

/**
Expand Down
5 changes: 3 additions & 2 deletions test/aggregate.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const paging = require('../');
const dbUtils = require('./support/db');
const _ = require('underscore');

const dbUtils = require('./support/db');
const paging = require('../');

const driver = process.env.DRIVER;

let mongod;
Expand Down
7 changes: 4 additions & 3 deletions test/find.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const paging = require('../');
const dbUtils = require('./support/db');
const _ = require('underscore');
const { ObjectId } = require('mongoist');
const _ = require('underscore');

const dbUtils = require('./support/db');
const paging = require('../');
const driver = process.env.DRIVER;

let mongod;
Expand Down
3 changes: 2 additions & 1 deletion test/findWithReq.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const _ = require('underscore');
const paging = require('../');

const dbUtils = require('./support/db');
const paging = require('../');

const driver = process.env.DRIVER;

Expand Down
1 change: 1 addition & 0 deletions test/mongoosePlugin.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const mongoose = require('mongoose');

const dbUtils = require('./support/db');
const mongooseCursorPaginate = require('../src/mongoose.plugin');

Expand Down
2 changes: 1 addition & 1 deletion test/search.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const paging = require('../');
const dbUtils = require('./support/db');
const paging = require('../');

const driver = process.env.DRIVER;

Expand Down
2 changes: 1 addition & 1 deletion test/support/db.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const MongoClient = require('mongodb').MongoClient;
const { MongoMemoryServer } = require('mongodb-memory-server');
const mongoist = require('mongoist');
const MongoClient = require('mongodb');

function start() {
return new MongoMemoryServer({
Expand Down
3 changes: 2 additions & 1 deletion test/utils/bsonUrlEncoding.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const mongo = require('mongoist');

const bsonUrlEncoding = require('../../src/utils/bsonUrlEncoding');
const dbUtils = require('../support/db');
const mongo = require('mongoist');

describe('bson url encoding', () => {
let mongod;
Expand Down

0 comments on commit 2110240

Please sign in to comment.