Skip to content

Commit 5487062

Browse files
authored
Reduce complexity for resolving the label callout position (#743)
* Reduce complexity for resolving the label callout position * fixes lint * uses includes instead of indexOf
1 parent da64e92 commit 5487062

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/types/label.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ function getCalloutSideAdjust(position, options) {
221221

222222
function resolveCalloutPosition(element, options) {
223223
const position = options.position;
224-
if (position === 'left' || position === 'right' || position === 'top' || position === 'bottom') {
224+
if (positions.includes(position)) {
225225
return position;
226226
}
227227
return resolveCalloutAutoPosition(element, options);

0 commit comments

Comments
 (0)