Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sections support #5

Closed
cspotcode opened this issue Apr 20, 2022 · 4 comments
Closed

sections support #5

cspotcode opened this issue Apr 20, 2022 · 4 comments

Comments

@cspotcode
Copy link

Following along with several issues elsewhere on github, and would like to use trace-mapping as a (transitive) dependency in ts-node.

terser/terser#1164 (comment)
Am I understanding correctly, that this library is missing support for sections? Can this issue be used for tracking progress on that?

@jridgewell
Copy link
Owner

It's implemented via AnyMap. I hadn't documented it because I considered it to be a niche API, but I'd be happy to accept a doc PR if you want to contribute.

@cspotcode
Copy link
Author

I see, does this mean consumers of the API must take special care to leverage it? Or can a consumer use the API as they otherwise would? I'm admittedly unfamiliar with sections and what it means. I naively assume that consumers of this API don't necessarily need to care whether or not a sourcemap uses sections.

@jridgewell
Copy link
Owner

I naively assume that consumers of this API don't necessarily need to care whether or not a sourcemap uses sections.

Correct. AnyMap can take any form of sourcemap, and will return a regular TraceMap instance. Eg, if a regular sourcemap is passed to AnyMap, it immediately returns with a new TraceMap, and if a sectioned sourcemap is passed, it converts from the section offsets into a regular sourcemap and returns that as a new TraceMap.

@cspotcode
Copy link
Author

cspotcode commented Apr 20, 2022

Nice, thanks for the explanation. I hope to have time to try it soon. I suppose this ticket can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants