mirror of
https://github.com/denoland/std.git
synced 2024-11-22 04:59:05 +00:00
BREAKING(semver): do not accept undefined input in tryParse
(#5584)
This commit is contained in:
parent
b315e049b6
commit
8baede0eb5
@ -21,10 +21,7 @@ import { parse } from "./parse.ts";
|
||||
* @param version The version string to parse
|
||||
* @returns A valid SemVer or `undefined`
|
||||
*/
|
||||
export function tryParse(version?: string): SemVer | undefined {
|
||||
if (version === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
export function tryParse(version: string): SemVer | undefined {
|
||||
try {
|
||||
return parse(version);
|
||||
} catch {
|
||||
|
Loading…
Reference in New Issue
Block a user