Skip to content

Commit 811967a

Browse files
committed
♻️ Rename isObject to isStyleObject
1 parent ebc9736 commit 811967a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/lib/index.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type State = {
2626
otp: string[],
2727
};
2828

29-
const isObject = obj => typeof obj === 'object';
29+
const isStyleObject = obj => typeof obj === 'object';
3030

3131
class SingleOtpInput extends PureComponent<*> {
3232
input: ?HTMLInputElement;
@@ -58,7 +58,7 @@ class SingleOtpInput extends PureComponent<*> {
5858
}
5959
}
6060

61-
getClasses = (...classes) => classes.filter(c => !isObject(c) && c !== false).join(' ');
61+
getClasses = (...classes) => classes.filter(c => !isStyleObject(c) && c !== false).join(' ');
6262

6363
render() {
6464
const {
@@ -80,9 +80,9 @@ class SingleOtpInput extends PureComponent<*> {
8080
style={Object.assign(
8181
{ width: '1em', textAlign: 'center' },
8282
inputStyle,
83-
focus && isObject(focusStyle) && focusStyle,
84-
isDisabled && isObject(disabledStyle) && disabledStyle,
85-
hasErrored && isObject(errorStyle) && errorStyle
83+
focus && isStyleObject(focusStyle) && focusStyle,
84+
isDisabled && isStyleObject(disabledStyle) && disabledStyle,
85+
hasErrored && isStyleObject(errorStyle) && errorStyle
8686
)}
8787
className={this.getClasses(
8888
focus && focusStyle,
@@ -260,7 +260,7 @@ class OtpInput extends Component<Props, State> {
260260
const { containerStyle } = this.props;
261261

262262
return (
263-
<div style={Object.assign({ display: 'flex' }, isObject(containerStyle) && containerStyle )} className={!isObject(containerStyle) && containerStyle}>
263+
<div style={Object.assign({ display: 'flex' }, isStyleObject(containerStyle) && containerStyle )} className={!isStyleObject(containerStyle) && containerStyle}>
264264
{this.renderInputs()}
265265
</div>
266266
);

0 commit comments

Comments
 (0)