Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
updated ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
sdadn committed Nov 6, 2023
1 parent 9baa5cc commit 228fc22
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions scripts/prettifyJSON/prettifyJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,6 @@ module.exports = (oldJSON) => {
delete oldJSON.homepage;
}

if (oldJSON.private) {
newJSON.private = oldJSON.private;
delete oldJSON.private;
}

if (oldJSON.publishConfig) {
newJSON.publishConfig = oldJSON.publishConfig;
delete oldJSON.publishConfig;
}

if (oldJSON.license) {
newJSON.license = oldJSON.license;
delete oldJSON.license;
Expand All @@ -65,6 +55,16 @@ module.exports = (oldJSON) => {
delete oldJSON.keywords;
}

if (oldJSON.private) {
newJSON.private = oldJSON.private;
delete oldJSON.private;
}

if (oldJSON.publishConfig) {
newJSON.publishConfig = oldJSON.publishConfig;
delete oldJSON.publishConfig;
}

if (oldJSON.workspaces) {
newJSON.workspaces = oldJSON.workspaces;
// alphabetize the list
Expand Down
6 changes: 3 additions & 3 deletions scripts/tests/prettifyJSON.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ describe.only('prettifyJSON script', () => {
'repository',
'bugs',
'homepage',
'private',
'publishConfig',
'license',
'keywords',
'private',
'publishConfig',
'workspaces',
'engines',
'main',
Expand Down Expand Up @@ -141,7 +141,7 @@ describe.only('prettifyJSON script', () => {
});

it('alphabetizes workspaces', () => {
fsReadFileMock.mockReturnValueOnce({ workspaces: ['JJJ', 'ZZZ', 'III', 'AAA', 'CCC'] });
fsReadFileMock.mockReturnValueOnce({ workspaces: ['JJJ', 'ZZZ', 'III', 'AAA', 'CCC'] });

const JSON = fs.readFileSync();
const newJSON = prettifyJSON(JSON);
Expand Down

0 comments on commit 228fc22

Please sign in to comment.