File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export class Netmask {
2727 /**
2828 * The blocks broadcast address (eg: 192.168.1.0/24 => 192.168.1.255)
2929 */
30- broadcast : string ;
30+ broadcast : string | undefined ;
3131 /**
3232 * The number of IP addresses in a block (eg: 256).
3333 */
Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ if (block.contains("10.0.8.10")) {
1010block = new netmask . Netmask ( "216.240.32.0" , "255.255.255.0" ) ;
1111block = new netmask . Netmask ( "216.240.32.0" , 24 ) ;
1212
13+ block = new netmask . Netmask ( "216.240.32.0" ) ;
14+ if ( typeof block . broadcast === undefined ) {
15+ console . log ( "no broadcast address for /32 block" ) ;
16+ }
17+
1318class CustomizedNetmask extends netmask . Netmask {
1419 // Test that we can override `next` to return a CustomizedNetmask (as opposed to netmask.Netmask) object
1520 next ( count : number = 1 ) : CustomizedNetmask {
You can’t perform that action at this time.
0 commit comments