Download spectrum/api/models/curatedContent.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 469 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/models/curatedContent.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/api/models/curatedContent.js
-
curl -L -o curatedContent.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/models/curatedContent.js
469 Bytes
| //@flow | |
| const { db } = require('shared/db'); | |
| import type { DBCommunity } from 'shared/types'; | |
| import { getCommunitiesBySlug } from './community'; | |
| // prettier-ignore | |
| export const getCuratedCommunities = (type: string): Promise<Array<DBCommunity>> => { | |
| return db | |
| .table('curatedContent') | |
| .filter({ type }) | |
| .run() | |
| .then(results => (results && results.length > 0 ? results[0] : null)) | |
| .then(result => result && getCommunitiesBySlug(result.data)); | |
| }; | |