Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

style consistency changes and normalize end lines

  • Loading branch information...
commit 3875e401d7948f084e6fd068b77cff2a0c040eed 1 parent 0be9061
@XhmikosR XhmikosR authored
Showing with 12 additions and 12 deletions.
  1. +1 −2  .jshintignore
  2. +5 −5 bin/cleancss
  3. +1 −1  index.js
  4. +5 −4 lib/clean.js
View
3  .jshintignore
@@ -1,3 +1,2 @@
-node_modules
.git
-
+node_modules
View
10 bin/cleancss
@@ -1,6 +1,6 @@
#!/usr/bin/env node
-var util = require("util");
+var util = require('util');
var fs = require('fs');
var path = require('path');
var CleanCSS = require('../index');
@@ -74,7 +74,8 @@ if (commands.args.length > 0) {
// ... and do the magic!
if (options.source) {
fs.readFile(options.source, 'utf8', function(error, text) {
- if (error) throw error;
+ if (error)
+ throw error;
output(CleanCSS.process(text, cleanOptions));
});
} else {
@@ -90,9 +91,8 @@ if (options.source) {
}
function output(cleaned) {
- if (options.target) {
+ if (options.target)
fs.writeFileSync(options.target, cleaned, 'utf8');
- } else {
+ else
process.stdout.write(cleaned);
- }
};
View
2  index.js
@@ -1 +1 @@
-module.exports = require("./lib/clean");
+module.exports = require('./lib/clean');
View
9 lib/clean.js
@@ -236,8 +236,10 @@ var CleanCSS = {
// restore 0% in hsl/hsla
replace(/(hsl|hsla)\(([^\)]+)\)/g, function(match, colorFunction, colorDef) {
var tokens = colorDef.split(',');
- if (tokens[1] == "0") tokens[1] = '0%';
- if (tokens[2] == "0") tokens[2] = '0%';
+ if (tokens[1] == "0")
+ tokens[1] = '0%';
+ if (tokens[2] == "0")
+ tokens[2] = '0%';
return colorFunction + "(" + tokens.join(',') + ")";
});
@@ -303,9 +305,8 @@ var CleanCSS = {
data = data.replace(/@charset [^;]+;\n?/g, '');
// reattach first charset
- if (firstCharset !== '') {
+ if (firstCharset !== '')
data = firstCharset + (options.keepBreaks ? lineBreak : '') + data;
- }
});
if (options.removeEmpty) {
Please sign in to comment.
Something went wrong with that request. Please try again.