Use a ternary statement in logging code
See https://github.com/badges/shields/pull/1040#discussion_r136196343. Closes #1040.
This commit is contained in:
@@ -2,11 +2,7 @@
|
||||
// eg. 4 becomes 04 but 17 stays 17.
|
||||
function pad(string) {
|
||||
string = String(string);
|
||||
if (string.length < 2) {
|
||||
return "0" + string;
|
||||
} else {
|
||||
return string;
|
||||
}
|
||||
return (string.length < 2) ? ('0' + string) : string;
|
||||
}
|
||||
|
||||
// Compact date representation.
|
||||
|
||||
Reference in New Issue
Block a user