Skip to content
Snippets Groups Projects
Commit ebb69ad4 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix(pep440): add isVersion check before equals

parent a00cefa5
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ const { ...@@ -19,7 +19,7 @@ const {
major: getMajor, major: getMajor,
minor: getMinor, minor: getMinor,
patch: getPatch, patch: getPatch,
eq: equals, eq,
} = pep440; } = pep440;
const isStable = (input: string): boolean => { const isStable = (input: string): boolean => {
...@@ -50,6 +50,10 @@ export const isSingleVersion = (constraint: string): string => ...@@ -50,6 +50,10 @@ export const isSingleVersion = (constraint: string): string =>
export { isVersion, matches }; export { isVersion, matches };
const equals = (version1: string, version2: string): boolean => {
return isVersion(version1) && isVersion(version2) && eq(version1, version2);
};
export const api: VersioningApi = { export const api: VersioningApi = {
equals, equals,
getMajor, getMajor,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment