mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 15:25:46 +00:00
17ea96dcdb
The offline move collapsed a single-module mock into a `@/features/offline` barrel mock, which shadowed the real `useOfflineBrowseContext` the test relied on. Mock the reload-token submodule directly so the barrel re-exports the stub while the sibling context hook stays live.
12 lines
423 B
TypeScript
12 lines
423 B
TypeScript
import type { SubsonicOpenArtistRef } from '../api/subsonicTypes';
|
|
|
|
/** Subsonic JSON may return one ref object instead of a one-element array. */
|
|
export function coerceOpenArtistRefs(
|
|
refs: SubsonicOpenArtistRef[] | SubsonicOpenArtistRef | undefined | null,
|
|
): SubsonicOpenArtistRef[] {
|
|
if (refs == null) return [];
|
|
if (Array.isArray(refs)) return refs;
|
|
if (typeof refs === 'object') return [refs];
|
|
return [];
|
|
}
|