(value)
| 118 | |
| 119 | |
| 120 | export 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 | |
| 138 | export function copyRawPath(rawPath) { |
| 139 | var a = [], |
no test coverage detected
searching dependent graphs…