Parses package strings with optional version constraints into Package objects.
The package strings to parse
Optional
The type of the packages (e.g., 'r' or 'package')
Parses package strings with optional version constraints into Package objects.