UNPKG

object-hierarchy-access

Version:

Get/Set value from/to JS object hierarchy properties

18 lines (15 loc) 319 B
import {GroupParam, IGroupDescriptor} from '../type'; function normalizeDescriptor(info: GroupParam): IGroupDescriptor { if (typeof info === 'object' && info !== null) { return info; } else if (typeof info === 'function') { return { by: info }; } else { return {}; } } export { normalizeDescriptor };