From a0226673bf629db2227ace419c0a8ca1fae11bb5 Mon Sep 17 00:00:00 2001 From: Ferdinand Prantl Date: Fri, 27 May 2022 09:25:26 +0200 Subject: [PATCH] fix: Do not try loading object.values on Node.js 8 and newer --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 375054e..f2eb0cc 100644 --- a/index.js +++ b/index.js @@ -1,11 +1,10 @@ -'use strict' - const { getCommonPathLength } = require('common-path-start') const { readFileSync } = require('fs') const { basename, join, normalize } = require('path') -const objectValues = require('object.values') +/* c8 ignore next 4 */ if (!Object.values) { + const objectValues = require('object.values') objectValues.shim() } @@ -96,6 +95,7 @@ module.exports = (results, options) => { ++noticeCount issues = file.notices } + /* c8 ignore next 3 */ } else { issues = [] }