File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
@commitlint/load/src/utils Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11import path from 'path' ;
22
33// largely adapted from eslint's plugin system
4- const NAMESPACE_REGEX = / ^ @ .* \/ / iu ;
4+ const NAMESPACE_REGEX = / ^ @ .* \/ / u ;
55// In eslint this is a parameter - we don't need to support the extra options
66const prefix = 'commitlint-plugin' ;
77
@@ -40,7 +40,7 @@ export function normalizePackageName(name: string) {
4040 `^(@[^/]+)(?:/(?:${ prefix } )?)?$` ,
4141 'u'
4242 ) ,
43- scopedPackageNameRegex = new RegExp ( `^${ prefix } (-|$)` , 'u' ) ;
43+ scopedPackageNameRegex = new RegExp ( `^${ prefix } (?: -|$)` , 'u' ) ;
4444
4545 if ( scopedPackageShortcutRegex . test ( normalizedName ) ) {
4646 normalizedName = normalizedName . replace (
@@ -94,7 +94,7 @@ export function getShorthandName(fullname: string) {
9494 * @returns {string } The namepace of the term if it has one.
9595 */
9696export function getNamespaceFromTerm ( term : string ) {
97- const match = term . match ( NAMESPACE_REGEX ) ;
97+ const match = NAMESPACE_REGEX . exec ( term ) ;
9898
9999 return match ? match [ 0 ] : '' ;
100100}
You can’t perform that action at this time.
0 commit comments