-
-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docs): update scripts to generate alpha numerically
Makes diffs easier and ensures it's always written the same way
- Loading branch information
Showing
7 changed files
with
2,478 additions
and
2,465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { alphaNumericSort } from "@react-md/core"; | ||
|
||
export function printObjectAlphaNumerically( | ||
obj: Record<string, unknown> | ||
): string { | ||
const sortedKeyValuePairs = alphaNumericSort(Object.entries(obj), { | ||
extractor: ([name]) => name, | ||
}) | ||
.map(([name, value]) => `"${name}": ${JSON.stringify(value)}`) | ||
.join(",\n"); | ||
|
||
return `{${sortedKeyValuePairs}}`; | ||
} |
Oops, something went wrong.