MCPcopy Create free account
hub / github.com/amandaghassaei/OrigamiSimulator / parsePathDataString

Function parsePathDataString

dependencies/path-data-polyfill.js:309–329  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

307 }
308
309 let parsePathDataString = (string) => {
310 if (!string || string.length === 0) return [];
311
312 let source = new Source(string);
313 let pathData = [];
314
315 if (source.initialCommandIsMoveTo()) {
316 while (source.hasMoreData()) {
317 let pathSeg = source.parseSegment();
318
319 if (pathSeg === null) {
320 break;
321 }
322 else {
323 pathData.push(pathSeg);
324 }
325 }
326 }
327
328 return pathData;
329 }
330
331 let setAttribute = SVGPathElement.prototype.setAttribute;
332 let removeAttribute = SVGPathElement.prototype.removeAttribute;

Callers 1

Calls 3

hasMoreDataMethod · 0.95
parseSegmentMethod · 0.95

Tested by

no test coverage detected