UNPKG

epicwar

Version:
18 lines (17 loc) 494 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getMapID = void 0; function getMapID(cells) { for (const cell of cells) { const urls = cell.getElementsByTagName('a'); for (const url of urls) { const { href } = url; if (!href.startsWith('/maps/download')) { continue; } return +/\/([0-9]+)\//gm.exec(href)[1]; } } return null; } exports.getMapID = getMapID;