File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 88 type SelectState ,
99} from "@/lib/types/state/component" ;
1010import { type ComponentChangeHandler } from "@/lib/types/state/event" ;
11+ import { isString } from "@/lib/utils/isString" ;
1112
1213export interface SelectProps extends Omit < SelectState , "type" > {
1314 onChange : ComponentChangeHandler ;
@@ -64,7 +65,7 @@ export function Select({
6465function normalizeSelectOption (
6566 option : SelectOption ,
6667) : [ string | number , string ] {
67- if ( typeof option === "string" ) {
68+ if ( isString ( option ) ) {
6869 return [ option , option ] ;
6970 } else if ( typeof option === "number" ) {
7071 return [ option , option . toString ( ) ] ;
Original file line number Diff line number Diff line change 11import { type CSSProperties } from "react" ;
22import { isObject } from "@/lib/utils/isObject" ;
33import type { TopLevelSpec } from "vega-lite/src/spec" ;
4+ import { isString } from "@/lib/utils/isString" ;
45
56export type ComponentType =
67 | "Box"
@@ -67,7 +68,7 @@ export interface TypographyState extends ContainerState {
6768}
6869
6970export function isComponentState ( object : unknown ) : object is ComponentState {
70- return isObject ( object ) && typeof object . type === "string" ;
71+ return isObject ( object ) && isString ( object . type ) ;
7172}
7273
7374export function isContainerState ( object : unknown ) : object is ContainerState {
Original file line number Diff line number Diff line change 11import { isObject } from "@/lib/utils/isObject" ;
2+ import { isString } from "@/lib/utils/isString" ;
23
34export type ObjPath = ( string | number ) [ ] ;
45export type ObjPathLike = ObjPath | string | number | undefined | null ;
@@ -83,7 +84,7 @@ export function normalizeObjPath(pathLike: ObjPathLike): ObjPath {
8384}
8485
8586export function formatObjPath ( objPath : ObjPathLike ) : string {
86- if ( typeof objPath === "string" ) {
87+ if ( isString ( objPath ) ) {
8788 return objPath ;
8889 } else if ( Array . isArray ( objPath ) ) {
8990 return objPath
You can’t perform that action at this time.
0 commit comments