import chalk from 'chalk'; import { readVariableValue } from './variablesHelper'; export function entityFound( entityType: string, entityId: string, entityName: string, filePath: string, ) { // 1. Upper case the words, e.g: 'sales orders' => 'Sales Orders' entityType = entityType.replace(/\b\w/g, (l) => l.toUpperCase()); filePath = `file://${filePath}`; console.log(`${chalk.green('✓')} ${entityType} found: ${chalk.green(readVariableValue(entityName))} in ${chalk.gray.underline(filePath)}`); } export function showFile( type: 'error' | 'success' | 'warning', filePath: string, ) { const color = type === 'error' ? chalk.red : type === 'warning' ? chalk.yellow : chalk.green; filePath = `file://${filePath}`; return color.underline(filePath); }