main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
312 bytes
|
Line | |
---|
1 | // @flow
|
---|
2 | import type { Placement } from '../enums';
|
---|
3 |
|
---|
4 | const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
|
---|
5 |
|
---|
6 | export default function getOppositePlacement(placement: Placement): Placement {
|
---|
7 | return (placement.replace(
|
---|
8 | /left|right|bottom|top/g,
|
---|
9 | matched => hash[matched]
|
---|
10 | ): any);
|
---|
11 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.