Fix parsing packets from tag in web worker
This commit is contained in:
parent
8728db2b08
commit
f87d8d0433
|
@ -2,7 +2,11 @@
|
||||||
* @requires enums
|
* @requires enums
|
||||||
* @module packet
|
* @module packet
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
import enums from '../enums.js';
|
import enums from '../enums.js';
|
||||||
|
import * as packets from './all_packets.js'; // re-import module to parse packets from tag
|
||||||
|
|
||||||
/** @see module:packet/compressed */
|
/** @see module:packet/compressed */
|
||||||
export { default as Compressed } from './compressed.js';
|
export { default as Compressed } from './compressed.js';
|
||||||
|
@ -43,7 +47,7 @@ export { default as Trust } from './trust.js';
|
||||||
* @returns {Object} new packet object with type based on tag
|
* @returns {Object} new packet object with type based on tag
|
||||||
*/
|
*/
|
||||||
export function newPacketFromTag(tag) {
|
export function newPacketFromTag(tag) {
|
||||||
return new this[packetClassFromTagName(tag)]();
|
return new packets[packetClassFromTagName(tag)]();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user