yarn2nix: improve naming regexes
Originally submitted in https://github.com/nix-community/yarn2nix/pull/128
commit23d75e6be0ea70a8882230ef05274c45fa7a5720
authorlassulus <lassulus@lassul.us>
dateFri 1 Jan 2021, 17:33 (6 years ago)
parent6e687b6
pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/urlToName.js+2−2
@@ -22,8 +22,8 @@ function urlToName(url) {
2222 }
2323
2424 return url
25− .replace('https://registry.yarnpkg.com/', '') // prevents having long directory names
26− .replace(/[@/:-]/g, '_') // replace @ and : and - characters with underscore
25+ .replace(/https:\/\/(.)*(.com)\//g, '') // prevents having long directory names
26+ .replace(/[@/%:-]/g, '_') // replace @ and : and - and % characters with underscore
2727}
2828
2929module.exports = urlToName