mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-03 16:31:59 +02:00
Add valid check methods
This commit is contained in:
parent
08ea798d53
commit
149f8bd9f5
1 changed files with 9 additions and 0 deletions
|
@ -20,6 +20,15 @@ module.exports = class Address {
|
|||
}
|
||||
}
|
||||
|
||||
static isValidAddress(addr) {
|
||||
return addr && addr.isValid();
|
||||
}
|
||||
|
||||
isValid() {
|
||||
// FTN address is valid if we have at least a net/node
|
||||
return _.isNumber(this.net) && _.isNumber(this.node);
|
||||
}
|
||||
|
||||
isEqual(other) {
|
||||
if(_.isString(other)) {
|
||||
other = Address.fromString(other);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue