push
github
2100 of 3363 branches covered (62.44%)
282 of 757 new or added lines in 74 files covered. (37.25%)
14879 existing lines in 182 files now uncovered.25574 of 98035 relevant lines covered (26.09%)
5.17 hits per line
1 |
import type { Prisma } from '@teable/db-main-prisma'; |
1✔ |
2 |
import type { IUserMeVo } from '@teable/openapi'; |
1✔ |
3 |
import { pick } from 'lodash'; |
1✔ |
4 |
import { getFullStorageUrl } from '../../utils/full-storage-url'; |
1✔ |
5 |
|
1✔ |
6 |
export const pickUserMe = ( |
1✔ |
UNCOV
7
|
user: Pick< |
× |
UNCOV
8
|
Prisma.UserGetPayload<null>, |
× |
UNCOV
9
|
'id' | 'name' | 'avatar' | 'phone' | 'email' | 'password' | 'notifyMeta' |
× |
UNCOV
10
|
> |
× |
UNCOV
11
|
): IUserMeVo => { |
× |
UNCOV
12
|
return {
|
× |
UNCOV
13
|
...pick(user, 'id', 'name', 'phone', 'email'), |
× |
UNCOV
14
|
notifyMeta: typeof user.notifyMeta === 'object' ? user.notifyMeta : JSON.parse(user.notifyMeta), |
× |
UNCOV
15
|
avatar: |
× |
UNCOV
16
|
user.avatar && !user.avatar?.startsWith('http') |
× |
UNCOV
17
|
? getFullStorageUrl(user.avatar) |
× |
UNCOV
18
|
: user.avatar, |
× |
UNCOV
19
|
hasPassword: user.password !== null, |
× |
UNCOV
20
|
}; |
× |
UNCOV
21
|
}; |
× |