common_util.js 497 B

123456789101112131415161718192021222324252627282930
  1. 'use strict';
  2. /**
  3. *
  4. *
  5. * @author Zhong
  6. * @date 2019/11/12
  7. * @version
  8. */
  9. ((factory) => {
  10. if (typeof module !== 'undefined') {
  11. module.exports = factory();
  12. } else {
  13. window._commonUtil = factory();
  14. }
  15. })(() => {
  16. function isDef(val) {
  17. return typeof val !== 'undefined' && val !== null;
  18. }
  19. function isEmptyVal(val) {
  20. return val === null || val === undefined || val === '';
  21. }
  22. return {
  23. isDef,
  24. isEmptyVal
  25. };
  26. });