You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/kubernetes/helpers/formValidationHelper.js

16 lines
357 B

import _ from 'lodash-es';
class KubernetesFormValidationHelper {
static getDuplicates(names) {
const groupped = _.groupBy(names);
const res = {};
_.forEach(names, (name, index) => {
if (groupped[name].length > 1 && name) {
res[index] = name;
}
});
return res;
}
}
export default KubernetesFormValidationHelper;