* Convert dash input into dashArray * * @param {DecalDashArrayY} dash dash input * @return {number[]} normolized dash array
(dash)
| 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 |
no test coverage detected
searching dependent graphs…