MCPcopy Create free account
hub / github.com/react-component/select / toArray

Function toArray

src/utils/commonUtil.ts:3–8  ·  view source on GitHub ↗
(value: T | T[])

Source from the content-addressed store, hash-verified

1import type { DisplayValueType } from '../BaseSelect';
2
3export function toArray<T>(value: T | T[]): T[] {
4 if (Array.isArray(value)) {
5 return value;
6 }
7 return value !== undefined ? [value] : [];
8}
9
10export const isClient =
11 typeof window !== 'undefined' && window.document && window.document.documentElement;

Callers 4

Select.tsxFile · 0.90
warningPropsFunction · 0.90
includesFunction · 0.90
convertChildrenToDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…