Download spectrum/src/helpers/get-thread-link.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 393 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/src/helpers/get-thread-link.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/src/helpers/get-thread-link.js
-
curl -L -o get-thread-link.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/src/helpers/get-thread-link.js
393 Bytes
| // @flow | |
| import slugg from 'slugg'; | |
| import type { ThreadInfoType } from 'shared/graphql/fragments/thread/threadInfo'; | |
| const getThreadLink = (thread: ThreadInfoType) => { | |
| if (!thread.community || !thread.channel) return `/thread/${thread.id}`; | |
| return `/${thread.community.slug}/${thread.channel.slug}/${slugg( | |
| thread.content.title | |
| )}~${thread.id}`; | |
| }; | |
| export default getThreadLink; | |