diff --git a/src/styleq.js b/src/styleq.js index 7089007..e3cfe4f 100644 --- a/src/styleq.js +++ b/src/styleq.js @@ -38,7 +38,7 @@ function createStyleq(options?: StyleqOptions): Styleq { return function styleq() { // Keep track of property commits to the className - const definedProperties = []; + const definedProperties: Array = []; // The className and inline style to build up let className = ''; let inlineStyle: null | InlineStyle = null; @@ -100,14 +100,13 @@ function createStyleq(options?: StyleqOptions): Styleq { const propsToDefine = transformProperty ? transformProperty(prop) : prop; - const propsIsArray = Array.isArray(propsToDefine); - if (propsIsArray) { + if (Array.isArray(propsToDefine)) { definedProperties.push(...propsToDefine); } else { definedProperties.push(propsToDefine); } if (nextCache != null) { - if (propsIsArray) { + if (Array.isArray(propsToDefine)) { definedPropertiesChunk.push(...propsToDefine); } else { definedPropertiesChunk.push(propsToDefine); diff --git a/styleq.flow.js b/styleq.flow.js index c697fb2..a648596 100644 --- a/styleq.flow.js +++ b/styleq.flow.js @@ -27,7 +27,7 @@ export type StyleqOptions = { disableCache?: boolean, disableMix?: boolean, transform?: (EitherStyle) => EitherStyle, - transformProperty?: (string) => $ReadOnlyArray, + transformProperty?: (string) => $ReadOnlyArray | string, }; export type StyleqResult = [string, InlineStyle | null];