| 10394 | // Return arrays of SVG commands and coords |
| 10395 | // get this to use p.matchAll() - will need to work around the lack of null return |
| 10396 | var regex = function regex(needle, hay) { |
| 10397 | var i = 0, |
| 10398 | results = [], |
| 10399 | latest, regexp = new RegExp(needle, "g"); |
| 10400 | latest = results[i] = regexp.exec(hay); |
| 10401 | while (latest) { |
| 10402 | i++; |
| 10403 | latest = results[i] = regexp.exec(hay); |
| 10404 | } |
| 10405 | return results; |
| 10406 | }; |
| 10407 | |
| 10408 | var buildPath = function buildPath(d) { |
| 10409 | var c = regex("[A-Za-z][0-9\\- ]+|Z", d); |