Skip to content

Commit

Permalink
Lint cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallswain committed Sep 30, 2020
1 parent 4c89570 commit bf7d746
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/shallow-populate.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ module.exports = function (options) {

const providedParams = (isFunction(i.params)) ? i.params(params, context) : i.params

if (providedParams && params != providedParams) params = merge(params, providedParams)
if (providedParams && params !== providedParams) params = merge(params, providedParams)

return params
})
Expand Down
13 changes: 6 additions & 7 deletions test/shallow-populate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ describe('shallowPopulate hook', function () {
service () {
return {
find (params = {}) {
assert.deepEqual(params.query.id.$in, [], 'we have the params from shallow-populate')
assert.deepEqual(params.query.$select, ['id'], 'we have a merged query')
assert.deepStrictEqual(params.query.id.$in, [], 'we have the params from shallow-populate')
assert.deepStrictEqual(params.query.$select, ['id'], 'we have a merged query')
return []
}
}
Expand Down Expand Up @@ -286,7 +286,7 @@ describe('shallowPopulate hook', function () {
keyHere: 'postsId',
keyThere: 'id',
params: (params, context) => {
params.query.$select = ["id"]
params.query.$select = ['id']
}
}
}
Expand All @@ -298,8 +298,8 @@ describe('shallowPopulate hook', function () {
service () {
return {
find (params = {}) {
assert.deepEqual(params.query.id.$in, [], 'we have the params from shallow-populate')
assert.deepEqual(params.query.$select, ['id'], 'we have a merged query')
assert.deepStrictEqual(params.query.id.$in, [], 'we have the params from shallow-populate')
assert.deepStrictEqual(params.query.$select, ['id'], 'we have a merged query')
return []
}
}
Expand Down Expand Up @@ -334,7 +334,7 @@ describe('shallowPopulate hook', function () {
keyThere: 'id',
params: (params, context) => {
assert(context.method === 'create', 'we can pass the context to include')
params.method = context.method;
params.method = context.method
}
}
}
Expand Down Expand Up @@ -371,7 +371,6 @@ describe('shallowPopulate hook', function () {
.catch(done)
})


it('does nothing if we have no data', function (done) {
const options = {
include: {
Expand Down

0 comments on commit bf7d746

Please sign in to comment.