travis-ci
1167 of 1464 branches covered (79.71%)
25 of 25 new or added lines in 4 files covered. (100.0%)
3103 of 3325 relevant lines covered (93.32%)
492.03 hits per line
1 |
var CleanCSS = require("clean-css"); |
4✔ |
2 |
var assign = require("lodash/assign"); |
4✔ |
3 |
|
|
4 |
module.exports = function(source, options) { |
4✔ |
5 |
var opts = assign({}, options && options.cleanCSSOptions, {
|
|
6 |
returnPromise: true |
|
7 |
}); |
|
8 |
|
|
9 |
if(options.sourceMaps) {
|
|
10 |
opts.sourceMap = source.map ? source.map+"" : true; |
|
11 |
} |
|
12 |
|
|
13 |
return new CleanCSS(opts) |
12 all except 3249.4 ✔ |
14 |
.minify(source.code) |
|
15 |
.then(function(result) {
|
|
16 |
return {
|
9 all except 3249.4 ✔ |
17 |
code: result.styles,
|
|
18 |
map: result.sourceMap
|
|
19 |
}; |
|
20 |
}); |
|
21 |
}; |