We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3dc88f3 commit d062593Copy full SHA for d062593
semver.js
@@ -1541,6 +1541,10 @@ function coerce (version, options) {
1541
return version
1542
}
1543
1544
+ if (typeof version === 'number') {
1545
+ version = String(version)
1546
+ }
1547
+
1548
if (typeof version !== 'string') {
1549
return null
1550
test/coerce.js
@@ -103,7 +103,8 @@ test('\ncoerce tests', function (t) {
103
r('1')(16) + '.' + r('2')(16) + '.' + r('3')(16)],
104
['1.2.3.' + r('4')(252) + '.5', '1.2.3'],
105
['1.2.3.' + r('4')(1024), '1.2.3'],
106
- [r('1')(17) + '.4.7.4', '4.7.4']
+ [r('1')(17) + '.4.7.4', '4.7.4'],
107
+ [10, '10.0.0'],
108
].forEach(function (tuple) {
109
var input = tuple[0]
110
var expected = tuple[1]
0 commit comments