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

Function sortGradient

_benchmarks/sample_antd.js:17930–17950  ·  view source on GitHub ↗
(gradients)

Source from the content-addressed store, hash-verified

17928 */
17929
17930var sortGradient = function sortGradient(gradients) {
17931 var tempArr = [];
17932 Object.keys(gradients).forEach(function (key) {
17933 var formattedKey = parseFloat(key.replace(/%/g, ''));
17934
17935 if (!isNaN(formattedKey)) {
17936 tempArr.push({
17937 key: formattedKey,
17938 value: gradients[key]
17939 });
17940 }
17941 });
17942 tempArr = tempArr.sort(function (a, b) {
17943 return a.key - b.key;
17944 });
17945 return tempArr.map(function (_ref) {
17946 var key = _ref.key,
17947 value = _ref.value;
17948 return "".concat(value, " ").concat(key, "%");
17949 }).join(', ');
17950};
17951/**
17952 * Then this man came to realize the truth: Besides six pence, there is the moon. Besides bread and
17953 * butter, there is the bug. And... Besides women, there is the code.

Callers 1

handleGradientFunction · 0.85

Calls 1

isNaNFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…