MCPcopy Create free account
hub / github.com/corbanbrook/dsp.js / regex

Function regex

examples/js/processing.js:10396–10406  ·  view source on GitHub ↗
(needle, hay)

Source from the content-addressed store, hash-verified

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);

Callers 1

buildPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected