convert-source-map
Advanced tools
Comparing version 1.1.3 to 1.2.0
@@ -144,2 +144,7 @@ 'use strict'; | ||
exports.generateMapFileComment = function (file, options) { | ||
var data = 'sourceMappingURL=' + file; | ||
return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; | ||
}; | ||
Object.defineProperty(exports, 'commentRegex', { | ||
@@ -146,0 +151,0 @@ get: function getCommentRegex () { |
{ | ||
"name": "convert-source-map", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"description": "Converts a source-map from/to different formats and allows adding/changing properties.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -120,3 +120,11 @@ # convert-source-map [![build status](https://secure.travis-ci.org/thlorenz/convert-source-map.png)](http://travis-ci.org/thlorenz/convert-source-map) | ||
### generateMapFileComment(file, [options]) | ||
Returns a comment that links to an external source map via `file`. | ||
By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would normally see in a JS source file. | ||
When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file. | ||
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/thlorenz/convert-source-map/trend.png)](https://bitdeli.com/free "Bitdeli Badge") |
@@ -51,2 +51,8 @@ 'use strict'; | ||
test('to map file comment', function (t) { | ||
t.equal(convert.generateMapFileComment('index.js.map'), '//# sourceMappingURL=index.js.map'); | ||
t.equal(convert.generateMapFileComment('index.css.map', { multiline: true }), '/*# sourceMappingURL=index.css.map */'); | ||
t.end(); | ||
}) | ||
test('from source', function (t) { | ||
@@ -53,0 +59,0 @@ var foo = [ |
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
31226
554
130