Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
refactor(codec-config): clean up retrieveConfigHandler implementati…
Browse files Browse the repository at this point in the history
…on (#1642)
  • Loading branch information
jonahsnider authored Jul 15, 2021
1 parent 3b4412a commit 3a4a0bd
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions internal/codec-config/retrieveConfigHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ import {json, toml} from "@internal/codec-config";
export default function retrieveConfigHandler(
extension: ConfigType,
): ConfigHandler {
let manifestHandler: ConfigHandler | undefined = undefined;
if (extension === "toml") {
manifestHandler = toml;
} else if (extension === "json") {
manifestHandler = json;
switch (extension) {
case "toml":
return toml;
case "json":
return json;
default:
return json;
}

if (!manifestHandler) {
manifestHandler = json;
}

return manifestHandler;
}

0 comments on commit 3a4a0bd

Please sign in to comment.