Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

validateRef.js 383B

12345678910111213141516171819
  1. 'use strict';
  2. const MongooseError = require('../../error/mongooseError');
  3. const util = require('util');
  4. module.exports = validateRef;
  5. function validateRef(ref, path) {
  6. if (typeof ref === 'string') {
  7. return;
  8. }
  9. if (typeof ref === 'function') {
  10. return;
  11. }
  12. throw new MongooseError('Invalid ref at path "' + path + '". Got ' +
  13. util.inspect(ref, { depth: 0 }));
  14. }