MCPcopy
hub / github.com/midrender/revideo / parseLineDash

Method parseLineDash

packages/2d/src/lib/components/SVG.ts:548–557  ·  view source on GitHub ↗
(value: string | null)

Source from the content-addressed store, hash-verified

546 }
547
548 private static parseLineDash(value: string | null): number[] | null {
549 if (!value) return null;
550
551 const list = value.split(/,|\s+/);
552 if (list.findIndex(str => str.endsWith('%')) > 0) {
553 useLogger().warn(`SVG: percentage line dash are ignored`);
554 return null;
555 }
556 return list.map(str => parseFloat(str));
557 }
558
559 private static parseDashOffset(value: string | null): number | null {
560 if (!value) return null;

Callers 1

getElementStyleMethod · 0.95

Calls 3

useLoggerFunction · 0.90
warnMethod · 0.80
splitMethod · 0.45

Tested by

no test coverage detected