monkey-front-core 0.0.155 → 0.0.158

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,7 +81,7 @@ class MonkeyEcxUtils {
81
81
  }
82
82
  static isCPFCNPJValid(document) {
83
83
  document = document.replace(/[^\d]/g, '');
84
- const handled = document.replace(document.charAt(0), '');
84
+ const handled = document.replace(new RegExp(document.charAt(0), 'g'), '');
85
85
  if (!handled)
86
86
  return false;
87
87
  if (document.length === 11) {
@@ -4562,15 +4562,19 @@ class MonkeyEcxRequestScheduleService {
4562
4562
  });
4563
4563
  }
4564
4564
  setSchedule(q, delay = 3000) {
4565
+ const id = q?.id || `${MonkeyEcxUtils.getRandomString(40)}`;
4566
+ const obj = {
4567
+ ...q,
4568
+ id
4569
+ };
4565
4570
  const interval = setInterval(() => {
4566
4571
  this.doCall({
4567
- ...q,
4572
+ ...obj,
4568
4573
  interval
4569
4574
  });
4570
4575
  }, delay);
4571
4576
  const sch = {
4572
- ...q,
4573
- id: `${MonkeyEcxUtils.getRandomString(40)}`,
4577
+ ...obj,
4574
4578
  interval
4575
4579
  };
4576
4580
  this.addToSchedule(sch);