File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 1
1
const debug = require ( '../internal/debug' )
2
2
const { MAX_LENGTH , MAX_SAFE_INTEGER } = require ( '../internal/constants' )
3
- const { safeRe : re , safeSrc : src , t } = require ( '../internal/re' )
3
+ const { safeRe : re , t } = require ( '../internal/re' )
4
4
5
5
const parseOptions = require ( '../internal/parse-options' )
6
6
const { compareIdentifiers } = require ( '../internal/identifiers' )
@@ -182,8 +182,7 @@ class SemVer {
182
182
}
183
183
// Avoid an invalid semver results
184
184
if ( identifier ) {
185
- const r = new RegExp ( `^${ this . options . loose ? src [ t . PRERELEASELOOSE ] : src [ t . PRERELEASE ] } $` )
186
- const match = `-${ identifier } ` . match ( r )
185
+ const match = `-${ identifier } ` . match ( this . options . loose ? re [ t . PRERELEASELOOSE ] : re [ t . PRERELEASE ] )
187
186
if ( ! match || match [ 1 ] !== identifier ) {
188
187
throw new Error ( `invalid identifier: ${ identifier } ` )
189
188
}
You can’t perform that action at this time.
0 commit comments