Skip to content

Commit

Permalink
added new utility type
Browse files Browse the repository at this point in the history
  • Loading branch information
volar committed Sep 25, 2023
1 parent 2c1edf8 commit 43d0cbd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ import {
} from '@/composables/system/datatableColumns'
import { useCommonVuetifyConfig } from '@/model/commonVuetifyConfig'
import { type CachedItem, defineCached } from '@/composables/system/defineCached'
import type { ObjectLeaves, ObjectPaths } from '@/types/utils'
import type { ObjectLeaves, ObjectPaths, Prettify } from '@/types/utils'
import { loadCommonFonts } from '@/plugins/webfontloader'
import {
AnzuApiForbiddenError,
Expand Down Expand Up @@ -408,6 +408,7 @@ export {
DatatableSortBy,
ObjectPaths,
ObjectLeaves,
Prettify,
EnableDisable,
CachedItem,
RecordWasType,
Expand Down
4 changes: 4 additions & 0 deletions src/types/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ export type ObjectLeaves<T, D extends number = 10> = [D] extends [never]
: T extends object
? { [K in keyof T]-?: Join<K, ObjectLeaves<T[K], Prev[D]>> }[keyof T]
: ''

export type Prettify<T> = {
[K in keyof T]: T[K]
} & {}

0 comments on commit 43d0cbd

Please sign in to comment.