Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export let extendDeep = function(dst) {
angular.forEach(arguments, function(obj) {
if (obj !== dst) {
angular.forEach(obj, function(value, key) {
if (instanceKeywords.indexOf(key) === -1) {
if (dst[key]) {
if (angular.isArray(dst[key])) {
dst[key].concat(value.filter(function(v) {
var vv = dst[key].indexOf(v) !== -1;
if (vv) extendDeep(vv, v);
return vv;
}));
} else if (angular.isObject(dst[key])) {
extendDeep(dst[key], value);
} else {
// if value is a simple type like a string, boolean or number
// then assign it
dst[key] = value;
loadFilterData($columns: ColumnDef[]) {
ng1.forEach($columns, ($column) => {
const result = $column.filterData(this.$scope);
if (!result) {
delete $column.filterData;
return undefined;
}
if (isPromiseLike(result)) {
delete $column.filterData;
return result.then(data => {
// our deferred can eventually return arrays, functions and objects
if (!ng1.isArray(data) && !ng1.isFunction(data) && !ng1.isObject(data)) {
// if none of the above was found - we just want an empty array
data = [];
}
$column.data = data;
});
.then((datasources: any) => {
this.existingDatasourceNames = {};
angular.forEach(datasources, (datasource) => {
this.existingDatasourceNames[datasource.name.toLowerCase()] = true;
});
})
.then(this.validate);
function handle_image(image) {
var item;
var manifest = image.dockerImageManifest;
if (manifest) {
manifest = JSON.parse(manifest);
angular.forEach(manifest.history || [], function(item) {
if (typeof item.v1Compatibility == "string")
item.v1Compatibility = JSON.parse(item.v1Compatibility);
});
item = {
kind: "DockerImageManifest",
metadata: {
name: image.metadata.name,
selfLink: "/internal/manifests/" + image.metadata.name
},
manifest: manifest,
};
loader.handle(item);
}
}
angular.forEach(projects, function(project) {
angular.forEach(project.runs, function(run) {
var stats = findOrCreate(index, dateStats, run.date, createDateStats);
stats.metrics = metricsService.addMetrics(stats.metrics, run.metrics);
});
});
return (pipelineElements, selectedOptions) => {
var filteredElements = [];
angular.forEach(pipelineElements, pe => {
if (!pe.category || pe.category.length === 0) {
filteredElements.push(pe);
}
angular.forEach(selectedOptions, so => {
if (pe.category.indexOf(so) !== -1) {
filteredElements.push(pe);
}
})
})
return filteredElements;
}
}
getPipelinesToModify() {
angular.forEach(this.pipelines, pipeline => {
if (pipeline.running != this.action && this.hasCategory(pipeline)) {
this.pipelinesToModify.push(pipeline);
}
});
}
function refreshData() {
var nodes = $scope.nodes;
var data = [];
if (!nodes)
nodes = [];
angular.forEach(nodes, function(node) {
var result, value, name;
var tooltip = _("Unknown");
if (node && node.metadata)
name = node.metadata.name;
if (!name)
return;
result = $scope.stats.getSimpleUsage(node, currentTab);
if (result)
value = result.used / result.total;
if (value === undefined)
value = -1;
else
tooltip = tabs[currentTab].tooltip(result);
.then((users:any) => {
this.userMap = {};
angular.forEach(users, (user:any) => {
this.userMap[user.systemName] = true;
});
});
}
CrudManager.prototype.getReferencedValues = function(entityName) {
var self = this,
references = this.getReferences(entityName),
calls = [];
angular.forEach(references, function(reference) {
calls.push(self.getAll(reference.targetEntity().name(), 1, false))
});
return this.$q.all(calls)
.then(function(responses) {
var i = 0;
angular.forEach(references, function(reference, index) {
references[index].setChoices(self.getReferenceChoices(reference, responses[i++].entities));
});
return references;
});
};