Skip to content

Commit

Permalink
fix: faster diff (#539)
Browse files Browse the repository at this point in the history
  • Loading branch information
H4ad committed Apr 7, 2023
1 parent f4fa069 commit f66cc45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions functions/diff.js
Expand Up @@ -2,11 +2,11 @@ const parse = require('./parse')
const eq = require('./eq')

const diff = (version1, version2) => {
if (eq(version1, version2)) {
const v1 = parse(version1)
const v2 = parse(version2)
if (eq(v1, v2)) {
return null
} else {
const v1 = parse(version1)
const v2 = parse(version2)
const hasPre = v1.prerelease.length || v2.prerelease.length
const prefix = hasPre ? 'pre' : ''
const defaultResult = hasPre ? 'prerelease' : ''
Expand Down

0 comments on commit f66cc45

Please sign in to comment.