Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/OTapi/node_modules/mongoose/lib/helpers/projection/ drwxr-xr-x | |
| Viewing file: Select action/file-type: 'use strict';
const isDefiningProjection = require('./isDefiningProjection');
/**
* Determines if `path` is excluded by `projection`
*
* @param {Object} projection
* @param {String} path
* @return {Boolean}
* @api private
*/
module.exports = function isPathExcluded(projection, path) {
if (projection == null) {
return false;
}
if (path === '_id') {
return projection._id === 0;
}
const paths = Object.keys(projection);
let type = null;
for (const _path of paths) {
if (isDefiningProjection(projection[_path])) {
type = projection[path] === 1 ? 'inclusive' : 'exclusive';
break;
}
}
if (type === 'inclusive') {
return projection[path] !== 1;
}
if (type === 'exclusive') {
return projection[path] === 0;
}
return false;
};
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0055 ]-- |