From 8ec78df0a64802aff8a41deaea5f4e9c44aa89c0 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Mon, 19 Feb 2024 22:23:32 +0000 Subject: [PATCH] GH Action Standards --- src/controllers/deletePackagesPackageName.js | 15 +++------------ src/controllers/deletePackagesPackageNameStar.js | 5 +---- ...eletePackagesPackageNameVersionsVersionName.js | 15 +++------------ src/controllers/getOwnersOwnerName.js | 5 +---- .../getPackagesPackageNameStargazers.js | 10 ++-------- .../getPackagesPackageNameVersionsVersionName.js | 5 +---- ...ckagesPackageNameVersionsVersionNameTarball.js | 5 +---- src/controllers/getStars.js | 10 ++-------- src/controllers/getUsersLoginStars.js | 10 ++-------- 9 files changed, 16 insertions(+), 64 deletions(-) diff --git a/src/controllers/deletePackagesPackageName.js b/src/controllers/deletePackagesPackageName.js index 7b24c759..9866d5de 100644 --- a/src/controllers/deletePackagesPackageName.js +++ b/src/controllers/deletePackagesPackageName.js @@ -58,10 +58,7 @@ module.exports = { if (!packageExists.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(packageExists) - .assignCalls(callStack); + return sso.notOk().addContent(packageExists).assignCalls(callStack); } // Get `owner/repo` string format from pacakge @@ -76,10 +73,7 @@ module.exports = { if (!gitowner.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(gitowner) - .assignCalls(callStack); + return sso.notOk().addContent(gitowner).assignCalls(callStack); } // Now they are logged in locally, and have permissions over the GitHub repo @@ -90,10 +84,7 @@ module.exports = { if (!rm.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(rm) - .assignCalls(callStack); + return sso.notOk().addContent(rm).assignCalls(callStack); } const sso = new context.sso(); diff --git a/src/controllers/deletePackagesPackageNameStar.js b/src/controllers/deletePackagesPackageNameStar.js index 02ae55d2..7f8bb874 100644 --- a/src/controllers/deletePackagesPackageNameStar.js +++ b/src/controllers/deletePackagesPackageNameStar.js @@ -52,10 +52,7 @@ module.exports = { if (!unstar.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(unstar) - .assignCalls(callStack); + return sso.notOk().addContent(unstar).assignCalls(callStack); } const sso = new context.sso(); diff --git a/src/controllers/deletePackagesPackageNameVersionsVersionName.js b/src/controllers/deletePackagesPackageNameVersionsVersionName.js index 51a0e737..7437b08e 100644 --- a/src/controllers/deletePackagesPackageNameVersionsVersionName.js +++ b/src/controllers/deletePackagesPackageNameVersionsVersionName.js @@ -72,10 +72,7 @@ module.exports = { if (!packageExists.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(packageExists) - .assignCalls(callStack); + return sso.notOk().addContent(packageExists).assignCalls(callStack); } const gitowner = await context.vcs.ownership( @@ -88,10 +85,7 @@ module.exports = { if (!gitowner.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(gitowner) - .assignCalls(callStack); + return sso.notOk().addContent(gitowner).assignCalls(callStack); } // Mark the specified version for deletion, if version is valid @@ -105,10 +99,7 @@ module.exports = { if (!removeVersion.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(removeVersion) - .assignCalls(callStack); + return sso.notOk().addContent(removeVersion).assignCalls(callStack); } const sso = new context.sso(); diff --git a/src/controllers/getOwnersOwnerName.js b/src/controllers/getOwnersOwnerName.js index 93c85300..fb429b2d 100644 --- a/src/controllers/getOwnersOwnerName.js +++ b/src/controllers/getOwnersOwnerName.js @@ -45,10 +45,7 @@ module.exports = { if (!packages.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(packages) - .assignCalls(callStack); + return sso.notOk().addContent(packages).assignCalls(callStack); } const packObjShort = await context.models.constructPackageObjectShort( diff --git a/src/controllers/getPackagesPackageNameStargazers.js b/src/controllers/getPackagesPackageNameStargazers.js index f5d204b1..7e0b54c4 100644 --- a/src/controllers/getPackagesPackageNameStargazers.js +++ b/src/controllers/getPackagesPackageNameStargazers.js @@ -65,10 +65,7 @@ module.exports = { if (!stars.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(stars) - .assignCalls(callStack); + return sso.notOk().addContent(stars).assignCalls(callStack); } const gazers = await context.database.getUserCollectionById(stars.content); @@ -78,10 +75,7 @@ module.exports = { if (!gazers.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(gazers) - .assignCalls(callStack); + return sso.notOk().addContent(gazers).assignCalls(callStack); } const sso = new context.sso(); diff --git a/src/controllers/getPackagesPackageNameVersionsVersionName.js b/src/controllers/getPackagesPackageNameVersionsVersionName.js index 2dd230b6..1ba96b52 100644 --- a/src/controllers/getPackagesPackageNameVersionsVersionName.js +++ b/src/controllers/getPackagesPackageNameVersionsVersionName.js @@ -70,10 +70,7 @@ module.exports = { if (!pack.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(pack) - .assignCalls(callStack); + return sso.notOk().addContent(pack).assignCalls(callStack); } const packRes = await context.models.constructPackageObjectJSON( diff --git a/src/controllers/getPackagesPackageNameVersionsVersionNameTarball.js b/src/controllers/getPackagesPackageNameVersionsVersionNameTarball.js index 742f31bb..0cf208e2 100644 --- a/src/controllers/getPackagesPackageNameVersionsVersionNameTarball.js +++ b/src/controllers/getPackagesPackageNameVersionsVersionNameTarball.js @@ -70,10 +70,7 @@ module.exports = { if (!pack.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(pack) - .assignCalls(callStack); + return sso.notOk().addContent(pack).assignCalls(callStack); } const save = await context.database.updatePackageIncrementDownloadByName( diff --git a/src/controllers/getStars.js b/src/controllers/getStars.js index 0cfa85e2..9f8bd3a7 100644 --- a/src/controllers/getStars.js +++ b/src/controllers/getStars.js @@ -63,10 +63,7 @@ module.exports = { if (!userStars.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(userStars) - .assignCalls(callStack); + return sso.notOk().addContent(userStars).assignCalls(callStack); } if (userStars.content.length === 0) { @@ -87,10 +84,7 @@ module.exports = { if (!packCol.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(packCol) - .assignCalls(callStack); + return sso.notOk().addContent(packCol).assignCalls(callStack); } let newCol = await context.models.constructPackageObjectShort( diff --git a/src/controllers/getUsersLoginStars.js b/src/controllers/getUsersLoginStars.js index 0bdd88ae..495fa16d 100644 --- a/src/controllers/getUsersLoginStars.js +++ b/src/controllers/getUsersLoginStars.js @@ -51,10 +51,7 @@ module.exports = { if (!pointerCollection.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(pointerCollection) - .assignCalls(callStack); + return sso.notOk().addContent(pointerCollection).assignCalls(callStack); } // Since even if the pointerCollection is okay, it could be empty. Meaning the user @@ -81,10 +78,7 @@ module.exports = { if (!packageCollection.ok) { const sso = new context.sso(); - return sso - .notOk() - .addContent(packageCollection) - .assignCalls(callStack); + return sso.notOk().addContent(packageCollection).assignCalls(callStack); } packageCollection = await utils.constructPackageObjectShort(