All files / src/utils handleAssets.ts

0% Statements 0/9
0% Branches 0/6
0% Functions 0/3
0% Lines 0/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15                             
import getCurrentTask from "./playbook/task/getCurrentTask.ts";
 
export default function handleAssets(data, id: string) {
  const [task] = getCurrentTask(id);
  const source = task?.source?.toLowerCase() ?? "";
  switch (source) {
    case "bash":
      return data[0]?.bash.assets?.map((e) => e.ssh_server);
    default:
      return data[0][source].assets?.map(
        (e) => e[task?.ui_requirement.model_type?.toLowerCase() ?? ""],
      );
  }
}