(obj: T)
| 5 | import { useSettings } from '../state' |
| 6 | |
| 7 | function removeUndefinedProperty<T extends Record<string, any>>(obj: T) { |
| 8 | const newObj: Partial<T> = {} |
| 9 | |
| 10 | Object.entries(obj).forEach(([k, v]) => { |
| 11 | if (v !== undefined) { |
| 12 | newObj[k as keyof T] = v |
| 13 | } |
| 14 | }) |
| 15 | |
| 16 | return newObj |
| 17 | } |
| 18 | |
| 19 | export function useTypography(tab: BookTab) { |
| 20 | const { book } = useSnapshot(tab) |
no test coverage detected