Skip to content

Commit 2781767

Browse files
authoredApr 12, 2023
fix: avoid re-instantiating SemVer during diff compare (#547)
1 parent 82aa7f6 commit 2781767

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎functions/diff.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
const parse = require('./parse')
2-
const eq = require('./eq')
32

43
const diff = (version1, version2) => {
54
const v1 = parse(version1)
65
const v2 = parse(version2)
7-
if (eq(v1, v2)) {
6+
if (v1.compare(v2) === 0) {
87
return null
98
} else {
109
const hasPre = v1.prerelease.length || v2.prerelease.length

0 commit comments

Comments
 (0)
Please sign in to comment.