Skip to content

Commit

Permalink
fix flow errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nmn committed Nov 6, 2024
1 parent a3cde01 commit 3153f9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/styleq.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> = [];
// The className and inline style to build up
let className = '';
let inlineStyle: null | InlineStyle = null;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion styleq.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type StyleqOptions = {
disableCache?: boolean,
disableMix?: boolean,
transform?: (EitherStyle) => EitherStyle,
transformProperty?: (string) => $ReadOnlyArray<string>,
transformProperty?: (string) => $ReadOnlyArray<string> | string,
};

export type StyleqResult = [string, InlineStyle | null];
Expand Down

0 comments on commit 3153f9f

Please sign in to comment.