refactor: improve types testing types definition
[e-mobility-charging-stations-simulator.git] / ui / web / src / composables / Utils.ts
CommitLineData
f568f368 1export const ifUndefined = <T>(value: T | undefined, isValue: T): T => {
194b6bf3 2 if (value === undefined) return isValue
66a7748d
JB
3 return value as T
4}
f568f368 5
f568f368 6// export const compose = <T>(...fns: ((arg: T) => T)[]): ((x: T) => T) => {
66a7748d
JB
7// return (x: T) => fns.reduceRight((y, fn) => fn(y), x)
8// }