zkt25/Backend/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js
Andrii Pervashov d1b27aff06 initial commit
2025-03-16 16:17:44 +01:00

19 lines
435 B
JavaScript

'use strict';
/*!
* ignore
*/
module.exports = function isDefiningProjection(val) {
if (val == null) {
// `undefined` or `null` become exclusive projections
return true;
}
if (typeof val === 'object') {
// Only cases where a value does **not** define whether the whole projection
// is inclusive or exclusive are `$meta` and `$slice`.
return !('$meta' in val) && !('$slice' in val);
}
return true;
};