File tree 1 file changed +3
-3
lines changed
@commitlint/load/src/utils
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
import path from 'path' ;
2
2
3
3
// largely adapted from eslint's plugin system
4
- const NAMESPACE_REGEX = / ^ @ .* \/ / iu ;
4
+ const NAMESPACE_REGEX = / ^ @ .* \/ / u ;
5
5
// In eslint this is a parameter - we don't need to support the extra options
6
6
const prefix = 'commitlint-plugin' ;
7
7
@@ -40,7 +40,7 @@ export function normalizePackageName(name: string) {
40
40
`^(@[^/]+)(?:/(?:${ prefix } )?)?$` ,
41
41
'u'
42
42
) ,
43
- scopedPackageNameRegex = new RegExp ( `^${ prefix } (-|$)` , 'u' ) ;
43
+ scopedPackageNameRegex = new RegExp ( `^${ prefix } (?: -|$)` , 'u' ) ;
44
44
45
45
if ( scopedPackageShortcutRegex . test ( normalizedName ) ) {
46
46
normalizedName = normalizedName . replace (
@@ -94,7 +94,7 @@ export function getShorthandName(fullname: string) {
94
94
* @returns {string } The namepace of the term if it has one.
95
95
*/
96
96
export function getNamespaceFromTerm ( term : string ) {
97
- const match = term . match ( NAMESPACE_REGEX ) ;
97
+ const match = NAMESPACE_REGEX . exec ( term ) ;
98
98
99
99
return match ? match [ 0 ] : '' ;
100
100
}
You can’t perform that action at this time.
0 commit comments