This commit is contained in:
Nathan Bierema 2021-06-14 17:54:11 -04:00
parent 14725700a8
commit 8b9b4d905b
2 changed files with 4 additions and 4 deletions

View File

@ -157,7 +157,7 @@ const getStylingByKeys = (
.map((key) => mergedStyling[key as string]) .map((key) => mergedStyling[key as string])
.filter(Boolean); .filter(Boolean);
const props = styles.reduce( const props = styles.reduce<Styling>(
(obj, s) => { (obj, s) => {
if (typeof s === 'string') { if (typeof s === 'string') {
obj.className = [obj.className, s].filter(Boolean).join(' '); obj.className = [obj.className, s].filter(Boolean).join(' ');
@ -176,7 +176,7 @@ const getStylingByKeys = (
delete props.className; delete props.className;
} }
if (Object.keys(props.style).length === 0) { if (Object.keys(props.style!).length === 0) {
delete props.style; delete props.style;
} }

View File

@ -2,8 +2,8 @@ import { Base16Theme } from 'base16';
import * as CSS from 'csstype'; import * as CSS from 'csstype';
export interface Styling { export interface Styling {
className: string; className?: string;
style: CSS.Properties<string | number>; style?: CSS.Properties<string | number>;
} }
export type StylingValueFunction = ( export type StylingValueFunction = (