mirror of
https://github.com/jwetzell/psn-js.git
synced 2026-08-13 03:13:52 +00:00
add method to get what tracker fields are used
This commit is contained in:
@@ -111,4 +111,19 @@ export class Decoder {
|
||||
}
|
||||
return packet;
|
||||
}
|
||||
|
||||
getTrackerFields(): Set<string> {
|
||||
const keys = new Set(
|
||||
Object.values(this.trackers)
|
||||
.map((tracker) => Object.keys(tracker))
|
||||
.flat(1)
|
||||
);
|
||||
|
||||
keys.delete('id');
|
||||
keys.delete('has_subchunks');
|
||||
keys.delete('data_len');
|
||||
keys.delete('chunk_data');
|
||||
|
||||
return keys;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user