Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function Gulp() {
Undertaker.call(this);
// Bind the functions for destructuring
this.watch = this.watch.bind(this);
this.task = this.task.bind(this);
this.series = this.series.bind(this);
this.parallel = this.parallel.bind(this);
this.registry = this.registry.bind(this);
this.tree = this.tree.bind(this);
this.lastRun = this.lastRun.bind(this);
this.src = this.src.bind(this);
this.dest = this.dest.bind(this);
this.symlink = this.symlink.bind(this);
}
util.inherits(Gulp, Undertaker);
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' &&
module.exports = ({ name, desc, opts, call: fn, loop }) => {
if (name) {
const displayName = fn.displayName
if (displayName === '' || displayName === '') {
metadata.get(fn).tree.label = `${displayName} ${name}`
}
fn.displayName = name
}
if (loop) {
const delegate = fn
name = delegate.displayName
delegate.displayName = `${name}:loop`
fn = () => watch(loop, { ignoreInitial: false }, delegate)
fn.displayName = name
}
if (desc) fn.description = desc
if (opts) fn.flags = opts
return fn
}