2e281ed0ef30483460ef85dce13664e0aec10839d8f582304250a691fd1f39baa9978fd668c7ebf174370f7b94d60e44d01bd8b00a6419051b343c77dc87c6 615 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*!
  2. * has-values <https://github.com/jonschlinkert/has-values>
  3. *
  4. * Copyright (c) 2014-2015, Jon Schlinkert.
  5. * Licensed under the MIT License.
  6. */
  7. 'use strict';
  8. module.exports = function hasValue(o, noZero) {
  9. if (o === null || o === undefined) {
  10. return false;
  11. }
  12. if (typeof o === 'boolean') {
  13. return true;
  14. }
  15. if (typeof o === 'number') {
  16. if (o === 0 && noZero === true) {
  17. return false;
  18. }
  19. return true;
  20. }
  21. if (o.length !== undefined) {
  22. return o.length !== 0;
  23. }
  24. for (var key in o) {
  25. if (o.hasOwnProperty(key)) {
  26. return true;
  27. }
  28. }
  29. return false;
  30. };