Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
TsCache.prototype.isDirty = function (id, checkImports) {
var _this = this;
var label = this.dependencyTree.node(id);
if (!label)
return false;
if (!checkImports || label.dirty)
return label.dirty;
if (this.ambientTypesDirty)
return true;
var dependencies = alg.dijkstra(this.dependencyTree, id);
return some(dependencies, function (dependency, node) {
if (!node || dependency.distance === Infinity)
return false;
var l = _this.dependencyTree.node(node);
var dirty = l === undefined ? true : l.dirty;
if (dirty)
_this.context.debug(" import changed: " + node);
return dirty;
});
};
TsCache.prototype.makeName = function (id, snapshot) {
private isDirty(id: string, checkImports: boolean): boolean
{
const label = this.dependencyTree.node(id) as INodeLabel;
if (!label)
return false;
if (!checkImports || label.dirty)
return label.dirty;
if (this.ambientTypesDirty)
return true;
const dependencies = alg.dijkstra(this.dependencyTree, id);
return _.some(dependencies, (dependency, node) =>
{
if (!node || dependency.distance === Infinity)
return false;
const l = this.dependencyTree.node(node) as INodeLabel | undefined;
const dirty = l === undefined ? true : l.dirty;
if (dirty)
this.context.debug(` import changed: ${node}`);
return dirty;
});
}