asb_cloud_front/src/utils/index.ts

12 lines
403 B
TypeScript
Raw Normal View History

2021-12-27 15:18:35 +05:00
export type { RawDate, timeInS } from './datetime'
export { isRawDate, formatDate, defaultFormat, periodToString } from './datetime'
export const headerHeight = 64
export const mainFrameSize = () => ({
width: window.innerWidth,
height: window.innerHeight - headerHeight
})
export const arrayOrDefault = <T extends unknown>(arr?: unknown, def: T[] = []): T[] => Array.isArray(arr) ? arr : def