Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (targetId) { // :
const target = project.targets[targetId];
if (target) {
target.selected = true;
targets = target.transitiveDeps(targets);
}
} else { // (:?)
for (let j = 0; j < project.targetList.length; j += 1) {
const target = project.targetList[j];
target.selected = true;
targets = target.transitiveDeps(targets);
}
}
} else {
const output = Unicode.stringOutput(OutputSettings.styled());
OutputStyle.redBold(output);
output.write("unknown project");
OutputStyle.reset(output);
output.write(" ");
OutputStyle.yellow(output);
output.write(projectId);
OutputStyle.reset(output);
console.log(output.bind());
}
} else if (targetId) { // :
for (let j = 0; j < this.projectList.length; j += 1) {
const target = this.projectList[j].targets[targetId];
if (target) {
target.selected = true;
targets = target.transitiveDeps(targets);
}
}
specifiers = Object.keys(this.projects);
} else if (typeof specifiers === "string") {
specifiers = specifiers.split(",");
}
if (i < specifiers.length) {
const specifier = specifiers[i];
const [projectId] = specifier.split(":");
const project = this.projects[projectId];
if (project) {
const result = callback(project);
if (result) {
return result.then(this.forEachProject.bind(this, specifiers, callback, i + 1));
}
} else {
const output = Unicode.stringOutput(OutputSettings.styled());
OutputStyle.redBold(output);
output.write("unknown project");
OutputStyle.reset(output);
output.write(" ");
OutputStyle.yellow(output);
output.write(projectId);
OutputStyle.reset(output);
console.log(output.bind());
}
return Promise.resolve(void 0).then(this.forEachProject.bind(this, specifiers, callback, i + 1));
} else {
return Promise.resolve(void 0);
}
}
protected onCompileFailure() {
this.compileStart = 0;
const output = Unicode.stringOutput(OutputSettings.styled());
OutputStyle.redBold(output);
output.write("failed to compile");
OutputStyle.reset(output);
output.write(" ");
OutputStyle.yellow(output);
output.write(this.uid);
OutputStyle.reset(output);
console.log(output.bind());
console.log();
}
protected onMinifyError(error: Error): void {
const output = Unicode.stringOutput(OutputSettings.styled());
OutputStyle.redBold(output);
output.write("error:");
OutputStyle.reset(output);
output.write(" ");
output.write(error.message);
console.log(output.bind());
console.log();
}
protected onBundleError(error: Error): void {
let output = Unicode.stringOutput(OutputSettings.styled());
OutputStyle.redBold(output);
output.write("error:");
OutputStyle.reset(output);
output.write(" ");
output.write(error.message);
console.log(output.bind());
console.log();
output = Unicode.stringOutput(OutputSettings.styled());
OutputStyle.redBold(output);
output.write("failed to bundle");
OutputStyle.reset(output);
output.write(" ");
OutputStyle.yellow(output);
output.write(this.uid);
OutputStyle.reset(output);
console.log(output.bind());
}
protected onBundleError(error: Error): void {
let output = Unicode.stringOutput(OutputSettings.styled());
OutputStyle.redBold(output);
output.write("error:");
OutputStyle.reset(output);
output.write(" ");
output.write(error.message);
console.log(output.bind());
console.log();
output = Unicode.stringOutput(OutputSettings.styled());
OutputStyle.redBold(output);
output.write("failed to bundle");
OutputStyle.reset(output);
output.write(" ");
OutputStyle.yellow(output);
output.write(this.uid);
OutputStyle.reset(output);
console.log(output.bind());
}
protected onBundleError(error: Error): void {
let output = Unicode.stringOutput(OutputSettings.styled());
OutputStyle.redBold(output);
output.write("error:");
OutputStyle.reset(output);
output.write(" ");
output.write(error.message);
console.log(output.bind());
console.log();
output = Unicode.stringOutput(OutputSettings.styled());
OutputStyle.redBold(output);
output.write("failed to bundle");
OutputStyle.reset(output);
output.write(" ");
OutputStyle.yellow(output);
output.write(this.uid);
OutputStyle.reset(output);
console.log(output.bind());
protected onCompileFailure() {
this.compileStart = 0;
const output = Unicode.stringOutput(OutputSettings.styled());
OutputStyle.redBold(output);
output.write("failed to compile");
OutputStyle.reset(output);
output.write(" ");
OutputStyle.yellow(output);
output.write(this.uid);
OutputStyle.reset(output);
console.log(output.bind());
console.log();
}