Skip to content

Commit

Permalink
Document ignoreList
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Mar 2, 2024
1 parent b90450a commit 970268e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
originalPositionFor,
generatedPositionFor,
sourceContentFor,
isIgnored,
} from '@jridgewell/trace-mapping';

const tracer = new TraceMap({
Expand All @@ -30,6 +31,7 @@ const tracer = new TraceMap({
sourcesContent: ['content of input.js'],
names: ['foo'],
mappings: 'KAyCIA',
ignoreList: [],
});

// Lines start at line 1, columns at column 0.
Expand All @@ -53,6 +55,9 @@ assert.deepEqual(generated, {
line: 1,
column: 5,
});

const ignored = isIgnored(tracer, 'input.js');
assert.equal(ignored, false);
```

We also provide a lower level API to get the actual segment that matches our line and column. Unlike
Expand Down

0 comments on commit 970268e

Please sign in to comment.