Download react-boilerplate/internals/generators/utils/componentExists.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 534 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-boilerplate/internals/generators/utils/componentExists.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-boilerplate/internals/generators/utils/componentExists.js
-
curl -L -o componentExists.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-boilerplate/internals/generators/utils/componentExists.js
534 Bytes
| /** | |
| * componentExists | |
| * | |
| * Check whether the given component exist in either the components or containers directory | |
| */ | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const pageComponents = fs.readdirSync( | |
| path.join(__dirname, '../../../app/components'), | |
| ); | |
| const pageContainers = fs.readdirSync( | |
| path.join(__dirname, '../../../app/containers'), | |
| ); | |
| const components = pageComponents.concat(pageContainers); | |
| function componentExists(comp) { | |
| return components.indexOf(comp) >= 0; | |
| } | |
| module.exports = componentExists; | |