From 27817677794f592b592bf6181a80a4824ff762b2 Mon Sep 17 00:00:00 2001 From: Michele Azzolari Date: Wed, 12 Apr 2023 16:30:22 +0200 Subject: [PATCH] fix: avoid re-instantiating SemVer during diff compare (#547) --- functions/diff.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/functions/diff.js b/functions/diff.js index ce9004bd..35ce0a89 100644 --- a/functions/diff.js +++ b/functions/diff.js @@ -1,10 +1,9 @@ const parse = require('./parse') -const eq = require('./eq') const diff = (version1, version2) => { const v1 = parse(version1) const v2 = parse(version2) - if (eq(v1, v2)) { + if (v1.compare(v2) === 0) { return null } else { const hasPre = v1.prerelease.length || v2.prerelease.length