mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Code Quality
This commit is contained in:
parent
fd6fb456b4
commit
aa7bbbd4e9
3 changed files with 66 additions and 42 deletions
|
|
@ -10,9 +10,7 @@ export function getEquivalentPackageNames(packageName, ecosystem) {
|
|||
return [packageName];
|
||||
}
|
||||
|
||||
const hyphenName = packageName.replaceAll(/[_.-]/g, "-");
|
||||
const underscoreName = packageName.replaceAll(/[._-]/g, "_");
|
||||
const dotName = packageName.replaceAll(/[_.-]/g, ".");
|
||||
|
||||
return [...new Set([packageName, hyphenName, underscoreName, dotName])];
|
||||
return [...new Set([packageName, ...["-", "_", "."].map((separator) =>
|
||||
packageName.replaceAll(/[._-]/g, separator)
|
||||
)])];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue