MCPcopy Index your code
hub / github.com/JedWatson/react-select / cleanValue

Function cleanValue

packages/react-select/src/utils.ts:67–73  ·  view source on GitHub ↗
(
  value: PropsValue<Option>
)

Source from the content-addressed store, hash-verified

65// ==============================
66
67export const cleanValue = <Option>(
68 value: PropsValue<Option>
69): Options<Option> => {
70 if (isArray(value)) return value.filter(Boolean);
71 if (typeof value === 'object' && value !== null) return [value];
72 return [];
73};
74
75// ==============================
76// Clean Common Props

Callers 3

useCreatableFunction · 0.90
constructorMethod · 0.90

Calls 1

isArrayFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…