UNPKG

@robinbobin/mimetype-constants

Version:

Extensible MIME constants with typescript support

9 lines (8 loc) 310 B
import { objectify } from 'radashi'; export function createTypeGroup(type, subtypeGroup) { const resultingSubtypeGroup = objectify(Object.entries(subtypeGroup), ([key]) => key, ([, value]) => `${type}/${value}`); const typeGroup = { [type]: resultingSubtypeGroup }; return typeGroup; }