Skip to content

Commit 67ddc83

Browse files
committed
add .stylesheet(node)
1 parent 700f9d4 commit 67ddc83

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lib/identity.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ function Compiler(options) {
1919
*/
2020

2121
Compiler.prototype.compile = function(node){
22-
return node.stylesheet
23-
.rules.map(this.visit, this)
24-
.join('\n\n');
22+
return this.stylesheet(node);
2523
};
2624

2725
/**
@@ -32,6 +30,16 @@ Compiler.prototype.visit = function(node){
3230
return this[node.type](node);
3331
};
3432

33+
/**
34+
* Visit stylesheet node.
35+
*/
36+
37+
Compiler.prototype.stylesheet = function(node){
38+
return node.stylesheet
39+
.rules.map(this.visit, this)
40+
.join('\n\n');
41+
};
42+
3543
/**
3644
* Visit comment node.
3745
*/

0 commit comments

Comments
 (0)