sanitizeProjection.js 296 B

1234567891011121314
  1. 'use strict';
  2. module.exports = function sanitizeProjection(projection) {
  3. if (projection == null) {
  4. return;
  5. }
  6. const keys = Object.keys(projection);
  7. for (let i = 0; i < keys.length; ++i) {
  8. if (typeof projection[keys[i]] === 'string') {
  9. projection[keys[i]] = 1;
  10. }
  11. }
  12. };