maniajs
Version:
ManiaPlanet (Dedicated) Server Controller.
27 lines (24 loc) • 696 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.parseMap = parseMap;
var _gbxparser = require('@maniajs/gbxparser');
/**
* Parse Map GBX File.
*
* @param {string|Buffer} fd File or Buffer.
* @param {{thumb: boolean}} [options] Options.
* @param {boolean|function} [debug] Debug to console.log or custom function?
*
* @returns {Promise} Promise with returning map object.
*/
function parseMap(fd, options, debug) {
options = options || {};
debug = debug || false;
var parser = new _gbxparser.MapParser(fd, options);
if (debug) {
parser.debug = typeof debug === 'function' ? debug : console.log;
}
return parser.parse(fd);
}