mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 03:43:50 +00:00
chore: pnpm 11 + dependency cleanup (#2089)
* core: upgrade to pnpm 11 and nodejs to 22.22.2 * chore: allow builds * chore: remove unused * chore: update actions * chore: add stub for vitest * reafactor: small optimization
This commit is contained in:
committed by
GitHub
parent
d30d9cfd4e
commit
9ae49a7175
@@ -47,6 +47,11 @@ describe('getRouteFromPreset()', () => {
|
||||
expect(getRouteFromPreset(location, presets)).toStrictEqual('timer?user=guest&alias=demopage');
|
||||
});
|
||||
|
||||
it('returns null when already on a preset path', () => {
|
||||
const location = resolvePath('/preset/demopage');
|
||||
expect(getRouteFromPreset(location, presets)).toBeNull();
|
||||
});
|
||||
|
||||
it('returns null if the current location is the exact match of an unwrapped alias', () => {
|
||||
// we make the current location be the alias
|
||||
const location = resolvePath('/timer?user=guest&alias=demopage');
|
||||
|
||||
@@ -204,7 +204,7 @@ function isPresettableView(view: string): view is OntimeViewPresettable {
|
||||
/**
|
||||
* Check if current location is a preset path
|
||||
*/
|
||||
export function isPresetPath(location: Path): boolean {
|
||||
const segments = location.pathname.split('/').filter(Boolean);
|
||||
return segments[0] === 'preset';
|
||||
function isPresetPath(location: Path): boolean {
|
||||
const firstSegment = location.pathname.split('/').find(Boolean);
|
||||
return firstSegment === 'preset';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user