X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=ui%2Fweb%2Fsrc%2Fcomposables%2FUtils.ts;h=2f9c1ac5e92e669e7113813a378da986f8f11236;hb=cfab8dc9ea7801746461d4e8d6ac9852deb678b5;hp=ea51bc23121a2b47d4813a5098843564cae31c91;hpb=a807045be19c1ed4996a44d8c2c8774e926dc6dc;p=e-mobility-charging-stations-simulator.git diff --git a/ui/web/src/composables/Utils.ts b/ui/web/src/composables/Utils.ts index ea51bc23..2f9c1ac5 100644 --- a/ui/web/src/composables/Utils.ts +++ b/ui/web/src/composables/Utils.ts @@ -1,23 +1,3 @@ -const isUndefined = (value: unknown): boolean => { - return typeof value === 'undefined' -} - -export const ifUndefined = (value: T | undefined, isValue: T): T => { - if (isUndefined(value) === true) return isValue - return value as T -} - -// const isIterable = (obj: T): boolean => { -// if (obj == null) { -// return false -// } -// return typeof (obj as unknown as Iterable)[Symbol.iterator] === 'function' -// } - -// const ifNotIterableDo = (obj: T, cb: () => void): void => { -// if (isIterable(obj) === false) cb() -// } - // export const compose = (...fns: ((arg: T) => T)[]): ((x: T) => T) => { // return (x: T) => fns.reduceRight((y, fn) => fn(y), x) // }