|
|
|
@ -2,8 +2,8 @@ import { dir, kebab } from './text';
|
|
|
|
|
|
|
|
|
|
export function relativePathToEnum(namespace: string, enumNamespace: string, enumName: string) {
|
|
|
|
|
const repeats = namespace ? namespace.split('.').length : 0;
|
|
|
|
|
const path = '..' + '/..'.repeat(repeats) + '/enums/' + dir(enumNamespace) + kebab(enumName);
|
|
|
|
|
return removeDoubleSlash(path);
|
|
|
|
|
const path = '..' + '/..'.repeat(repeats) + '/enums/' + dir(enumNamespace);
|
|
|
|
|
return removeDoubleSlash(path + '/' + kebab(enumName));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function relativePathToModel(namespace: string, modelNamespace: string) {
|
|
|
|
@ -13,7 +13,7 @@ export function relativePathToModel(namespace: string, modelNamespace: string) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function removeDoubleSlash(path: string) {
|
|
|
|
|
return path.replace(/\/{2,}/g, '');
|
|
|
|
|
return path.replace(/\/{2,}/g, '/');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function removeTrailingSlash(path: string) {
|
|
|
|
|