Browse Source

fix: replace double slashes with single slashes

pull/5137/head
Arman Ozak 6 years ago
parent
commit
c0aa4720bc
  1. 6
      npm/ng-packs/packages/schematics/src/utils/path.ts

6
npm/ng-packs/packages/schematics/src/utils/path.ts

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

Loading…
Cancel
Save