parcoursup/node_modules/riot/esm/core/compute-initial-props.js
lalBi94 7bc56c09b5 $
2023-03-05 13:23:23 +01:00

20 lines
605 B
JavaScript

/* Riot WIP, @license MIT */
import { DOMattributesToObject, callOrAssign } from '@riotjs/util';
/**
* Evaluate the component properties either from its real attributes or from its initial user properties
* @param {HTMLElement} element - component root
* @param {Object} initialProps - initial props
* @returns {Object} component props key value pairs
*/
function computeInitialProps(element, initialProps) {
if (initialProps === void 0) {
initialProps = {};
}
return Object.assign({}, DOMattributesToObject(element), callOrAssign(initialProps));
}
export { computeInitialProps };