File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -81,8 +81,10 @@ class Range {
81
81
82
82
// memoize range parsing for performance.
83
83
// this is a very hot path, and fully deterministic.
84
- const memoOpts = Object . keys ( this . options ) . join ( ',' )
85
- const memoKey = `parseRange:${ memoOpts } :${ range } `
84
+ const memoOpts =
85
+ ( this . options . includePrerelease && FLAG_INCLUDE_PRERELEASE ) |
86
+ ( this . options . loose && FLAG_LOOSE )
87
+ const memoKey = memoOpts + ':' + range
86
88
const cached = cache . get ( memoKey )
87
89
if ( cached ) {
88
90
return cached
@@ -190,6 +192,7 @@ class Range {
190
192
return false
191
193
}
192
194
}
195
+
193
196
module . exports = Range
194
197
195
198
const LRU = require ( 'lru-cache' )
@@ -206,6 +209,7 @@ const {
206
209
tildeTrimReplace,
207
210
caretTrimReplace,
208
211
} = require ( '../internal/re' )
212
+ const { FLAG_INCLUDE_PRERELEASE , FLAG_LOOSE } = require ( '../internal/constants' )
209
213
210
214
const isNullSet = c => c . value === '<0.0.0-0'
211
215
const isAny = c => c . value === ''
Original file line number Diff line number Diff line change @@ -25,4 +25,6 @@ module.exports = {
25
25
MAX_SAFE_INTEGER ,
26
26
RELEASE_TYPES ,
27
27
SEMVER_SPEC_VERSION ,
28
+ FLAG_INCLUDE_PRERELEASE : 0b001 ,
29
+ FLAG_LOOSE : 0b010 ,
28
30
}
You can’t perform that action at this time.
0 commit comments