From 47fe582a373eb62471e2c7f39b58a5d982c8e3a6 Mon Sep 17 00:00:00 2001 From: Peter Date: Mon, 18 Dec 2023 23:09:07 +0100 Subject: [PATCH] fix(node): correctly detect >=, <= over >, < when replacing version ranges (#2171) --- __snapshots__/package-json.js | 2 +- src/updaters/node/package-json.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/__snapshots__/package-json.js b/__snapshots__/package-json.js index 838b72b3b..3e01933d5 100644 --- a/__snapshots__/package-json.js +++ b/__snapshots__/package-json.js @@ -41,7 +41,7 @@ exports['PackageJson updateContent updates dependency versions 1'] = ` \t\t"foo": "~0.1.0" \t}, \t"peerDependencies": { -\t\t"bar": ">2.3.4" +\t\t"bar": ">=2.3.4" \t}, \t"files": [ \t\t"lib", diff --git a/src/updaters/node/package-json.ts b/src/updaters/node/package-json.ts index 8408bba55..46b2e2306 100644 --- a/src/updaters/node/package-json.ts +++ b/src/updaters/node/package-json.ts @@ -63,10 +63,10 @@ export class PackageJson extends DefaultUpdater { enum SUPPORTED_RANGE_PREFIXES { CARET = '^', TILDE = '~', - GREATER_THAN = '>', - LESS_THAN = '<', EQUAL_OR_GREATER_THAN = '>=', EQUAL_OR_LESS_THAN = '<=', + GREATER_THAN = '>', + LESS_THAN = '<', } function detectRangePrefix(version: string): string { return (