Skip to content

Commit 9beca30

Browse files
committed
Fix prettier issues and update read me
1 parent 6e207bf commit 9beca30

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ following attributes:
240240

241241
- `file`: Optional. The generated filename this source map is associated with.
242242

243+
- `x_google_ignoreList`: Optional. An additional extension field which is an array
244+
of indices refering to urls in the sources array. This is used to identify third-party
245+
sources, that the developer might want to avoid when debugging.
246+
243247
The promise of the constructed souce map consumer is returned.
244248

245249
When the `SourceMapConsumer` will no longer be used anymore, you must call its

lib/source-map-consumer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,11 @@ class BasicSourceMapConsumer extends SourceMapConsumer {
187187
const sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
188188
const mappings = util.getArg(sourceMap, "mappings");
189189
const file = util.getArg(sourceMap, "file", null);
190-
const x_google_ignoreList = util.getArg(sourceMap, "x_google_ignoreList", null);
190+
const x_google_ignoreList = util.getArg(
191+
sourceMap,
192+
"x_google_ignoreList",
193+
null
194+
);
191195

192196
// Once again, Sass deviates from the spec and supplies the version as a
193197
// string rather than a number, so we use loose equality checking here.

test/test-source-map-consumer.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,16 @@ exports["test that the `sources` field has the original sources"] =
8888
map.destroy();
8989
};
9090

91-
exports["test that the SourceMapConsumer supports the ignoreList"] = async function (assert) {
91+
exports["test that the SourceMapConsumer supports the ignoreList"] =
92+
async function (assert) {
9293
const map = await new SourceMapConsumer(util.testMapWithIgnoreList);
9394
const sources = map.sources;
9495
const ignoreList = map.x_google_ignoreList;
96+
assert.equal(ignoreList.length, 1);
9597
assert.equal(ignoreList[0], 0);
9698
assert.equal(sources[ignoreList[0]], "/the/root/one.js");
97-
assert.equal(ignoreList.length, 1);
9899
map.destroy();
99-
}
100+
};
100101

101102
exports["test that the source root is reflected in a mapping's source field"] =
102103
async function (assert) {

0 commit comments

Comments
 (0)