EndemolShineGroup/generator-nodejs-ts

View on GitHub
src/lib/replaceTemplatePrefix.ts

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * Replaces a file name prefixed with `_` to a provided replacement, or `.` by
 * default
 * @param fileName
 * @param replacement
 */
export default (fileName: string, replacement: string = '.'): string => {
  return fileName.replace(/^_|\b_/g, replacement);
};