add debuging

This commit is contained in:
zefie
2022-12-01 07:12:57 -05:00
parent 3bbe5b0c84
commit 2975550ad0
2 changed files with 4 additions and 9 deletions

View File

@@ -10,6 +10,7 @@ class WTVClientCapabilities {
capabilities = null;
capabilities_table = null;
debug = require('debug')('WTVClientCapabilities')
constructor(wtv_capability_flags = null) {
@@ -105,15 +106,9 @@ class WTVClientCapabilities {
return binary;
}
// Add .reverse() to strings for ease of processing
if (!String.prototype.reverse) {
String.prototype.reverse = function () {
return this.split("").reverse().reverseArray.join("");
}
}
// convert wtv_capability_flags to binary string, reverse the string, and split into array containing each character;
var bitfield = hex2bin(wtv_capability_flags).reverse().split("");
var bitfield = hex2bin(wtv_capability_flags).split("").reverse();
this.debug("bitfield:", bitfield)
var add = function (flag_name, flag) {
capabilities[flag_name] = flag;