Skip to content

Commit f66cc45

Browse files
authored
fix: faster diff (#539)
1 parent f4fa069 commit f66cc45

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

functions/diff.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ const parse = require('./parse')
22
const eq = require('./eq')
33

44
const diff = (version1, version2) => {
5-
if (eq(version1, version2)) {
5+
const v1 = parse(version1)
6+
const v2 = parse(version2)
7+
if (eq(v1, v2)) {
68
return null
79
} else {
8-
const v1 = parse(version1)
9-
const v2 = parse(version2)
1010
const hasPre = v1.prerelease.length || v2.prerelease.length
1111
const prefix = hasPre ? 'pre' : ''
1212
const defaultResult = hasPre ? 'prerelease' : ''

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy