$ npm i subnet-overlap
const subnetOverlap = require('subnet-overlap')
subnetOverlap(['172.22.2.0/24'], '172.22.2.0/24') // true
subnetOverlap(['172.22.2.0/24'], '172.22.3.0/24') // false
<script src="subnetOverlap.js"></script>
<script>
console.log(subnetOverlap(['172.22.2.0/24'], '172.22.2.0/24')) // true
</script>
subnetOverlap(subnets, subnet)
subnets
: (Array) List of existing subnetssubnet
: (String) Subnet to check for overlap