applyStatics.js 241 B

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