Range expansion: Difference between revisions

m
Line 2,145:
// (rising) hyphenated ranges.
rangeString.split(",")
.mapflatMap(x => x.split("-"){
.reduce((a,const s,ns i,= xsx.split("-") =>
Boolean.reduce((a, s), ?i, (xs) =>
0 < iBoolean(s) ? a.concat(
parseInt0 < i ? a.concat(
xs[i - 1].length ? parseInt(
sxs[i - 1].length ? (
) : `-${ s}`,
10 ) : `-${s}`,
) 10
) : [Number(s )]
) : a,[Number(s)]
[] ) : a,
) []
);
 
.flatMap(
ns =>return 2 === ns.length ? (
uncurry(enumFromTo)(ns)
) : ns;
});
 
 
9,655

edits