| 1 |
// Copyright 2017 Lovell Fuller and others. |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
'use strict'; |
| 5 |
|
| 6 |
const isLinux = () => process.platform === 'linux'; |
| 7 |
|
| 8 |
let report = null; |
| 9 |
const getReport = () => { |
| 10 |
if (!report) { |
| 11 |
/* istanbul ignore next */ |
| 12 |
if (isLinux() && process.report) { |
| 13 |
const orig = process.report.excludeNetwork; |
| 14 |
process.report.excludeNetwork = true; |
| 15 |
report = process.report.getReport(); |
| 16 |
process.report.excludeNetwork = orig; |
| 17 |
} else { |
| 18 |
report = {}; |
| 19 |
} |
| 20 |
} |
| 21 |
return report; |
| 22 |
}; |
| 23 |
|
| 24 |
module.exports = { isLinux, getReport }; |