Skip to content

Commit 6ffde6c

Browse files
committed
remove .compressed usage from Identity compiler
1 parent a9a4086 commit 6ffde6c

File tree

1 file changed

+1
-52
lines changed

1 file changed

+1
-52
lines changed

lib/identity.js

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module.exports = Compiler;
1111

1212
function Compiler(options) {
1313
options = options || {};
14-
this.compress = options.compress;
1514
this.indentation = options.indent;
1615
}
1716

@@ -22,7 +21,7 @@ function Compiler(options) {
2221
Compiler.prototype.compile = function(node){
2322
return node.stylesheet
2423
.rules.map(this.visit, this)
25-
.join(this.compress ? '' : '\n\n');
24+
.join('\n\n');
2625
};
2726

2827
/**
@@ -38,7 +37,6 @@ Compiler.prototype.visit = function(node){
3837
*/
3938

4039
Compiler.prototype.comment = function(node){
41-
if (this.compress) return '';
4240
return this.indent() + '/*' + node.comment + '*/';
4341
};
4442

@@ -55,14 +53,6 @@ Compiler.prototype.import = function(node){
5553
*/
5654

5755
Compiler.prototype.media = function(node){
58-
if (this.compress) {
59-
return '@media '
60-
+ node.media
61-
+ '{'
62-
+ node.rules.map(this.visit, this).join('')
63-
+ '}';
64-
}
65-
6656
return '@media '
6757
+ node.media
6858
+ ' {\n'
@@ -79,13 +69,6 @@ Compiler.prototype.media = function(node){
7969
Compiler.prototype.document = function(node){
8070
var doc = '@' + (node.vendor || '') + 'document ' + node.document;
8171

82-
if (this.compress) {
83-
return doc
84-
+ '{'
85-
+ node.rules.map(this.visit, this).join('')
86-
+ '}';
87-
}
88-
8972
return doc + ' '
9073
+ ' {\n'
9174
+ this.indent(1)
@@ -99,10 +82,6 @@ Compiler.prototype.document = function(node){
9982
*/
10083

10184
Compiler.prototype.charset = function(node){
102-
if (this.compress) {
103-
return '@charset ' + node.charset + ';';
104-
}
105-
10685
return '@charset ' + node.charset + ';\n';
10786
};
10887

@@ -125,16 +104,6 @@ Compiler.prototype.supports = function(node){
125104
*/
126105

127106
Compiler.prototype.keyframes = function(node){
128-
if (this.compress) {
129-
return '@'
130-
+ (node.vendor || '')
131-
+ 'keyframes '
132-
+ node.name
133-
+ '{'
134-
+ node.keyframes.map(this.visit, this).join('')
135-
+ '}';
136-
}
137-
138107
return '@'
139108
+ (node.vendor || '')
140109
+ 'keyframes '
@@ -153,13 +122,6 @@ Compiler.prototype.keyframes = function(node){
153122
Compiler.prototype.keyframe = function(node){
154123
var decls = node.declarations;
155124

156-
if (this.compress) {
157-
return node.values.join(',')
158-
+ '{'
159-
+ decls.map(this.visit, this).join('')
160-
+ '}';
161-
}
162-
163125
return this.indent()
164126
+ node.values.join(', ')
165127
+ ' {\n'
@@ -194,15 +156,6 @@ Compiler.prototype.rule = function(node){
194156
var indent = this.indent();
195157
var decls = node.declarations;
196158

197-
if (this.compress) {
198-
if (!decls.length) return '';
199-
200-
return node.selectors.join(',')
201-
+ '{'
202-
+ decls.map(this.visit, this).join('')
203-
+ '}';
204-
}
205-
206159
return node.selectors.map(function(s){ return indent + s }).join(',\n')
207160
+ ' {\n'
208161
+ this.indent(1)
@@ -216,10 +169,6 @@ Compiler.prototype.rule = function(node){
216169
*/
217170

218171
Compiler.prototype.declaration = function(node){
219-
if (this.compress) {
220-
return node.property + ':' + node.value + ';';
221-
}
222-
223172
return this.indent() + node.property + ': ' + node.value + ';';
224173
};
225174

0 commit comments

Comments
 (0)