Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Undertaker from 'undertaker';
import { logger } from './logger';
import chalk from 'chalk';
import { wrapTask } from './wrapTask';
import { Task } from './interfaces';
import { clearCache } from './cache';
const undertaker = new Undertaker();
const NS_PER_SEC = 1e9;
let topLevelTask: string | undefined = undefined;
let errorReported = false;
const tasksInProgress: { [key: string]: boolean } = {};
const colors = [chalk.cyanBright, chalk.magentaBright, chalk.blueBright, chalk.greenBright, chalk.yellowBright];
const taskColor: { [taskName: string]: number } = {};
let colorIndex = 0;
function shouldLog(taskArgs: any) {
return (
!taskArgs.branch &&
taskArgs.name !== '' &&
!taskArgs.name.endsWith('?') &&
taskArgs.name !== '_wrapFunction' &&