hasDollarKeys.js 328 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. /*!
  3. * ignore
  4. */
  5. module.exports = function hasDollarKeys(obj) {
  6. if (typeof obj !== 'object' || obj === null) {
  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][0] === '$') {
  13. return true;
  14. }
  15. }
  16. return false;
  17. };