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(oldVal, (oldValue, key) => {
if (!newVal || !(key in newVal)) {
if (key in directiveOpts) {
if (key === 'ui-floating') {
opts[key] = 'auto';
} else {
opts[key] = patchSortableOption(key, undefined);
}
return;
}
if (!defaultOptions) {
defaultOptions = sortable().options;
}
let defaultValue = defaultOptions[key];
defaultValue = patchSortableOption(key, defaultValue);
if (!optsDiff) {
optsDiff = {};
}
optsDiff[key] = defaultValue;
opts[key] = defaultValue;
}
});
}