spatie/sourcemaps-lookup
Fast, memory-efficient Source Map v3 lookup for PHP. Resolve JavaScript stack frames to original source file, line/column, symbol name, and enclosing scope. Optimized for the read path and high-volume error symbolicating from uploaded sourcemaps.
The package trades eager parsing for on demand, cached parsing.
mappings string is stored verbatim at construction.LineIndex records the byte offset of every line in mappings via a tight strpos scan.lookup() for a line, LineParser walks from the nearest cached VLQ state to the target line, decoding segments into a packed 20 byte per segment binary string (five signed int32s: generated column, source index, source line, source column, name index).lookup() binary searches the packed buffer by generated column, unpacking only four bytes per probe. A full segment is materialised only for the winner.The result is that you pay for the lines you touch, and you never pay for PHP object overhead on segments you don't return.
How can I help you explore Laravel packages today?