MCPcopy Create free account
hub / github.com/adobe/react-spectrum / asArray

Function asArray

packages/react-stately/src/form/useFormValidationState.ts:232–238  ·  view source on GitHub ↗
(v: T | T[])

Source from the content-addressed store, hash-verified

230}
231
232function asArray<T>(v: T | T[]): T[] {
233 if (!v) {
234 return [];
235 }
236
237 return Array.isArray(v) ? v : [v];
238}
239
240function runValidate<T>(validate: ValidationFunction<T>, value: T): string[] {
241 if (typeof validate === 'function') {

Callers 2

runValidateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected