MCPcopy Index your code
hub / github.com/tdewolff/minify / normalizeDashArrayY

Function normalizeDashArrayY

_benchmarks/sample_echarts.js:27499–27513  ·  view source on GitHub ↗

* Convert dash input into dashArray * * @param {DecalDashArrayY} dash dash input * @return {number[]} normolized dash array

(dash)

Source from the content-addressed store, hash-verified

27497
27498
27499 function normalizeDashArrayY(dash) {
27500 if (!dash || typeof dash === 'object' && dash.length === 0) {
27501 return [0, 0];
27502 }
27503
27504 if (typeof dash === 'number') {
27505 var dashValue_1 = Math.ceil(dash);
27506 return [dashValue_1, dashValue_1];
27507 }
27508
27509 var dashValue = map(dash, function (n) {
27510 return Math.ceil(n);
27511 });
27512 return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;
27513 }
27514 /**
27515 * Get block length of each line. A block is the length of dash line and space.
27516 * For example, a line with [4, 1] has a dash line of 4 and a space of 1 after

Callers 1

setPatternnSourceFunction · 0.85

Calls 1

mapFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…