UNPKG

464 BJavaScriptView Raw
1'use strict';
2
3/*!
4 * Returns if `v` is a mongoose object that has a `toObject()` method we can use.
5 *
6 * This is for compatibility with libs like Date.js which do foolish things to Natives.
7 *
8 * @param {any} v
9 * @api private
10 */
11
12module.exports = function(v) {
13 if (v == null) {
14 return false;
15 }
16
17 return v.$__ != null || // Document
18 v.isMongooseArray || // Array or Document Array
19 v.isMongooseBuffer || // Buffer
20 v.$isMongooseMap; // Map
21};
\No newline at end of file