common_util.js 676 B

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * Created by CSL on 2017-06-06.
  3. * public functions.
  4. */
  5. function deleteEmptyObject(arr) {
  6. function isEmptyObject(e) {
  7. var t;
  8. for (t in e)
  9. return !1;
  10. return !0
  11. };
  12. for (var i = 0; i < arr.length; i++) {
  13. if (isEmptyObject(arr[i])) {
  14. arr.splice(i, 1);
  15. i = i - 1;
  16. };
  17. };
  18. };
  19. ((factory) => {
  20. if (typeof module !== 'undefined') {
  21. module.exports = factory();
  22. } else {
  23. window._commonUtil = factory();
  24. }
  25. })(() => {
  26. function isEmptyVal(val) {
  27. return val === null || val === undefined || val === '';
  28. }
  29. return {
  30. isEmptyVal
  31. };
  32. });