UNPKG

@foal/cli

Version:

CLI tool for FoalTS

10 lines (9 loc) 446 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getNames = getNames; function getNames(name) { const camelName = name.replace(/-([a-z])/gi, g => g[1].toUpperCase()); const kebabName = name.replace(/([a-z][A-Z])/g, g => `${g[0]}-${g[1].toLowerCase()}`); const upperFirstCamelName = camelName.charAt(0).toUpperCase() + camelName.slice(1); return { camelName, kebabName, upperFirstCamelName }; }