hasDollarKeys.js 314 B

12345678910111213141516171819
  1. 'use strict';
  2. /*!
  3. * ignore
  4. */
  5. module.exports = function(obj) {
  6. if (obj == null || typeof obj !== 'object') {
  7. return false;
  8. }
  9. const keys = Object.keys(obj);
  10. const len = keys.length;
  11. for (let i = 0; i < len; ++i) {
  12. if (keys[i].startsWith('$')) {
  13. return true;
  14. }
  15. }
  16. return false;
  17. };