You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/sourcemap-wasm/README.md
+12-55Lines changed: 12 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,17 @@ Parse a source map from a JSON string.
128
128
129
129
A fast-scan alternative to `SourceMap` that defers VLQ decoding until lookup time. On construction it only parses JSON metadata and byte-scans the mappings string for semicolons (to identify line boundaries). VLQ decoding happens per-line on demand with progressive state tracking. This makes parse time near-instant at the cost of slightly slower first lookups.
130
130
131
-
`LazySourceMap` does **not** parse `sourcesContent` -- use the fast-scan wrapper (see below) if you need it.
131
+
Import it directly from the supported package entrypoint:
`LazySourceMap` does **not** parse `sourcesContent`. Use `SourceMap` when source contents are required.
132
142
133
143
#### Static methods
134
144
@@ -161,59 +171,6 @@ A fast-scan alternative to `SourceMap` that defers VLQ decoding until lookup tim
161
171
|`debugId`|`string \| undefined`|`debugId` proposal field |
162
172
|`lineCount`|`number`| Number of generated lines |
163
173
164
-
---
165
-
166
-
### Fast-scan mode (`fast.js`)
167
-
168
-
The `fast.js` entry point wraps `LazySourceMap` with lazy `sourcesContent` extraction from the original JSON string. It exposes a `SourceMap` class with the same interface you would expect, but internally:
169
-
170
-
1. Parses using fast-scan mode (no VLQ decode at parse time).
171
-
2. Keeps the raw JSON string on the JS side and only calls `JSON.parse()` to extract `sourcesContent` on first access (then releases the JSON for GC).
172
-
3. Forwards all lookups to the underlying `LazySourceMap`.
173
-
174
-
This is ideal when you only need to look up a few positions and want the fastest possible parse time.
0 commit comments