Welcome to mirror list, hosted at ThFree Co, Russian Federation.

getOppositePlacement.js.flow « utils « lib « package « popperjs - github.com/gohugoio/hugo-mod-jslibs-dist.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8decc5765009facf78e0f7c7257e5aeb02bab88d (plain)
1
2
3
4
5
6
7
8
9
10
11
// @flow
import type { Placement } from '../enums';

const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };

export default function getOppositePlacement(placement: Placement): Placement {
  return (placement.replace(
    /left|right|bottom|top/g,
    matched => hash[matched]
  ): any);
}