- export function transformSomeToArray(source: any) {
- if (typeof source === 'string')
- return source.split(',');
- if (typeof source === 'object') {
- if (source instanceof Array)
- return source;
- else {
- const arr = [];
- for (const key in source)
- arr.push(source[key]);
- return arr;
- }
- }
- return source;
- }
|