Skip to content

Commit abaeb4d

Browse files
committed
Type Address4.addressMinusSuffix as non-nilable (closes #143)
It is always assigned in the constructor, so the optional `?` was forcing callers into needless nil-checks (and untestable branches). Matches the existing IPv6 typing.
1 parent 2878c29 commit abaeb4d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/ipv4.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const isCorrect4 = common.isCorrect(constants.BITS);
1212
*/
1313
export class Address4 {
1414
address: string;
15-
addressMinusSuffix?: string;
15+
addressMinusSuffix: string = '';
1616
groups: number = constants.GROUPS;
1717
parsedAddress: string[] = [];
1818
parsedSubnet: string = '';

0 commit comments

Comments
 (0)