From 71f5c9791df3a97ebe387025d19ddc9a2e6d3e07 Mon Sep 17 00:00:00 2001 From: Ondrej Kraus Date: Thu, 5 Mar 2015 13:11:14 +0100 Subject: [PATCH] replace switch with if-else chain --- src/babel/build-external-helpers.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/babel/build-external-helpers.js b/src/babel/build-external-helpers.js index be9195d8c0..89fbb08bbd 100644 --- a/src/babel/build-external-helpers.js +++ b/src/babel/build-external-helpers.js @@ -55,17 +55,13 @@ export default function (whitelist, outputType = "global") { }; var tree; - switch (outputType) { - case "global": + if (outputType === "global") { tree = buildGlobal(namespace, builder); - break; - case "umd": + } else if (outputType === "umd") { tree = buildUmd(namespace, builder); - break; - case "var": + } else if (outputType === "var") { tree = buildVar(namespace, builder); - break; - default: + } else { throw new Error("Unsupported output type"); }