diff --git a/src/helpers/parse.ts b/src/helpers/parse.ts index be9fe0f..744ff71 100644 --- a/src/helpers/parse.ts +++ b/src/helpers/parse.ts @@ -1,7 +1,7 @@ import { Task } from '../definitions'; import { constants } from '../constants'; import { series } from '../tasks/aggregate/series'; -import { stringifyRoute } from './stringify-route'; +import { stringifyKeyRoute } from './stringify-route'; import { Members, TypeGuard } from 'type-core'; interface Item { @@ -56,7 +56,7 @@ export function parseToArray( return parseHelper(record, options.roots) .map(([route, task]) => { - const name = stringifyRoute(route); + const name = stringifyKeyRoute(route); if (names.includes(name)) { throw Error(`Task name collusion on parse: ${name}`); diff --git a/src/helpers/prefix.ts b/src/helpers/prefix.ts index 4ca879e..d094d07 100644 --- a/src/helpers/prefix.ts +++ b/src/helpers/prefix.ts @@ -1,6 +1,6 @@ import { Context } from '../definitions'; import { styleString } from './style-string'; -import { stringifyRoute } from './stringify-route'; +import { stringifyPrintRoute } from './stringify-route'; import { into } from 'pipettes'; import { TypeGuard } from 'type-core'; @@ -11,7 +11,7 @@ export function getPrefix( ): string { return into( { - prefix: context.route.length ? stringifyRoute(context.route) : '', + prefix: context.route.length ? stringifyPrintRoute(context.route) : '', policy: TypeGuard.isString(context.prefix) ? context.prefix : context.prefix diff --git a/src/helpers/stringify-route.ts b/src/helpers/stringify-route.ts index a855ec9..6ef9dd5 100644 --- a/src/helpers/stringify-route.ts +++ b/src/helpers/stringify-route.ts @@ -1,3 +1,9 @@ -export function stringifyRoute(route: string[]): string { +import { constants } from '../constants'; + +export function stringifyPrintRoute(route: string[]): string { + return route.filter((str) => str !== constants.record.default).join(':'); +} + +export function stringifyKeyRoute(route: string[]): string { return route.join(':'); }