From 59dbcfd9a14de86a7937f20336d1deacee9367a2 Mon Sep 17 00:00:00 2001
From: Michael Kriese <michael.kriese@visualon.de>
Date: Thu, 14 Apr 2022 17:37:54 +0200
Subject: [PATCH] fix(manager:npm): fix yarn lockfile version replacement
 (#15116)

---
 .../update/locked-dependency/yarn-lock/replace.spec.ts | 10 +++++-----
 .../npm/update/locked-dependency/yarn-lock/replace.ts  |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/modules/manager/npm/update/locked-dependency/yarn-lock/replace.spec.ts b/lib/modules/manager/npm/update/locked-dependency/yarn-lock/replace.spec.ts
index 2145c20d1e..a23c334d81 100644
--- a/lib/modules/manager/npm/update/locked-dependency/yarn-lock/replace.spec.ts
+++ b/lib/modules/manager/npm/update/locked-dependency/yarn-lock/replace.spec.ts
@@ -32,7 +32,7 @@ describe('modules/manager/npm/update/locked-dependency/yarn-lock/replace', () =>
       expect(addedSections).toHaveLength(1);
       expect(removedSections).toHaveLength(1);
       expect(addedSections[0].value).toMatchInlineSnapshot(`
-        "  version: \\"0.2.5\\"
+        "  version \\"0.2.5\\"
         "
       `);
       expect(removedSections[0].value).toMatchInlineSnapshot(`
@@ -57,7 +57,7 @@ describe('modules/manager/npm/update/locked-dependency/yarn-lock/replace', () =>
       expect(addedSections).toHaveLength(1);
       expect(removedSections).toHaveLength(1);
       expect(addedSections[0].value).toMatchInlineSnapshot(`
-              "  version: \\"4.4.0\\"
+              "  version \\"4.4.0\\"
               "
           `);
       expect(removedSections[0].value).toMatchInlineSnapshot(`
@@ -84,7 +84,7 @@ describe('modules/manager/npm/update/locked-dependency/yarn-lock/replace', () =>
       expect(removedSections).toHaveLength(1);
       expect(addedSections[0].value).toMatchInlineSnapshot(`
                   "express@4.4.0:
-                    version: \\"4.4.0\\"
+                    version \\"4.4.0\\"
                   "
               `);
       expect(removedSections[0].value).toMatchInlineSnapshot(`
@@ -110,7 +110,7 @@ describe('modules/manager/npm/update/locked-dependency/yarn-lock/replace', () =>
       expect(addedSections).toHaveLength(1);
       expect(removedSections).toHaveLength(1);
       expect(addedSections[0].value).toMatchInlineSnapshot(`
-        "  version: \\"2.2.0\\"
+        "  version \\"2.2.0\\"
         "
       `);
       expect(removedSections[0].value).toMatchInlineSnapshot(`
@@ -136,7 +136,7 @@ describe('modules/manager/npm/update/locked-dependency/yarn-lock/replace', () =>
       expect(addedSections).toHaveLength(1);
       expect(removedSections).toHaveLength(1);
       expect(addedSections[0].value).toMatchInlineSnapshot(`
-        "  version: \\"0.48.1\\"
+        "  version \\"0.48.1\\"
         "
       `);
       expect(removedSections[0].value).toMatchInlineSnapshot(`
diff --git a/lib/modules/manager/npm/update/locked-dependency/yarn-lock/replace.ts b/lib/modules/manager/npm/update/locked-dependency/yarn-lock/replace.ts
index 08f1046722..b97e12b020 100644
--- a/lib/modules/manager/npm/update/locked-dependency/yarn-lock/replace.ts
+++ b/lib/modules/manager/npm/update/locked-dependency/yarn-lock/replace.ts
@@ -35,6 +35,6 @@ export function replaceConstraintVersion(
   }
   return lockFileContent.replace(
     regEx(matchString),
-    `${constraintLine}  version: "${newVersion}"\n$5`
+    `${constraintLine}  version "${newVersion}"\n$5`
   );
 }
-- 
GitLab