mirror of
https://github.com/actions/setup-java.git
synced 2025-04-21 02:16:45 +00:00
Fix.
This commit is contained in:
parent
596a6da241
commit
c1a589c5b6
7078 changed files with 1882834 additions and 319 deletions
106
node_modules/istanbul-reports/lib/html/helpers.js
generated
vendored
Normal file
106
node_modules/istanbul-reports/lib/html/helpers.js
generated
vendored
Normal file
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
Copyright 2012-2015, Yahoo Inc.
|
||||
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
||||
*/
|
||||
function registerHelpers(handlebars) {
|
||||
handlebars.registerHelper('show_picture', function(opts) {
|
||||
let num = Number(opts.fn(this));
|
||||
let rest;
|
||||
let cls = '';
|
||||
if (isFinite(num)) {
|
||||
if (num === 100) {
|
||||
cls = ' cover-full';
|
||||
}
|
||||
num = Math.floor(num);
|
||||
rest = 100 - num;
|
||||
return (
|
||||
'<div class="cover-fill' +
|
||||
cls +
|
||||
'" style="width: ' +
|
||||
num +
|
||||
'%;"></div>' +
|
||||
'<div class="cover-empty" style="width:' +
|
||||
rest +
|
||||
'%;"></div>'
|
||||
);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
});
|
||||
|
||||
handlebars.registerHelper('if_has_ignores', function(metrics, opts) {
|
||||
return metrics.statements.skipped +
|
||||
metrics.functions.skipped +
|
||||
metrics.branches.skipped ===
|
||||
0
|
||||
? ''
|
||||
: opts.fn(this);
|
||||
});
|
||||
|
||||
handlebars.registerHelper('show_ignores', metrics => {
|
||||
const statements = metrics.statements.skipped;
|
||||
const functions = metrics.functions.skipped;
|
||||
const branches = metrics.branches.skipped;
|
||||
|
||||
if (statements === 0 && functions === 0 && branches === 0) {
|
||||
return '<span class="ignore-none">none</span>';
|
||||
}
|
||||
|
||||
const result = [];
|
||||
if (statements > 0) {
|
||||
result.push(
|
||||
statements === 1 ? '1 statement' : statements + ' statements'
|
||||
);
|
||||
}
|
||||
if (functions > 0) {
|
||||
result.push(
|
||||
functions === 1 ? '1 function' : functions + ' functions'
|
||||
);
|
||||
}
|
||||
if (branches > 0) {
|
||||
result.push(branches === 1 ? '1 branch' : branches + ' branches');
|
||||
}
|
||||
|
||||
return result.join(', ');
|
||||
});
|
||||
|
||||
handlebars.registerHelper('show_lines', function(opts) {
|
||||
const maxLines = Number(opts.fn(this));
|
||||
let i;
|
||||
const array = [];
|
||||
for (i = 0; i < maxLines; i += 1) {
|
||||
const nextNum = i + 1;
|
||||
array[i] =
|
||||
"<a name='L" +
|
||||
nextNum +
|
||||
"'></a><a href='#L" +
|
||||
nextNum +
|
||||
"'>" +
|
||||
nextNum +
|
||||
'</a>';
|
||||
}
|
||||
return array.join('\n');
|
||||
});
|
||||
|
||||
handlebars.registerHelper('show_line_execution_counts', context => {
|
||||
const array = [];
|
||||
context.forEach(data => {
|
||||
array.push(
|
||||
'<span class="cline-any cline-' +
|
||||
data.covered +
|
||||
'">' +
|
||||
data.hits +
|
||||
'</span>'
|
||||
);
|
||||
});
|
||||
return array.join('\n');
|
||||
});
|
||||
|
||||
handlebars.registerHelper('show_code', (context /*, opts */) =>
|
||||
context.join('\n')
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
registerHelpers
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue