UNPKG

constatic

Version:

Constatic is a CLI for creating and managing modern TypeScript projects, providing an organized structure and features that streamline development.

27 lines (26 loc) 582 B
// src/menus/main/presets/scripts/actions/format.ts import { commonTexts } from "#helpers"; import ck from "chalk"; function formatPresets(presets, withoutback) { const formated = presets.map(({ id, name }) => ({ name: ck.blue(`\uD83D\uDDD0 ${name}`), value: id })); if (!withoutback) { formated.unshift({ name: commonTexts.back, value: "back" }); } return formated; } function formatPresetFiles(files) { return files.map(({ path, dist = path }) => ({ name: path, value: dist })); } export { formatPresets, formatPresetFiles };