refactor: optimize propsAndStyles

This commit is contained in:
Mikael Sand
2019-10-19 22:56:04 +03:00
parent 3aa126e6be
commit 4b99246547
+6 -4
View File
@@ -17,10 +17,12 @@ import { Component } from 'react';
export function propsAndStyles(props: Object & { style?: [] | {} }) {
const { style } = props;
return {
...(Array.isArray(style) ? Object.assign({}, ...style) : style),
...props,
};
return !style
? props
: {
...(Array.isArray(style) ? Object.assign({}, ...style) : style),
...props,
};
}
function getMarker(marker?: string) {