Download spectrum/api/queries/communityMember/roles.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 363 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/queries/communityMember/roles.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/api/queries/communityMember/roles.js
-
curl -L -o roles.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/queries/communityMember/roles.js
363 Bytes
| // @flow | |
| import type { DBUsersCommunities } from 'shared/types'; | |
| export default ({ | |
| isModerator, | |
| isOwner, | |
| isBlocked, | |
| isPending, | |
| }: DBUsersCommunities) => { | |
| const roles = []; | |
| if (isModerator) roles.push('moderator'); | |
| if (isOwner) roles.push('admin'); | |
| if (isBlocked) roles.push('blocked'); | |
| if (isPending) roles.push('pending'); | |
| return roles; | |
| }; | |