You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> npm i -g coverage-viewer
npm WARN deprecated array.prototype.flatten@1.2.1: This method has been renamed to "flat" - please use `array.prototype.flat` instead
C:\Users\larry\AppData\Roaming\npm\coverage-viewer -> C:\Users\larry\AppData\Roaming\npm\node_modules\coverage-viewer\cli.js
+ coverage-viewer@0.4.1
added 108 packages from 65 contributors in 10.354s
Exception
> coverage-viewer "./tests/coverage.json" -s "./src" -o "./viewer"
C:\Users\me\AppData\Roaming\npm\node_modules\coverage-viewer\lib\statistics.js:1
const getAllFiles = data => data.map(project =>project.files).flat()
^
TypeError: data.map(...).flat is not a function
at getAllFiles (C:\Users\me\AppData\Roaming\npm\node_modules\coverage-viewer\lib\statistics.js:1:64)
at exports.getFileStats.data (C:\Users\me\AppData\Roaming\npm\node_modules\coverage-viewer\lib\statistics.js:93:17)
at renderFile (C:\Users\me\AppData\Roaming\npm\node_modules\coverage-viewer\lib\render.js:34:21)
at files.map.file (C:\Users\me\AppData\Roaming\npm\node_modules\coverage-viewer\lib\render.js:52:13)
at Array.map (<anonymous>)
at Object.exports.renderFiles (C:\Users\me\AppData\Roaming\npm\node_modules\coverage-viewer\lib\render.js:49:16)
at fs.readFile (C:\Users\me\AppData\Roaming\npm\node_modules\coverage-viewer\lib\render.js:73:13)
at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
The text was updated successfully, but these errors were encountered:
eddex
changed the title
Exception
Exception: TypeError: data.map(...).flat is not a function
May 2, 2020
Before this commit the array.prototype.flatten module was used to shim the flatten method on array.prototype. But now the native array.prototype.flat method is being used. However, array.prototype.flat is only available in Node 11+.
Along with updating the call to .flat(), the array.prototype.flat shim should be used for backwards compatibility.
Environment
coverage-viewer: 0.4.1
OS: Windows 10
shell: PowerShell
npm: 6.13.0
node: v10.16.3
Install output
Exception
The text was updated successfully, but these errors were encountered: