Skip to content

containsRoutePrefix

Checks whether the current route name starts with a prefix. This is useful for grouping route names by feature area, such as settings.profile and settings.security.

Importing

ts
import { containsRoutePrefix } from '@almighty-shogun/vue-utils'

Usage

ts
import { containsRoutePrefix } from '@almighty-shogun/vue-utils'

const isSettingsPage = containsRoutePrefix('settings.');

Parameters

NameTypeDescription
prefixstringRoute name prefix.

Returns

true when the current route name starts with prefix.

Type signature

ts
declare function containsRoutePrefix(prefix: string): boolean;

All packages are released under the MIT License.