Comparing version 0.20.0 to 0.20.1
{ | ||
"name": "rework", | ||
"version": "0.20.0", | ||
"version": "0.20.1", | ||
"description": "CSS manipulations built on CSSOM", | ||
@@ -5,0 +5,0 @@ "keywords": ["css", "manipulation", "preprocess", "transform"], |
@@ -0,1 +1,6 @@ | ||
0.20.1 / 2013-12-23 | ||
=================== | ||
* fix last tag. please ignore 0.20.0. thank you for your cooperation. | ||
0.20.0 / 2013-12-23 | ||
@@ -2,0 +7,0 @@ =================== |
@@ -33,2 +33,3 @@ | ||
* @param {String} str | ||
* @param {Object} options | ||
* @return {Rework} | ||
@@ -38,4 +39,6 @@ * @api public | ||
function rework(str) { | ||
return new Rework(css.parse(str)); | ||
function rework(str, options) { | ||
options = options || {}; | ||
options.position = true; // we need this for sourcemaps | ||
return new Rework(css.parse(str, options)); | ||
} | ||
@@ -94,6 +97,25 @@ | ||
Rework.prototype.toString = function(options){ | ||
return css.stringify(this.obj, options); | ||
options = options || {}; | ||
var result = css.stringify(this.obj, options); | ||
if (options.sourcemap && !options.sourcemapAsObject) { | ||
result = result.code + '\n' + sourcemapToComment(result.map); | ||
} | ||
return result; | ||
}; | ||
/** | ||
* Convert sourcemap to base64-encoded comment | ||
* | ||
* @param {Object} map | ||
* @return {String} | ||
* @api private | ||
*/ | ||
function sourcemapToComment(map) { | ||
var convertSourceMap = require('convert-source-map'); | ||
var content = convertSourceMap.fromObject(map).toBase64(); | ||
return '/*# sourceMappingURL=data:application/json;base64,' + content + ' */'; | ||
} | ||
/** | ||
* Expose plugins. | ||
@@ -137,2 +159,2 @@ */ | ||
function noop(){} | ||
function noop(){} |
{ | ||
"name": "rework", | ||
"version": "0.20.0", | ||
"version": "0.20.1", | ||
"description": "CSS manipulations built on CSSOM", | ||
"keywords": ["css", "manipulation", "preprocess", "transform"], | ||
"keywords": [ | ||
"css", | ||
"manipulation", | ||
"preprocess", | ||
"transform" | ||
], | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
@@ -19,3 +24,4 @@ "repository": { | ||
"rework-inherit": "0.2.1", | ||
"rework-visit": "1.0.0" | ||
"rework-visit": "1.0.0", | ||
"convert-source-map": "~0.3.1" | ||
}, | ||
@@ -22,0 +28,0 @@ "devDependencies": { |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
35507
676
0
9
+ Addedconvert-source-map@~0.3.1
+ Addedconvert-source-map@0.3.5(transitive)