UNPKG

sound-manager

Version:
13 lines (10 loc) 240 B
import { ICollection, } from '../interfaces/ICollection'; export function getOne<T extends {}>(name: string, items: ICollection<T>): T { const item = items[name]; if (!item) { throw new Error(); } return item; }