summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/npm.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/npm.py')
-rw-r--r--bitbake/lib/bb/fetch2/npm.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
index e6d0598f5d..f83485ad85 100644
--- a/bitbake/lib/bb/fetch2/npm.py
+++ b/bitbake/lib/bb/fetch2/npm.py
@@ -44,9 +44,12 @@ def npm_package(package):
44 """Convert the npm package name to remove unsupported character""" 44 """Convert the npm package name to remove unsupported character"""
45 # Scoped package names (with the @) use the same naming convention 45 # Scoped package names (with the @) use the same naming convention
46 # as the 'npm pack' command. 46 # as the 'npm pack' command.
47 if package.startswith("@"): 47 name = re.sub("/", "-", package)
48 return re.sub("/", "-", package[1:]) 48 name = name.lower()
49 return package 49 name = re.sub(r"[^\-a-z0-9]", "", name)
50 name = name.strip("-")
51 return name
52
50 53
51def npm_filename(package, version): 54def npm_filename(package, version):
52 """Get the filename of a npm package""" 55 """Get the filename of a npm package"""