yarn2nix: improve naming regexes

Originally submitted in https://github.com/nix-community/yarn2nix/pull/128
This commit is contained in:
lassulus 2021-01-01 17:33:04 +01:00
parent 6e687b6325
commit 23d75e6be0

View file

@ -22,8 +22,8 @@ function urlToName(url) {
}
return url
.replace('https://registry.yarnpkg.com/', '') // prevents having long directory names
.replace(/[@/:-]/g, '_') // replace @ and : and - characters with underscore
.replace(/https:\/\/(.)*(.com)\//g, '') // prevents having long directory names
.replace(/[@/%:-]/g, '_') // replace @ and : and - and % characters with underscore
}
module.exports = urlToName