UNPKG

@tuniao/tnui-vue3-uniapp

Version:
9 lines (7 loc) 223 B
import type { Many } from './_common' export function castArray<T>(value: Many<T>): T[] { if (!value || (Array.isArray(value) && !value.length)) { return [] } return Array.isArray(value) ? value : [value as T] }