37 lines
840 B
JavaScript
37 lines
840 B
JavaScript
import * as constant from './constants';
|
|
|
|
const FACTORY = 'Factory';
|
|
const SERVICE = 'Service';
|
|
|
|
export function getName(name) {
|
|
return constant.PREFIX + toUpperCamelCase(name);
|
|
}
|
|
|
|
export function toUpperCamelCase(stringToConvert) {
|
|
return stringToConvert.substr(0, 1).toUpperCase() + stringToConvert.substr(1);
|
|
}
|
|
|
|
export function getFactoryName(name) {
|
|
return getName(name) + FACTORY;
|
|
}
|
|
|
|
export function getServiceName(name) {
|
|
return getName(name) + SERVICE;
|
|
}
|
|
|
|
export function getModuleName(name) {
|
|
return constant.PREFIX + name;
|
|
}
|
|
|
|
export function getProviderNameFromConfig(name) {
|
|
return getName(name) + 'Provider';
|
|
}
|
|
|
|
export function getProviderName(name) {
|
|
return getName(name);
|
|
}
|
|
|
|
export function getTemplateName(componentName, frameworkName) {
|
|
return componentName + '.' + frameworkName + '.html';
|
|
}
|