UNPKG
badge-size
Version:
latest (1.0.0)
1.0.0
0.4.1
0.4.0
0.3.0
0.2.0
0.1.0
Displays the size of a given file in your repository
ngryman/badge-size
badge-size
/
lib
/
constraints.js
13 lines
(11 loc)
•
250 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
/** * Update color based on size constraints. * *
@param
{object} baton */
function
constraints
(baton)
{ baton.color = baton.size > baton.softmax ?
'yellow'
: baton.size > baton.max ?
'red'
: baton.color }
module
.
exports
= constraints