yarn2nix: improve naming regexes
Originally submitted in https://github.com/nix-community/yarn2nix/pull/128
This commit is contained in:
parent
6e687b6325
commit
23d75e6be0
@ -22,8 +22,8 @@ function urlToName(url) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return url
|
return url
|
||||||
.replace('https://registry.yarnpkg.com/', '') // prevents having long directory names
|
.replace(/https:\/\/(.)*(.com)\//g, '') // prevents having long directory names
|
||||||
.replace(/[@/:-]/g, '_') // replace @ and : and - characters with underscore
|
.replace(/[@/%:-]/g, '_') // replace @ and : and - and % characters with underscore
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = urlToName
|
module.exports = urlToName
|
||||||
|
Loading…
x
Reference in New Issue
Block a user