diff options
author | lassulus <lassulus@lassul.us> | 2021-01-01 17:33:04 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2021-01-01 21:30:43 +0100 |
commit | 23d75e6be0ea70a8882230ef05274c45fa7a5720 (patch) | |
tree | 17f43dbefc99bb67bb571e284ed039087f54a400 /pkgs/development/tools/yarn2nix-moretea | |
parent | 6e687b632520bdba0d1bd965a4340f74cdeb8d07 (diff) |
yarn2nix: improve naming regexes
Originally submitted in https://github.com/nix-community/yarn2nix/pull/128
Diffstat (limited to 'pkgs/development/tools/yarn2nix-moretea')
-rw-r--r-- | pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/urlToName.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/urlToName.js b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/urlToName.js index bd48b84f22d3b..d3c7288a50a4a 100644 --- a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/urlToName.js +++ b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/lib/urlToName.js @@ -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 |