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

github.com/gohugoio/hugo-mod-jslibs-dist.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'popperjs/package/lib/utils/getMainAxisFromPlacement.js.flow')
-rw-r--r--popperjs/package/lib/utils/getMainAxisFromPlacement.js.flow8
1 files changed, 8 insertions, 0 deletions
diff --git a/popperjs/package/lib/utils/getMainAxisFromPlacement.js.flow b/popperjs/package/lib/utils/getMainAxisFromPlacement.js.flow
new file mode 100644
index 0000000..93fa806
--- /dev/null
+++ b/popperjs/package/lib/utils/getMainAxisFromPlacement.js.flow
@@ -0,0 +1,8 @@
+// @flow
+import type { Placement } from '../enums';
+
+export default function getMainAxisFromPlacement(
+ placement: Placement
+): 'x' | 'y' {
+ return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
+}