You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
825 B
35 lines
825 B
import isArray from './is-array';
|
|
function parseRadius(radius) {
|
|
var r1 = 0, r2 = 0, r3 = 0, r4 = 0;
|
|
if (isArray(radius)) {
|
|
if (radius.length === 1) {
|
|
r1 = r2 = r3 = r4 = radius[0];
|
|
}
|
|
else if (radius.length === 2) {
|
|
r1 = r3 = radius[0];
|
|
r2 = r4 = radius[1];
|
|
}
|
|
else if (radius.length === 3) {
|
|
r1 = radius[0];
|
|
r2 = r4 = radius[1];
|
|
r3 = radius[2];
|
|
}
|
|
else {
|
|
r1 = radius[0];
|
|
r2 = radius[1];
|
|
r3 = radius[2];
|
|
r4 = radius[3];
|
|
}
|
|
}
|
|
else {
|
|
r1 = r2 = r3 = r4 = radius;
|
|
}
|
|
return {
|
|
r1: r1,
|
|
r2: r2,
|
|
r3: r3,
|
|
r4: r4,
|
|
};
|
|
}
|
|
export default parseRadius;
|
|
//# sourceMappingURL=parse-radius.js.map
|