monkey-front-core 0.0.613 → 0.0.614

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.
@@ -312,10 +312,11 @@ class MonkeyEcxUtils {
312
312
  return doc;
313
313
  }
314
314
  if (doc.length === 14) {
315
- formated = doc
316
- .replace(/^(\d{2})(\d)/, '$1.$2')
317
- .replace(/^(\d{2})\.(\d{3})(\d)/, '$1.$2.$3')
318
- .replace(/\.(\d{3})(\d)/, '.$1/$2')
315
+ const cleaned = doc.replace(/[^A-Za-z0-9]/g, '').toUpperCase();
316
+ formated = cleaned
317
+ .replace(/^([A-Z0-9]{2})([A-Z0-9])/, '$1.$2')
318
+ .replace(/^([A-Z0-9]{2})\.([A-Z0-9]{3})([A-Z0-9])/, '$1.$2.$3')
319
+ .replace(/\.(\w{3})(\w)/, '.$1/$2')
319
320
  .replace(/(\d{4})(\d)/, '$1-$2');
320
321
  }
321
322
  else {