UNPKG

react-hotkeys

Version:

A declarative library for handling hotkeys and focus within a React application

11 lines (10 loc) 289 B
function dictionaryFrom(array) { var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; return array.reduce(function (memo, element) { memo[element] = value || { value: element }; return memo; }, {}); } export default dictionaryFrom;