UNPKG

rimmel

Version:

A Stream-Oriented UI library for the Rx.Observable Universe

20 lines (18 loc) 607 B
/** * Get the value of an <input> element matching its type: * boolean, number, date or string, * or innerText if it's any other [contenteditable] element **/ const autoValue = (input) => input.type == 'checkbox' ? input.checked : input.type == "number" ? input.valueAsNumber : input.type == "date" ? input.valueAsDate : input.tagName == 'INPUT' ? input.value : input.tagName == 'SELECT' ? input.value : input.innerText; export { autoValue }; //# sourceMappingURL=auto-value.js.map