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 26fa3e1..9314a2b 100644 Binary files a/tests/snapshots/deps.js.snap and b/tests/snapshots/deps.js.snap differ