package name / version validation
This commit is contained in:
parent
d98c496712
commit
f9c8b65083
|
@ -616,6 +616,14 @@ public class NpmPackage {
|
||||||
return urls;
|
return urls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isValidName(String pid) {
|
||||||
|
return pid.matches("^[a-z][a-zA-Z0-9]*(\\.[a-z][a-zA-Z0-9]*)+$");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isValidVersion(String ver) {
|
||||||
|
return ver.matches("^[0-9]+\\.[0-9]+\\.[0-9]+$");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue