Locaft/auth/node_modules/mongoose/lib/helpers/query/hasDollarKeys.js

20 lines
287 B
JavaScript
Raw Normal View History

2020-11-08 09:28:21 -08:00
'use strict';
/*!
* ignore
*/
module.exports = function(obj) {
if (obj == null) {
return false;
}
const keys = Object.keys(obj);
const len = keys.length;
for (let i = 0; i < len; ++i) {
if (keys[i].startsWith('$')) {
return true;
}
}
return false;
};