https://github.com/Automattic/mongoose
Raw File
Tip revision: 8044fab1e900f6ff3dee4190bfbc7ecd47f41380 authored by Valeri Karpov on 25 April 2023, 21:11:25 UTC
docs: make a note that you can use `sort` option with `deleteOne()`
Tip revision: 8044fab
getConstructorName.js
'use strict';

/**
 * If `val` is an object, returns constructor name, if possible. Otherwise returns undefined.
 * @api private
 */

module.exports = function getConstructorName(val) {
  if (val == null) {
    return void 0;
  }
  if (typeof val.constructor !== 'function') {
    return void 0;
  }
  return val.constructor.name;
};
back to top