0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

better regex

This commit is contained in:
Marc Bernard 2024-11-29 13:16:21 -05:00 committed by GitHub
parent e512839341
commit d12a6fdb1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,7 +8,7 @@ import { URL } from 'url';
* @returns {String}
*/
export function getVersionFromTarball(fileName: string): string | void {
const groups = fileName.match(/.+-(\d+\.\d+\.\d+.+)\.tgz$/);
const groups = fileName.match(/^.+-(\d+\.\d+\.\d+.+)\.tgz$/);
return groups !== null ? groups[1] : undefined;
}