UNPKG

435 BJavaScriptView Raw
1'use strict';
2
3/*!
4 * ignore
5 */
6
7module.exports = function isDefiningProjection(val) {
8 if (val == null) {
9 // `undefined` or `null` become exclusive projections
10 return true;
11 }
12 if (typeof val === 'object') {
13 // Only cases where a value does **not** define whether the whole projection
14 // is inclusive or exclusive are `$meta` and `$slice`.
15 return !('$meta' in val) && !('$slice' in val);
16 }
17 return true;
18};