UNPKG

object-hierarchy-access

Version:

Get/Set value from/to JS object hierarchy properties

22 lines (19 loc) 385 B
import {ISetupPropDescriptor, SetupPropParam} from '../type'; function normalizeDescriptor(info: SetupPropParam): ISetupPropDescriptor { if (typeof info === 'object' && info !== null) { return info; } else if (typeof info === 'function') { return { getName: info, value: {} }; } else { return { name: info, value: {} }; } } export { normalizeDescriptor };