Skip to content

Commit

Permalink
Add some whitespace and remove extra type
Browse files Browse the repository at this point in the history
  • Loading branch information
John Schulz committed Nov 7, 2020
1 parent 1b64a8c commit 0085069
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,7 @@ interface InstallUploadedArchiveParams {

export type InstallPackageParams =
| ({ installSource: Extract<InstallSource, 'registry'> } & InstallRegistryPackageParams)
| ({ installSource: Extract<InstallSource, 'upload'> } & InstallUploadedArchiveParams)
| never;
| ({ installSource: Extract<InstallSource, 'upload'> } & InstallUploadedArchiveParams);

async function installPackageByUpload({
savedObjectsClient,
Expand Down Expand Up @@ -312,11 +311,19 @@ export async function installPackage(args: InstallPackageParams) {
if (!('installSource' in args)) {
throw new Error('installSource is required');
}

if (args.installSource === 'registry') {
const { savedObjectsClient, pkgkey, callCluster, force } = args;
return installPackageFromRegistry({ savedObjectsClient, pkgkey, callCluster, force });

return installPackageFromRegistry({
savedObjectsClient,
pkgkey,
callCluster,
force,
});
} else if (args.installSource === 'upload') {
const { savedObjectsClient, callCluster, archiveBuffer, contentType } = args;

return installPackageByUpload({
savedObjectsClient,
callCluster,
Expand Down

0 comments on commit 0085069

Please sign in to comment.