// @ts-nocheck
/**
 * 將壹個或多個元素轉換為數組
 * @param item 要轉換為數組的元素
 * @returns 轉換後的數組
 */
// #ifndef APP-IOS || APP-ANDROID
export const toArray = <T>(item: T | T[]): T[] => Array.isArray(item) ? item : [item];
// #endif


// #ifdef APP-IOS || APP-ANDROID
export function toArray<T extends any>(item: any): T[] {
	return Array.isArray(item) ? item as T[] : [item as T]// as T[]
};
// #endif
// 示例
// console.log(toArray(5)); // 輸出: [5]
// console.log(toArray("hello")); // 輸出: ["hello"]
// console.log(toArray([1, 2, 3])); // 輸出: [1, 2, 3]
// console.log(toArray(["apple", "banana"])); // 輸出: ["apple", "banana"]