1 2 3 4 5 6 7 8 9 10 11 | 14x 65x 65x 65x | export default function configure(element, userOptions, defaultOptions) { return Object.keys(defaultOptions).reduce((options, key) => { const attrValue = element.getAttribute(`data-${key.toLowerCase()}`); // eslint-disable-next-line no-param-reassign options[key] = attrValue || userOptions[key] || defaultOptions[key]; return options; }, {}); } |