(row)
| 17 | import {JSDOM} from 'jsdom'; |
| 18 | |
| 19 | function getRange(row) { |
| 20 | let range = []; |
| 21 | |
| 22 | let th = row.firstElementChild; |
| 23 | |
| 24 | do { |
| 25 | const {textContent} = th; |
| 26 | |
| 27 | let [start, end = start] = textContent.split('-'); |
| 28 | |
| 29 | if (start === '') { |
| 30 | range.push([]); |
| 31 | } else { |
| 32 | start = start.replace(/\.x$/, '.1'); |
| 33 | end = end.replace(/\.x$/, '.1'); |
| 34 | |
| 35 | range.push([Number(start), Number(end)]); |
| 36 | } |
| 37 | } while ((th = th.nextElementSibling)); |
| 38 | |
| 39 | return range; |
| 40 | } |
| 41 | |
| 42 | function getLocales(cell) { |
| 43 | let locales = []; |