static async PREPROCESS(data) {
        // As string.toString() is a no-op, we don't need to check the type beforehand
        const base64String = data.toString().replace(/_/g, "/").replace(/-/g, "+");

        try {
            // intentional return await
            return await new Promise((resolve, reject) => {
                zlib.inflate(Buffer.from(base64String, "base64"), (err, result) => {
                    if (!err) {
                        resolve(result);
                    } else {
                        reject(err);
                    }
                });
            });
        } catch (e) {
            Logger.error("Error while preprocessing map", e);

            return null;
        }
    }
Uploaded dreame Maps are actually base64url strings of zlib compressed data

https://tools.ietf.org/html/rfc4648#section-5



@param {Buffer|string} data
@returns {Promise<Buffer|null>}