From 941da90ebfcb6aa5ba07430465bf2d53a2c54c4f Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Sat, 29 Jun 2019 17:38:09 +0530 Subject: [PATCH] chore: include comments --- packages/serve/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/serve/index.ts b/packages/serve/index.ts index d7771647fe1..3f8bde6a369 100644 --- a/packages/serve/index.ts +++ b/packages/serve/index.ts @@ -46,6 +46,15 @@ const pmConfig: PackageManagerConfig = { }; const spawnWithArg = (pm: string, cmd: string): SpawnSyncReturns => { + /* + * The dependency installation commands for the + * respective package manager is available as + * nested objects within pmConfig + * + * We gonna extract the root installation command + * and rest of the flags from pmConfig object + * by means of array destructuring + */ const [installCmd, ...flags] = pmConfig[pm][cmd]; const options: string[] = [installCmd, "webpack-dev-server", ...flags]; return spawn.sync(pm, options, { stdio: "inherit" });