UNPKG

object-hierarchy-access

Version:

Get/Set value from/to JS object hierarchy properties

15 lines (14 loc) 285 B
function normalizeDescriptor(info) { if (typeof info === 'object' && info !== null) { return info; } else if (typeof info === 'function') { return { by: info }; } else { return {}; } } export { normalizeDescriptor };