Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function testExtend() {
// extends object type
(angular.extend({ a: 1 }, { b: 2 }): { a: number, b: number });
(angular.extend({ a: 1 }, { b: 2 }, { c: "str", d: 123 }): {
a: number,
b: number,
c: string,
d: number
});
}
return ssoAuthentication.getSsoAuthPendingPromise().then(() => {
config.headers = angular.extend(
angular.copy(ssoAuthentication.getHeaders()),
config.headers,
);
// For no prefix if begins with http(s)://
if (urlPrefix && !/^http(?:s)?:\/\//.test(config.url)) {
config.url = urlPrefix + config.url;
}
if (config.timeout) {
const deferredObjTimeout = $q.defer();
// Can be cancelled by user
config.timeout.then(() => {
deferredObjTimeout.resolve();
});
this.redrawLinks(true);
}
},
update: () => {
this.$timeout(() => {
// deffer save to let jqUI update the array
this.CloudProjectComputeInfrastructureOrchestrator.saveToUserPref();
});
},
};
// create vm sortable options by extending sortable options
this.vmSortableOptions = angular.extend({ handle: '.vm-grip' }, this.sortableOptions);
// create ip sortable options by extending sortable options
this.ipSortableOptions = angular.extend({ handle: '.ip-grip' }, this.sortableOptions);
}
function list(id) {
setId(id);
var _config = {
params: angular.extend({}, config.params)
};
return $http.get(url, _config).then(function(res){
return res.data.items;
});
}
reset: function () {
angular.extend(this.feedError, newErrorData());
},
hasErrors: function () {
const ThRunnableJobModel = function (data) {
angular.extend(this, data);
};
var instances = container.instances;
var serverGroups = container.serverGroups || [container];
container.healthCounts = {
upCount: instances.filter(function (instance) {
return instance.health[0].state === 'InService';
}).length,
downCount: instances.filter(function (instance) {
return instance.health[0].state === 'OutOfService';
}).length,
outOfServiceCount: serverGroups.reduce(function (acc, serverGroup) {
return serverGroup.instances.filter(function (instance) {
return instance.healthState === 'OutOfService';
}).length + acc;
}, 0),
};
angular.extend(container, container.healthCounts);
}
var backingData = command.backingData;
if (command.credentials) {
var regionsForAccount = backingData.credentialsKeyedByAccount[command.credentials] || {
regions: [],
defaultKeyPair: null,
};
backingData.filtered.regions = regionsForAccount.regions;
if (
!_.chain(backingData.filtered.regions)
.some({ name: command.region })
.value()
) {
command.region = null;
result.dirty.region = true;
} else {
angular.extend(result.dirty, command.regionChanged(command).dirty);
}
if (command.region) {
angular.extend(result.dirty, configureLoadBalancers(command).dirty);
}
} else {
command.region = null;
}
return result;
};
}
GridController.prototype.setColumnOptions = function (columnIndex, columnOptions) {
var originalOptions = this.gridOptions.gridColumnDefs[columnIndex];
if (!originalOptions) {
throw "Invalid grid column options found for column index " + columnIndex + ". Please report this error.";
}
columnOptions = angular.extend(columnOptions, originalOptions);
this.gridOptions.gridColumnDefs[columnIndex] = columnOptions;
};
GridController.prototype.toggleSorting = function (propertyName) {