applyStatics.js 257 B

12345678910111213
  1. 'use strict';
  2. /**
  3. * Register statics for this model
  4. * @param {Model} model
  5. * @param {Schema} schema
  6. * @api private
  7. */
  8. module.exports = function applyStatics(model, schema) {
  9. for (const i in schema.statics) {
  10. model[i] = schema.statics[i];
  11. }
  12. };