MCPcopy Create free account
hub / github.com/adobe/react-spectrum / getRange

Function getRange

scripts/generateAllPlurals.mjs:19–40  ·  view source on GitHub ↗
(row)

Source from the content-addressed store, hash-verified

17import {JSDOM} from 'jsdom';
18
19function 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
42function getLocales(cell) {
43 let locales = [];

Callers 1

extractFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected