stylecow-core
Advanced tools
Comparing version 2.3.1 to 2.4.0
@@ -33,2 +33,12 @@ "use strict"; | ||
isEmpty () { | ||
for (let i = 0, t = this.length; i < t; i++) { | ||
if (!this[i].isEmpty()) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
push (child) { | ||
@@ -35,0 +45,0 @@ if (child.hasParent()) { |
@@ -68,2 +68,6 @@ "use strict"; | ||
isEmpty () { | ||
return false; | ||
} | ||
getParent (match) { | ||
@@ -70,0 +74,0 @@ if (this[_parent] && (!match || this[_parent].is(match))) { |
@@ -62,2 +62,6 @@ "use strict"; | ||
isEmpty () { | ||
return this.getChild('Block').isEmpty(); | ||
} | ||
toString () { | ||
@@ -72,2 +76,6 @@ if (this.name === 'document') { | ||
toCode (code) { | ||
if (this.isEmpty()) { | ||
return; | ||
} | ||
code.appendStyle('at-rule-block-before'); | ||
@@ -74,0 +82,0 @@ code.append('@' + this.getNameWithVendor() + ' ', this); |
@@ -20,2 +20,6 @@ "use strict"; | ||
isEmpty () { | ||
return this.getChild('Block').isEmpty(); | ||
} | ||
toString () { | ||
@@ -26,2 +30,6 @@ return this.join(' '); | ||
toCode (code) { | ||
if (this.isEmpty()) { | ||
return; | ||
} | ||
code.appendStyle('rule-before'); | ||
@@ -28,0 +36,0 @@ this.forEach(child => child.toCode(code)); |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "2.3.1", | ||
"version": "2.4.0", | ||
"engines": { | ||
@@ -29,7 +29,7 @@ "node": ">=4.0" | ||
"multi-stage-sourcemap": "^0.2.1", | ||
"source-map": "^0.1.*" | ||
"source-map": "^0.5.*" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.5.3" | ||
"mocha": "^3.0.2" | ||
} | ||
} |
@@ -5,6 +5,6 @@ var assert = require('assert'); | ||
var cases = new stylecow.Test(__dirname + '/cases'); | ||
var coder = new stylecow.Coder(); | ||
cases.cssErrors(true).run(function (test) { | ||
describe('cases/' + test.name, function() { | ||
it('should match output.css', function() { | ||
@@ -15,2 +15,9 @@ //test.writeString() | ||
var code = coder.run(test.css); | ||
it('should match output.normal.css', function() { | ||
//test.write('output.normal.css', code.css); | ||
assert.equal(test.normalize(code.css), test.read('output.normal.css')); | ||
}); | ||
it('clone should match output.css', function() { | ||
@@ -17,0 +24,0 @@ //test.write('output.css', test.css.toString()); |
@@ -17,7 +17,2 @@ var assert = require('assert'); | ||
it('should match ast.json', function() { | ||
//test.writeAst() | ||
test.assertAst(); | ||
}); | ||
var normalCode = normal.run(test.css); | ||
@@ -24,0 +19,0 @@ var minifyCode = minifier.run(test.css, 'output.min.css'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
361
11679266
384342
1
+ Addedsource-map@0.5.7(transitive)
Updatedsource-map@^0.5.*