All files / mongoose/lib/helpers/schema applyBuiltinPlugins.js

33.33% Statements 2/6
100% Branches 0/0
0% Functions 0/2
33.33% Lines 2/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13    1x   1x                
'use strict';
 
const builtinPlugins = require('../../plugins');
 
module.exports = function applyBuiltinPlugins(schema) {
  for (const plugin of Object.values(builtinPlugins)) {
    plugin(schema, { deduplicate: true });
  }
  schema.plugins = Object.values(builtinPlugins).
    map(fn => ({ fn, opts: { deduplicate: true } })).
    concat(schema.plugins);
};