Download next.js/turbopack/packages/devlow-bench/src/interfaces/interactive.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/turbopack/packages/devlow-bench/src/interfaces/interactive.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/turbopack/packages/devlow-bench/src/interfaces/interactive.ts
-
curl -L -o interactive.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/turbopack/packages/devlow-bench/src/interfaces/interactive.ts
1.2 kB
| import { Interface } from '../index.js' | |
| import inquirer from 'inquirer' | |
| import { formatVariant } from '../utils.js' | |
| export default function createInterface(): Interface { | |
| const iface: Interface = { | |
| filterScenarios: async (scenarios) => { | |
| if (scenarios.length === 1) { | |
| return scenarios | |
| } | |
| let answer = await inquirer.prompt({ | |
| type: 'checkbox', | |
| name: 'scenarios', | |
| default: scenarios.slice(), | |
| message: 'Choose scenarios to run', | |
| choices: scenarios.map((scenario) => ({ | |
| name: scenario.name, | |
| value: scenario, | |
| })), | |
| }) | |
| return answer.scenarios | |
| }, | |
| filterScenarioVariants: async (variants) => { | |
| if (variants.length === 1) { | |
| return variants | |
| } | |
| let answer = await inquirer.prompt({ | |
| type: 'checkbox', | |
| name: 'variants', | |
| default: variants.slice(), | |
| message: 'Choose variants to run', | |
| choices: variants.map((variant) => { | |
| return { | |
| name: formatVariant(variant.scenario.name, variant.props), | |
| value: variant, | |
| } | |
| }), | |
| }) | |
| return answer.variants | |
| }, | |
| } | |
| return iface | |
| } | |