Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public dependencies(value: Resolvable | Resolvable[]) {
const newDependencies = utils.isResolvable(value) ? [value] : (value as Resolvable[]);
newDependencies.forEach((d: Resolvable) => {
// TODO: This code fails to function correctly if the inline table has not yet
// been attached to the session. This code probably needs to be moved to compile().
const allResolved = this.session.findActions(d);
const resolved = allResolved.length > 0 ? allResolved[0] : undefined;
if (!!resolved && resolved instanceof Table && resolved.proto.type === "inline") {
resolved.proto.dependencies.forEach(childDep => this.addDependency(childDep));
} else {
this.addDependency(d);
}
});
return this;
}
public dependencies(value: Resolvable | Resolvable[]) {
const newDependencies = utils.isResolvable(value) ? [value] : (value as Resolvable[]);
newDependencies.forEach((d: Resolvable) => {
const depName = utils.stringifyResolvable(d);
if (this.proto.dependencies.indexOf(depName) < 0) {
this.proto.dependencies.push(depName);
}
});
return this;
}
public dependencies(value: Resolvable | Resolvable[]) {
const newDependencies = utils.isResolvable(value) ? [value] : (value as Resolvable[]);
newDependencies.forEach((d: Resolvable) => {
const depName = utils.stringifyResolvable(d);
if (this.proto.dependencies.indexOf(depName) < 0) {
this.proto.dependencies.push(depName);
}
});
return this;
}