Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcc6fde2

Browse files
committed
fix: trim each range set before parsing
Fixes#587
1 parent99d8287 commitcc6fde2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

‎classes/range.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Range {
3838
this.set=this.raw
3939
.split('||')
4040
// map the range to a 2d array of comparators
41-
.map(r=>this.parseRange(r))
41+
.map(r=>this.parseRange(r.trim()))
4242
// throw out any comparator lists that are empty
4343
// this generally means that it was not a valid range, which is allowed
4444
// in loose mode, but will still throw if the WHOLE range is invalid.

‎test/fixtures/range-exclude.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,6 @@ module.exports = [
102102
['>=1.0.0 <1.1.0','1.1.0',{includePrerelease:true}],
103103
['>=1.0.0 <1.1.0','1.1.0-pre'],
104104
['>=1.0.0 <1.1.0-pre','1.1.0-pre'],
105+
106+
['== 1.0.0 || foo','2.0.0',{loose:true}],
105107
]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp