From 0eb4a5826a268c9bbd7f6b53afec9e6209ff56d8 Mon Sep 17 00:00:00 2001 From: Jan Novotny Date: Fri, 15 Nov 2024 15:15:54 +0100 Subject: [PATCH] fix: use locale-independent comparison for sorting of overrides --- index.js | 2 +- tests/_helpers.js | 12 +- tests/deps.js | 7 + tests/snapshots/deps.js.md | 552 ++++++++++++++++++++++++++++++++++- tests/snapshots/deps.js.snap | Bin 685 -> 1129 bytes 5 files changed, 556 insertions(+), 17 deletions(-) diff --git a/index.js b/index.js index 60ecd43..701d9a8 100755 --- a/index.js +++ b/index.js @@ -77,7 +77,7 @@ const sortObjectBySemver = sortObjectBy((a, b) => { const { name: bName, range: bRange } = parseNameAndVersionRange(b) if (aName !== bName) { - return aName.localeCompare(bName) + return aName > bName ? 1 : -1 } if (!aRange) { return -1 diff --git a/tests/_helpers.js b/tests/_helpers.js index 7f2ba70..0b8862b 100644 --- a/tests/_helpers.js +++ b/tests/_helpers.js @@ -53,8 +53,8 @@ function sortObjectAlphabetically(t, options = {}) { for (let depth = 1; depth < maxDepth + 1; depth++) { sortObject(t, { ...options, - value: keysToObject(['z', 'a'], depth), - expect: expect || keysToObject(['a', 'z'], depth), + value: keysToObject(['z', 'e', 'ch', 'a'], depth), + expect: expect || keysToObject(['a', 'ch', 'e', 'z'], depth), }) } } @@ -73,6 +73,10 @@ function sortObjectWithRangeAlphabetically(t, options = {}) { '@a-package@1.2.3', 'b-package@1.2.3', '@b-package', + '@e-package@1.2.3', + '@ch-package@1.2.3', + 'e-package@1.2.3', + 'ch-package@1.2.3', ], depth, ), @@ -82,10 +86,14 @@ function sortObjectWithRangeAlphabetically(t, options = {}) { [ '@a-package@1.2.3', '@b-package', + '@ch-package@1.2.3', + '@e-package@1.2.3', '@z-package@1.2.3', 'b-package@1.2.3', 'b-package-package@1.2.3', 'c-package@1.2.3', + 'ch-package@1.2.3', + 'e-package@1.2.3', ], depth, ), diff --git a/tests/deps.js b/tests/deps.js index eaca27b..6885d7a 100644 --- a/tests/deps.js +++ b/tests/deps.js @@ -44,3 +44,10 @@ test('dependenciesMetaRange', macro.sortObjectWithRangeAlphabetically, { // TODO: don't use snapshot, find a esaier way for review expect: 'snapshot', }) + +test('pnpm.overrides', macro.sortObjectWithRangeAlphabetically, { + path: 'pnpm.overrides', + maxDepth: 2, + // TODO: don't use snapshot, find a esaier way for review + expect: 'snapshot', +}) diff --git a/tests/snapshots/deps.js.md b/tests/snapshots/deps.js.md index ce3b680..71b43b5 100644 --- a/tests/snapshots/deps.js.md +++ b/tests/snapshots/deps.js.md @@ -12,6 +12,8 @@ Generated by [AVA](https://avajs.dev). input: `{␊ "peerDependenciesMeta": {␊ "z": "z",␊ + "e": "e",␊ + "ch": "ch",␊ "a": "a"␊ }␊ }`, @@ -19,6 +21,8 @@ Generated by [AVA](https://avajs.dev). output: `{␊ "peerDependenciesMeta": {␊ "a": "a",␊ + "ch": "ch",␊ + "e": "e",␊ "z": "z"␊ }␊ }`, @@ -32,10 +36,26 @@ Generated by [AVA](https://avajs.dev). "peerDependenciesMeta": {␊ "z": {␊ "z": "z",␊ + "e": "e",␊ + "ch": "ch",␊ + "a": "a"␊ + },␊ + "e": {␊ + "z": "z",␊ + "e": "e",␊ + "ch": "ch",␊ + "a": "a"␊ + },␊ + "ch": {␊ + "z": "z",␊ + "e": "e",␊ + "ch": "ch",␊ "a": "a"␊ },␊ "a": {␊ "z": "z",␊ + "e": "e",␊ + "ch": "ch",␊ "a": "a"␊ }␊ }␊ @@ -45,10 +65,26 @@ Generated by [AVA](https://avajs.dev). "peerDependenciesMeta": {␊ "a": {␊ "a": "a",␊ + "ch": "ch",␊ + "e": "e",␊ + "z": "z"␊ + },␊ + "ch": {␊ + "a": "a",␊ + "ch": "ch",␊ + "e": "e",␊ + "z": "z"␊ + },␊ + "e": {␊ + "a": "a",␊ + "ch": "ch",␊ + "e": "e",␊ "z": "z"␊ },␊ "z": {␊ "a": "a",␊ + "ch": "ch",␊ + "e": "e",␊ "z": "z"␊ }␊ }␊ @@ -64,6 +100,8 @@ Generated by [AVA](https://avajs.dev). input: `{␊ "dependenciesMeta": {␊ "z": "z",␊ + "e": "e",␊ + "ch": "ch",␊ "a": "a"␊ }␊ }`, @@ -71,6 +109,8 @@ Generated by [AVA](https://avajs.dev). output: `{␊ "dependenciesMeta": {␊ "a": "a",␊ + "ch": "ch",␊ + "e": "e",␊ "z": "z"␊ }␊ }`, @@ -84,10 +124,26 @@ Generated by [AVA](https://avajs.dev). "dependenciesMeta": {␊ "z": {␊ "z": "z",␊ + "e": "e",␊ + "ch": "ch",␊ + "a": "a"␊ + },␊ + "e": {␊ + "z": "z",␊ + "e": "e",␊ + "ch": "ch",␊ + "a": "a"␊ + },␊ + "ch": {␊ + "z": "z",␊ + "e": "e",␊ + "ch": "ch",␊ "a": "a"␊ },␊ "a": {␊ "z": "z",␊ + "e": "e",␊ + "ch": "ch",␊ "a": "a"␊ }␊ }␊ @@ -97,10 +153,26 @@ Generated by [AVA](https://avajs.dev). "dependenciesMeta": {␊ "a": {␊ "a": "a",␊ + "ch": "ch",␊ + "e": "e",␊ + "z": "z"␊ + },␊ + "ch": {␊ + "a": "a",␊ + "ch": "ch",␊ + "e": "e",␊ + "z": "z"␊ + },␊ + "e": {␊ + "a": "a",␊ + "ch": "ch",␊ + "e": "e",␊ "z": "z"␊ },␊ "z": {␊ "a": "a",␊ + "ch": "ch",␊ + "e": "e",␊ "z": "z"␊ }␊ }␊ @@ -120,7 +192,11 @@ Generated by [AVA](https://avajs.dev). "b-package-package@1.2.3": "b-package-package@1.2.3",␊ "@a-package@1.2.3": "@a-package@1.2.3",␊ "b-package@1.2.3": "b-package@1.2.3",␊ - "@b-package": "@b-package"␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ }␊ }`, options: undefined, @@ -128,10 +204,14 @@ Generated by [AVA](https://avajs.dev). "dependenciesMeta": {␊ "@a-package@1.2.3": "@a-package@1.2.3",␊ "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ "@z-package@1.2.3": "@z-package@1.2.3",␊ "b-package@1.2.3": "b-package@1.2.3",␊ "b-package-package@1.2.3": "b-package-package@1.2.3",␊ - "c-package@1.2.3": "c-package@1.2.3"␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ }␊ }`, pretty: true, @@ -148,7 +228,11 @@ Generated by [AVA](https://avajs.dev). "b-package-package@1.2.3": "b-package-package@1.2.3",␊ "@a-package@1.2.3": "@a-package@1.2.3",␊ "b-package@1.2.3": "b-package@1.2.3",␊ - "@b-package": "@b-package"␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ },␊ "c-package@1.2.3": {␊ "@z-package@1.2.3": "@z-package@1.2.3",␊ @@ -156,7 +240,11 @@ Generated by [AVA](https://avajs.dev). "b-package-package@1.2.3": "b-package-package@1.2.3",␊ "@a-package@1.2.3": "@a-package@1.2.3",␊ "b-package@1.2.3": "b-package@1.2.3",␊ - "@b-package": "@b-package"␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ },␊ "b-package-package@1.2.3": {␊ "@z-package@1.2.3": "@z-package@1.2.3",␊ @@ -164,7 +252,11 @@ Generated by [AVA](https://avajs.dev). "b-package-package@1.2.3": "b-package-package@1.2.3",␊ "@a-package@1.2.3": "@a-package@1.2.3",␊ "b-package@1.2.3": "b-package@1.2.3",␊ - "@b-package": "@b-package"␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ },␊ "@a-package@1.2.3": {␊ "@z-package@1.2.3": "@z-package@1.2.3",␊ @@ -172,7 +264,11 @@ Generated by [AVA](https://avajs.dev). "b-package-package@1.2.3": "b-package-package@1.2.3",␊ "@a-package@1.2.3": "@a-package@1.2.3",␊ "b-package@1.2.3": "b-package@1.2.3",␊ - "@b-package": "@b-package"␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ },␊ "b-package@1.2.3": {␊ "@z-package@1.2.3": "@z-package@1.2.3",␊ @@ -180,7 +276,11 @@ Generated by [AVA](https://avajs.dev). "b-package-package@1.2.3": "b-package-package@1.2.3",␊ "@a-package@1.2.3": "@a-package@1.2.3",␊ "b-package@1.2.3": "b-package@1.2.3",␊ - "@b-package": "@b-package"␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ },␊ "@b-package": {␊ "@z-package@1.2.3": "@z-package@1.2.3",␊ @@ -188,7 +288,59 @@ Generated by [AVA](https://avajs.dev). "b-package-package@1.2.3": "b-package-package@1.2.3",␊ "@a-package@1.2.3": "@a-package@1.2.3",␊ "b-package@1.2.3": "b-package@1.2.3",␊ - "@b-package": "@b-package"␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ + },␊ + "@e-package@1.2.3": {␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ + },␊ + "@ch-package@1.2.3": {␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ + },␊ + "e-package@1.2.3": {␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ + },␊ + "ch-package@1.2.3": {␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ }␊ }␊ }`, @@ -198,50 +350,422 @@ Generated by [AVA](https://avajs.dev). "@a-package@1.2.3": {␊ "@a-package@1.2.3": "@a-package@1.2.3",␊ "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ "@z-package@1.2.3": "@z-package@1.2.3",␊ "b-package@1.2.3": "b-package@1.2.3",␊ "b-package-package@1.2.3": "b-package-package@1.2.3",␊ - "c-package@1.2.3": "c-package@1.2.3"␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ },␊ "@b-package": {␊ "@a-package@1.2.3": "@a-package@1.2.3",␊ "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ "@z-package@1.2.3": "@z-package@1.2.3",␊ "b-package@1.2.3": "b-package@1.2.3",␊ "b-package-package@1.2.3": "b-package-package@1.2.3",␊ - "c-package@1.2.3": "c-package@1.2.3"␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + },␊ + "@ch-package@1.2.3": {␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + },␊ + "@e-package@1.2.3": {␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ },␊ "@z-package@1.2.3": {␊ "@a-package@1.2.3": "@a-package@1.2.3",␊ "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ "@z-package@1.2.3": "@z-package@1.2.3",␊ "b-package@1.2.3": "b-package@1.2.3",␊ "b-package-package@1.2.3": "b-package-package@1.2.3",␊ - "c-package@1.2.3": "c-package@1.2.3"␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ },␊ "b-package@1.2.3": {␊ "@a-package@1.2.3": "@a-package@1.2.3",␊ "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ "@z-package@1.2.3": "@z-package@1.2.3",␊ "b-package@1.2.3": "b-package@1.2.3",␊ "b-package-package@1.2.3": "b-package-package@1.2.3",␊ - "c-package@1.2.3": "c-package@1.2.3"␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ },␊ "b-package-package@1.2.3": {␊ "@a-package@1.2.3": "@a-package@1.2.3",␊ "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ "@z-package@1.2.3": "@z-package@1.2.3",␊ "b-package@1.2.3": "b-package@1.2.3",␊ "b-package-package@1.2.3": "b-package-package@1.2.3",␊ - "c-package@1.2.3": "c-package@1.2.3"␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ },␊ "c-package@1.2.3": {␊ "@a-package@1.2.3": "@a-package@1.2.3",␊ "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + },␊ + "ch-package@1.2.3": {␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ "@z-package@1.2.3": "@z-package@1.2.3",␊ "b-package@1.2.3": "b-package@1.2.3",␊ "b-package-package@1.2.3": "b-package-package@1.2.3",␊ - "c-package@1.2.3": "c-package@1.2.3"␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + },␊ + "e-package@1.2.3": {␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + }␊ + }␊ + }`, + pretty: true, + } + +## pnpm.overrides + +> Should sort `pnpm.overrides` as object. + + { + input: `{␊ + "pnpm": {␊ + "overrides": {␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ + }␊ + }␊ + }`, + options: undefined, + output: `{␊ + "pnpm": {␊ + "overrides": {␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + }␊ + }␊ + }`, + pretty: true, + } + +> Should sort `pnpm.overrides` as object. + + { + input: `{␊ + "pnpm": {␊ + "overrides": {␊ + "@z-package@1.2.3": {␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ + },␊ + "c-package@1.2.3": {␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ + },␊ + "b-package-package@1.2.3": {␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ + },␊ + "@a-package@1.2.3": {␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ + },␊ + "b-package@1.2.3": {␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ + },␊ + "@b-package": {␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ + },␊ + "@e-package@1.2.3": {␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ + },␊ + "@ch-package@1.2.3": {␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ + },␊ + "e-package@1.2.3": {␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ + },␊ + "ch-package@1.2.3": {␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3"␊ + }␊ + }␊ + }␊ + }`, + options: undefined, + output: `{␊ + "pnpm": {␊ + "overrides": {␊ + "@a-package@1.2.3": {␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + },␊ + "@b-package": {␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + },␊ + "@ch-package@1.2.3": {␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + },␊ + "@e-package@1.2.3": {␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + },␊ + "@z-package@1.2.3": {␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + },␊ + "b-package@1.2.3": {␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + },␊ + "b-package-package@1.2.3": {␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + },␊ + "c-package@1.2.3": {␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + },␊ + "ch-package@1.2.3": {␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + },␊ + "e-package@1.2.3": {␊ + "@a-package@1.2.3": "@a-package@1.2.3",␊ + "@b-package": "@b-package",␊ + "@ch-package@1.2.3": "@ch-package@1.2.3",␊ + "@e-package@1.2.3": "@e-package@1.2.3",␊ + "@z-package@1.2.3": "@z-package@1.2.3",␊ + "b-package-package@1.2.3": "b-package-package@1.2.3",␊ + "b-package@1.2.3": "b-package@1.2.3",␊ + "c-package@1.2.3": "c-package@1.2.3",␊ + "ch-package@1.2.3": "ch-package@1.2.3",␊ + "e-package@1.2.3": "e-package@1.2.3"␊ + }␊ }␊ }␊ }`, diff --git a/tests/snapshots/deps.js.snap b/tests/snapshots/deps.js.snap index 26fa3e13ca827f77953d322f49e5722dfe4da7f0..9314a2bb28671c9eb4a6624460d4034ebcf14c27 100644 GIT binary patch literal 1129 zcmV-v1eW_jRzVHZ75VY!okXRX6kf7pkU;v3ffPtw4e*yz5JIW8IwS77JaS4^~UWY1oKA$i5 z`M$5u&zFx+8y(Nt3tk`dupM@I=yTq^#eMEJx$CrfaF>U6J8*43XnA4q>bTjoL;ErF zi?9IwKX!r5Zvj9Z0KNdgPXO3v0A*HMWu<$KXWR)H8-H9`Spl{LY!28mlv$y|iooVq z*?imedtp?1a=2(&RnbtYTUP&=WmONVTm65Rhb7)G@u=jq`bDP|mHVev?dqas9W5Ru zuDsy+VcT*akS+1Lgc_k7n?AY_&`TrLO8IJ-{oQWa!@QR^N!u%ofjM1Ew9&U zT7lOMtsT)ob}T!vyuoDGMzo6WM6`Y|fZq(@u&73>;IW*zh98scl9Q62v=~9lIyy6z zQ|@xmYRY}uQ|wY%!TDgth8)wgaEQq-ajNP`GdrC=`SiOym|~YRi|V0O`^{{dZixc_ zGXR_bz#Ubael(C$av0}q(OH9@Z1cc&cX`^A=Nh7j-z)&!F96)0Q;hhNEFskoHhkOJvv+y@O6_WG zvp+qlx=11Erpc;N%SKe4K4a3M(V2ByFrH*x@+yMf6TOb>2mPIvqT_;rrs|@$PD{`@ zRT)J4cSIbOde^0xOCfUgyRi|dNs zcB7);ZP78TFmTA!#DNVloNV)iBsR$KL5y=kloyVdaMI^85`Yl`$j-!&5R4Flc$R_W&~mAjv%{?Y8_2Ufa{|=w$!^Cn*~3 literal 685 zcmV;e0#f}!RzVN&hC9CK-pq9@0a}%w*<$=l8r%GC6-W z90ks4baugoCq`U^oR1&zkozw89gjy(xnN%8voJadMD*dpb(vr<$%6(=#6NPKH2VMs z06qh_1aOl82c)%6TF-{Bxg!W!U3NMhkUfxVAQldYaf38Kn){^b`Qbz?TMys0DYa#( z*nJw0QEE@^e*D*+x8ebt*=K4L>YdUN>VB$$j`8UPk_hLIWZQbzd~fWH8~=o;}oDqy~{CM?bVN*GW<^SSvZ*?XQd|Cr|;*f3X1f-54wv2e8QX>yGY3qP zPqr@`MY4Kk)m4A8-nykHNQ16)Iwf&sFP*%sbyq;HL@Pu{6E& z*i`q<>baw!l!~)-)KaTOl?p0x*!t0&-)9Z15ZLzIYjB0&B=Kuv)k>`fRQ+03l~!)eO2(?_kXI9v5G#6-)WC{>)!@{?6@5