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/docker/helpers/networkHelper.js

14 lines
378 B

import _ from 'lodash-es';
class DockerNetworkHelper {
static getIPV4Configs(configs) {
return _.filter(configs, (config) => /^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$/.test(config.Subnet));
}
static getIPV6Configs(configs) {
return _.without(configs, ...DockerNetworkHelper.getIPV4Configs(configs));
}
}
export default DockerNetworkHelper;