Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
}
} else if (!angular.isFunction(dst[key])) {
dst[key] = value;
}
}
if (!angular.isString(policy.domainTypeId) || policy.domainTypeId === "") {
delete policy.$currentDomainType;
return;
}
// Find domain type from id
var domainType = _.find(this.availableDomainTypes, (domainType: any) => {
return (domainType.id === policy.domainTypeId);
});
// Apply domain type to field
var promise;
if ((domainType.field.derivedDataType !== null && (domainType.field.derivedDataType !== policy.field.derivedDataType || domainType.field.precisionScale !== policy.field.precisionScale))
|| (angular.isArray(policy.standardization) && policy.standardization.length > 0)
|| (angular.isArray(policy.field.tags) && policy.field.tags.length > 0)
|| (angular.isArray(policy.validation) && policy.validation.length > 0)) {
promise = this.$mdDialog.show({
controller: "ApplyDomainTypeDialogController",
escapeToClose: false,
fullscreen: true,
parent: angular.element(document.body),
templateUrl: "../../../shared/apply-domain-type/apply-domain-type-dialog.html",
locals: {
domainType: domainType,
field: policy.field
}
});
} else {
promise = Promise.resolve();
}
promise.then(() =>{
export function omit(obj, keys) {
if (!isObject(obj)) {
return obj;
}
if (isArray(keys) && keys.length === 0) {
return obj;
}
if (isString(keys) && !keys) {
return obj;
}
if (!isString(keys) && !isArray(keys)) {
return obj;
}
const o = clone(obj);
keys.forEach(function(key) {
delete o[key];
});
return o;
}
export function omit(obj, keys) {
if (!isObject(obj)) {
return obj;
}
if (isArray(keys) && keys.length === 0) {
return obj;
}
if (isString(keys) && !keys) {
return obj;
}
if (!isString(keys) && !isArray(keys)) {
return obj;
}
const o = clone(obj);
keys.forEach(function(key) {
delete o[key];
});
return o;
}
const addTasks = (application, tasks) => {
return $q.when(angular.isArray(tasks) ? tasks : []);
};
formatData(dataList) {
if (dataList && angular.isArray(dataList)) {
dataList.forEach(item => {
if (item.child) {
this.formatNodeData(item, item.child);
}
});
}
}
/**
onDelete = () => {
if (!angular.isArray(this.model.sourceForFeeds) || this.model.sourceForFeeds.length === 0) {
this.datasourcesService.deleteById(this.model.id)
.then(() => {
this.$mdToast.show(
this.$mdToast.simple()
.textContent("Successfully deleted the data source " + this.model.name + ".")
.hideDelay(3000)
);
this.stateService.FeedManager().Datasource().navigateToDatasources();
}, (err: any) => {
this.$mdDialog.show(
this.$mdDialog.alert()
.clickOutsideToClose(true)
.title("Delete Failed")
.textContent("The data source '" + this.model.name + "' could not be deleted." + err.data.message)
.ariaLabel("Failed to delete data source")
.ok("Got it!")
link: function(scope: any, element: any, attrs: any) {
if (!angular.isArray(scope.model)) {
scope.model = [];
}
const select = $('select', element);
if (attrs.placeholder) {
select.attr('placeholder', attrs.placeholder);
}
select.tagsinput({
typeahead: {
source: angular.isFunction(scope.$parent[attrs.typeaheadSource])
? scope.$parent[attrs.typeaheadSource]
: null,
},
widthClass: attrs.widthClass,
LessMoreByTimestamp.prototype.loadLess = function () {
this.lessData = false;
this.moreData = true;
if (angular.isArray(this.results)) {
this.results.splice(-this.splice, this.splice);
this.lessData = this.anyLess(this.results.length);
}
this.updateTimestamp();
};
public isPropertyListArray(): boolean {
return isArray(this.properties);
}