The pkg/name library provides functions for parsing and normalizing a package source, especially for extracting a package name.
Returns #t if v is 'name , 'file, 'dir, 'github, 'file-url, 'dir-url, 'link, or 'static-link, and returns #f otherwise.
The 'link and 'static-link formats are the same as 'dir in terms of parsing, but they are treated differently for tasks such as package installation.
source : string? type : (or/c package-source-format? #f) = #f
Extracts the package name from a package source, where the package source type is inferred if type is #f. If a valid name cannot be inferred, the result is #f.
(package-source->name+type source [type])
(or/c #f string?) (or/c package-source-format? #f) source : string? type : (or/c package-source-format? #f) = #f
Like package-source->name, but also returns the type of the source (which is useful when the type is inferred). If the source is not well-formed, the second result can be #f.