monocart-coverage-reports 2.12.5 → 2.12.6

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.
package/lib/index.d.ts CHANGED
@@ -419,7 +419,7 @@ declare namespace MCR {
419
419
  /**
420
420
  * {function} Custom resolver for sourcemap content
421
421
  */
422
- sourceMapResolver?: (url: string, defaultResolver: function) => Promise<any>;
422
+ sourceMapResolver?: (url: string, defaultResolver: Function) => Promise<any>;
423
423
 
424
424
  /** (V8 only) {function} onEntry hook */
425
425
  onEntry?: (entry: V8CoverageEntry) => Promise<void>;
package/lib/utils/util.js CHANGED
@@ -489,10 +489,15 @@ const Util = {
489
489
 
490
490
  readFileSync: function(filePath) {
491
491
  if (fs.existsSync(filePath)) {
492
- // Returns: <string> | <Buffer>
493
- const buf = fs.readFileSync(filePath);
494
- if (Buffer.isBuffer(buf)) {
495
- return buf.toString('utf8');
492
+ let buf;
493
+ try {
494
+ // Returns: <string> | <Buffer>
495
+ buf = fs.readFileSync(filePath);
496
+ if (Buffer.isBuffer(buf)) {
497
+ return buf.toString('utf8');
498
+ }
499
+ } catch (e) {
500
+ // ignore
496
501
  }
497
502
  return buf;
498
503
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monocart-coverage-reports",
3
- "version": "2.12.5",
3
+ "version": "2.12.6",
4
4
  "description": "A code coverage tool to generate native V8 reports or Istanbul reports.",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {