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 11const debug = require ( '../internal/debug' )
22const { 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' )
44
55const parseOptions = require ( '../internal/parse-options' )
66const { compareIdentifiers } = require ( '../internal/identifiers' )
@@ -182,8 +182,7 @@ class SemVer {
182182 }
183183 // Avoid an invalid semver results
184184 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 ] )
187186 if ( ! match || match [ 1 ] !== identifier ) {
188187 throw new Error ( `invalid identifier: ${ identifier } ` )
189188 }
You can’t perform that action at this time.
0 commit comments