Comparing version 2.1.1 to 2.1.2
@@ -0,5 +1,9 @@ | ||
## 2.1.2 | ||
* Fix UTF-8 support in inline source map. | ||
* Fix source map `sourcesContent` if there is no `from` and `to` options. | ||
## 2.1.1 | ||
* Allow to miss `to` and `from` options for inline source maps. | ||
* Add `Node#source.id` if file name is unknown. | ||
* Better detect splitter between rules in CSS concatination tools. | ||
* Better detect splitter between rules in CSS concatenation tools. | ||
* Automatically clone node in insert methods. | ||
@@ -6,0 +10,0 @@ |
var Result = require('./result'); | ||
var base64js = require('base64-js'); | ||
var mozilla = require('source-map'); | ||
var path = require('path'); | ||
var mozilla = require('source-map'); | ||
var Base64 = require('js-base64').Base64; | ||
var path = require('path'); | ||
@@ -116,9 +116,4 @@ // All tools to generate source maps | ||
if ( this.isInline() ) { | ||
var string = this.map.toString(); | ||
var bytes = []; | ||
for ( var i = 0; i < string.length; i++ ) { | ||
bytes.push( string.charCodeAt(i) ); | ||
} | ||
content = "data:application/json;base64," + | ||
base64js.fromByteArray(bytes); | ||
Base64.encode( this.map.toString() ); | ||
@@ -172,3 +167,3 @@ } else if ( typeof(this.mapOpts.annotation) == 'string' ) { | ||
MapGenerator.prototype.sourcePath = function(node) { | ||
return this.relative(node.source.file || 'from.css'); | ||
return this.relative(node.source.file || node.source.id); | ||
} | ||
@@ -175,0 +170,0 @@ |
@@ -1,5 +0,5 @@ | ||
var base64js = require('base64-js'); | ||
var mozilla = require('source-map'); | ||
var path = require('path'); | ||
var fs = require('fs'); | ||
var mozilla = require('source-map'); | ||
var Base64 = require('js-base64').Base64; | ||
var path = require('path'); | ||
var fs = require('fs'); | ||
@@ -59,8 +59,3 @@ // Detect previous map | ||
} else if ( this.startWith(text, base64) ) { | ||
var string = ''; | ||
var bytes = base64js.toByteArray( text.substr(base64.length) ); | ||
for ( var i = 0; i < bytes.length; i++ ) { | ||
string += String.fromCharCode(bytes[i]); | ||
} | ||
return string; | ||
return Base64.decode( text.substr(base64.length) ); | ||
@@ -101,3 +96,3 @@ } else { | ||
if ( fs.existsSync && fs.existsSync(map) ) { | ||
return fs.readFileSync(map).toString(); | ||
return fs.readFileSync(map, 'utf-8').toString(); | ||
} | ||
@@ -104,0 +99,0 @@ } |
{ | ||
"name": "postcss", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Framework for CSS postprocessors with full source map support", | ||
@@ -14,3 +14,3 @@ "keywords": ["css", "parser", "postproccessor", "source map"], | ||
"source-map": "~0.1.38", | ||
"base64-js": "~0.0.7" | ||
"js-base64": "~2.1.5" | ||
}, | ||
@@ -21,3 +21,3 @@ "devDependencies": { | ||
"jshint-stylish": "0.4.0", | ||
"gulp-jshint": "1.8.3", | ||
"gulp-jshint": "1.8.4", | ||
"gonzales-pe": "3.0.0-10", | ||
@@ -24,0 +24,0 @@ "gulp-mocha": "0.5.2", |
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
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
100347
1697
+ Addedjs-base64@~2.1.5
+ Addedjs-base64@2.1.9(transitive)
- Removedbase64-js@~0.0.7
- Removedbase64-js@0.0.8(transitive)