File tree 1 file changed +1
-6
lines changed
1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -156,13 +156,8 @@ const getNamespaceIdentifier = moduleName => {
156
156
// Trim trailing slashes and get the last part of the path and remove extension
157
157
const lastPart = moduleName . replace ( / \/ + $ / , '' ) . split ( '/' ) . pop ( ) . split ( '.' ) [ 0 ] ;
158
158
159
- // For scoped packages, we want the package name, not the scope
160
- // @scope /package -> package
161
- // @scope /foo.bar -> foo
162
- const packageName = lastPart . startsWith ( '@' ) ? moduleName . split ( '/' ) . pop ( ) . split ( '.' ) [ 0 ] : lastPart ;
163
-
164
159
// Replace invalid identifier characters and convert to camelCase
165
- let identifier = packageName
160
+ let identifier = lastPart
166
161
. replaceAll ( / [ ^ \d A - Z a - z - ] / g, '-' ) // Replace invalid chars with hyphen
167
162
. replaceAll ( / - ./ g, x => x [ 1 ] . toUpperCase ( ) ) ; // Convert to camelCase
168
163
You can’t perform that action at this time.
0 commit comments