Skip to content

Commit

Permalink
Revert "Fix sorting differences with npm deps (#68)"
Browse files Browse the repository at this point in the history
This reverts commit 61ef435.
  • Loading branch information
cameronhunter committed Oct 2, 2023
1 parent 61ef435 commit cd4b591
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 28 deletions.
6 changes: 5 additions & 1 deletion src/sort-dependencies.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import sortObject from 'sort-object-keys';
import { PackageJson } from './types';

function order(a: string, b: string) {
return a.localeCompare(b, 'en');
}

export default function sortDependencies<
TKey extends
| 'bundledDependencies'
Expand All @@ -12,5 +16,5 @@ export default function sortDependencies<
>(key: TKey, packageJson: PackageJson) {
const dependencies = packageJson[key];
const keys = Object.keys(dependencies || {}) as Array<keyof typeof dependencies & string>;
return keys.length === 0 ? {} : { [key]: sortObject(dependencies, keys.sort()) };
return keys.length === 0 ? {} : { [key]: sortObject(dependencies, keys.sort(order)) };
}
13 changes: 0 additions & 13 deletions tests/__snapshots__/sort-dependencies.test.ts.snap

This file was deleted.

14 changes: 0 additions & 14 deletions tests/sort-dependencies.test.ts

This file was deleted.

0 comments on commit cd4b591

Please sign in to comment.