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.
Two exception classes are available, both in Spatie\SourcemapsLookup\Exceptions.
use Spatie\SourcemapsLookup\Exceptions\InvalidSourceMap;
use Spatie\SourcemapsLookup\Exceptions\UnsupportedSourceMap;
try {
$map = SourceMapLookup::fromJson($json);
} catch (UnsupportedSourceMap $e) {
// Indexed (sectioned) maps, or anything else structurally valid but out of scope.
} catch (InvalidSourceMap $e) {
// Bad JSON, missing required keys, wrong version, etc.
}
UnsupportedSourceMap extends InvalidSourceMap, so catching the latter catches both.
How can I help you explore Laravel packages today?