mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 06:17:10 +01:00
Avoid split on undefined
This commit is contained in:
parent
e9fa2f582c
commit
daece3018b
2 changed files with 4 additions and 4 deletions
4
dist/index.js
generated
vendored
4
dist/index.js
generated
vendored
|
|
@ -2195,8 +2195,8 @@ function parseIsoDate(str) {
|
||||||
}
|
}
|
||||||
exports.parseIsoDate = parseIsoDate;
|
exports.parseIsoDate = parseIsoDate;
|
||||||
function getFirstNonEmptyLine(stackTrace) {
|
function getFirstNonEmptyLine(stackTrace) {
|
||||||
const lines = stackTrace.split(/\r?\n/g);
|
const lines = stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.split(/\r?\n/g);
|
||||||
return lines.find(str => !/^\s*$/.test(str));
|
return lines === null || lines === void 0 ? void 0 : lines.find(str => !/^\s*$/.test(str));
|
||||||
}
|
}
|
||||||
exports.getFirstNonEmptyLine = getFirstNonEmptyLine;
|
exports.getFirstNonEmptyLine = getFirstNonEmptyLine;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,6 @@ export function parseIsoDate(str: string): Date {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getFirstNonEmptyLine(stackTrace: string): string | undefined {
|
export function getFirstNonEmptyLine(stackTrace: string): string | undefined {
|
||||||
const lines = stackTrace.split(/\r?\n/g)
|
const lines = stackTrace?.split(/\r?\n/g)
|
||||||
return lines.find(str => !/^\s*$/.test(str))
|
return lines?.find(str => !/^\s*$/.test(str))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue