Skip to content

Commit f1b87c5

Browse files
committed
feat: add linePosition prop parser
1 parent b341b89 commit f1b87c5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/components/optionsParser.js

+10
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ export const calcThickness = (thickness, size) => {
5454
return thickness.toString().includes("%") ? (value * size) / 100 : value;
5555
};
5656

57+
const parseLinePosition = (linePosition) => {
58+
const [position, offset] = linePosition.toString().split(" ");
59+
return {
60+
position,
61+
offset: offset || 0,
62+
};
63+
};
64+
5765
export const parseOptions = (options) => {
5866
const dot = dotParser(options.dot);
5967
const globalDot = dotParser(options.globalDot);
@@ -66,6 +74,8 @@ export const parseOptions = (options) => {
6674
globalDot: { ...globalDot, size: calcThickness(globalDot.size, options.size) },
6775
dash: dashParser(options.dash),
6876
lineMode: lineModeParser(options),
77+
linePosition: parseLinePosition(options.linePosition),
78+
emptyLinePosition: parseLinePosition(options.emptyLinePosition),
6979
animation: animationParser(options.animation),
7080
};
7181
};

0 commit comments

Comments
 (0)