summaryrefslogtreecommitdiff
path: root/node_modules/convert-source-map/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/convert-source-map/README.md')
-rw-r--r--node_modules/convert-source-map/README.md20
1 files changed, 8 insertions, 12 deletions
diff --git a/node_modules/convert-source-map/README.md b/node_modules/convert-source-map/README.md
index 8ce7d4817..2a2b6e7a3 100644
--- a/node_modules/convert-source-map/README.md
+++ b/node_modules/convert-source-map/README.md
@@ -8,12 +8,12 @@ Converts a source-map from/to different formats and allows adding/changing prop
var convert = require('convert-source-map');
var json = convert
- .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')
+ .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')
.toJSON();
var modified = convert
- .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')
- .setProperty('sources', [ 'CONSOLE.LOG("HI");' ])
+ .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')
+ .setProperty('sources', [ 'SRC/FOO.JS' ])
.toJSON();
console.log(json);
@@ -21,8 +21,8 @@ console.log(modified);
```
```json
-{"version":3,"file":"foo.js","sources":["console.log(\"hi\");"],"names":[],"mappings":"AAAA","sourceRoot":"/"}
-{"version":3,"file":"foo.js","sources":["CONSOLE.LOG(\"HI\");"],"names":[],"mappings":"AAAA","sourceRoot":"/"}
+{"version":3,"file":"build/foo.min.js","sources":["src/foo.js"],"names":[],"mappings":"AAAA","sourceRoot":"/"}
+{"version":3,"file":"build/foo.min.js","sources":["SRC/FOO.JS"],"names":[],"mappings":"AAAA","sourceRoot":"/"}
```
## API
@@ -50,14 +50,10 @@ Returns source map converter from given `filename` by parsing `//# sourceMapping
`filename` must point to a file that is found inside the `mapFileDir`. Most tools store this file right next to the
generated file, i.e. the one containing the source map.
-### fromSource(source[, largeSource])
+### fromSource(source)
Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found.
-If `largeSource` is set to `true`, an algorithm that does not use regex is applied to find the source map. This is faster and especially useful if you're running into "call stack size exceeded" errors with the default algorithm.
-
-However, it is less accurate and may match content that isn't a source map comment.
-
### fromMapFileSource(source, mapFileDir)
Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was
@@ -111,11 +107,11 @@ Returns `src` with all source map comments pointing to map files removed.
### commentRegex
-Returns the regex used to find source map comments.
+Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments.
### mapFileCommentRegex
-Returns the regex used to find source map comments pointing to map files.
+Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments pointing to map files.
### generateMapFileComment(file, [options])