MCPcopy
hub / github.com/greensock/GSAP / getRawPath

Function getRawPath

esm/utils/paths.js:120–136  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

118
119
120export function getRawPath(value) {
121 value = _isString(value) && _selectorExp.test(value) ? document.querySelector(value) || value : value;
122 var e = value.getAttribute ? value : 0,
123 rawPath;
124
125 if (e && (value = value.getAttribute("d"))) {
126 //implements caching
127 if (!e._gsPath) {
128 e._gsPath = {};
129 }
130
131 rawPath = e._gsPath[value];
132 return rawPath && !rawPath._dirty ? rawPath : e._gsPath[value] = stringToRawPath(value);
133 }
134
135 return !value ? console.warn("Expecting a <path> element or an SVG path data string") : _isString(value) ? stringToRawPath(value) : _isNumber(value[0]) ? [value] : value;
136} //copies a RawPath WITHOUT the length meta data (for speed)
137
138export function copyRawPath(rawPath) {
139 var a = [],

Callers 2

_alignFunction · 0.90

Calls 3

_isStringFunction · 0.70
stringToRawPathFunction · 0.70
_isNumberFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…