generator-begcode
Version:
Spring Boot + Angular/React/Vue in one handy generator
13 lines (12 loc) • 449 B
JavaScript
import path from 'path';
import { upperFirst } from '../utils/string-utils.js';
import { readFile } from './file-reader.js';
export function readJSONFile(filePath) {
return JSON.parse(readFile(filePath));
}
export function toFilePath(entityName) {
if (!entityName) {
throw new Error('The passed entity name must not be nil to be converted to file path.');
}
return path.join('.jhipster', `${upperFirst(entityName)}.json`);
}