Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static isPointer(name, type) {
if (type != null
&& type !== wire.types.ANY
&& type !== wire.types.A
&& type !== wire.types.AAAA) {
return false;
}
if (name.length < 2 || name.length > 29)
return false;
if (name[0] !== '_')
return false;
return base32.testHex(name.substring(1));
}
matches(type) {
switch (type) {
case wire.types.ANY:
return true;
case wire.types.A:
return this.isINET4();
case wire.types.AAAA:
return this.isINET6();
default:
return false;
}
}