serialize(obj) {
		const cache = new WeakSet();
		return JSON.stringify(obj, (key, value) => {
			if (typeof value === "object" && value !== null) {
				if (cache.has(value)) {
					return "[Circular]";
				}
				cache.add(value);
			}
			return value;
		});
	}
Serializer a JS object to Buffer

@param {Object} obj
@param {String} type of packet
@returns {Buffer}

@memberof Serializer