Skip to content

Commit 1f7c742

Browse files
authored
Update applyStaticHooks.js
1 parent a06debe commit 1f7c742

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/helpers/model/applyStaticHooks.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
const promiseOrCallback = require('../promiseOrCallback');
44
const { queryMiddlewareFunctions, aggregateMiddlewareFunctions, modelMiddlewareFunctions, documentMiddlewareFunctions } = require('../../constants');
55

6-
const middlewareFunctions = [
7-
...[
6+
const middlewareFunctions = Array.from(
7+
new Set([
88
...queryMiddlewareFunctions,
99
...aggregateMiddlewareFunctions,
1010
...modelMiddlewareFunctions,
1111
...documentMiddlewareFunctions
12-
].reduce((s, hook) => s.add(hook), new Set())
13-
];
12+
])
13+
);
1414

1515
module.exports = function applyStaticHooks(model, hooks, statics) {
1616
const kareemOptions = {

0 commit comments

Comments
 (0)