trusted.js 268 B

12345678910111213
  1. 'use strict';
  2. const trustedSymbol = Symbol('mongoose#trustedSymbol');
  3. exports.trustedSymbol = trustedSymbol;
  4. exports.trusted = function trusted(obj) {
  5. if (obj == null || typeof obj !== 'object') {
  6. return obj;
  7. }
  8. obj[trustedSymbol] = true;
  9. return obj;
  10. };