MCPcopy
hub / github.com/tdewolff/minify / handleGradient

Function handleGradient

_benchmarks/sample_antd.js:17965–17984  ·  view source on GitHub ↗
(strokeColor, directionConfig)

Source from the content-addressed store, hash-verified

17963 */
17964
17965var handleGradient = function handleGradient(strokeColor, directionConfig) {
17966 var _strokeColor$from = strokeColor.from,
17967 from = _strokeColor$from === void 0 ? _ant_design_colors__WEBPACK_IMPORTED_MODULE_2__[/* presetPrimaryColors */ "b"].blue : _strokeColor$from,
17968 _strokeColor$to = strokeColor.to,
17969 to = _strokeColor$to === void 0 ? _ant_design_colors__WEBPACK_IMPORTED_MODULE_2__[/* presetPrimaryColors */ "b"].blue : _strokeColor$to,
17970 _strokeColor$directio = strokeColor.direction,
17971 direction = _strokeColor$directio === void 0 ? directionConfig === 'rtl' ? 'to left' : 'to right' : _strokeColor$directio,
17972 rest = __rest(strokeColor, ["from", "to", "direction"]);
17973
17974 if (Object.keys(rest).length !== 0) {
17975 var sortedGradients = sortGradient(rest);
17976 return {
17977 backgroundImage: "linear-gradient(".concat(direction, ", ").concat(sortedGradients, ")")
17978 };
17979 }
17980
17981 return {
17982 backgroundImage: "linear-gradient(".concat(direction, ", ").concat(from, ", ").concat(to, ")")
17983 };
17984};
17985
17986var Line = function Line(props) {
17987 var prefixCls = props.prefixCls,

Callers 1

LineFunction · 0.85

Calls 1

sortGradientFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…