@bemedev/basifun
Version:
Basic ts functions
19 lines (16 loc) • 372 B
JavaScript
import { isDefined } from '../types/isDefined.js';
import { isArray } from './isArray.js';
const toArray = obj => {
if (isArray(obj)) {
return obj;
}
else {
const check = isDefined(obj);
if (!check)
return [];
return [obj];
}
};
toArray.typed = toArray;
export { toArray };
//# sourceMappingURL=toArray.js.map