import { Address4 } from './ipv4' ; import { Address6 } from './ipv6' ; export interface ReverseFormOptions { omitSuffix ? : boolean ; } export function isInSubnet ( this , address ) { if ( this . subnetMask < address . subnetMask ) { return false ; } if ( this . mask ( address . subnetMask ) === address . mask ( ) ) { return true ; } return false ; } export function isCorrect ( defaultBits ) { return function ( this ) { if ( this . addressMinusSuffix !== this . correctForm ( ) ) { return false ; } if ( this . subnetMask === defaultBits && ! this . parsedSubnet ) { return true ; } return this . parsedSubnet === String ( this . subnetMask ) ; } ; }