$
This commit is contained in:
19
node_modules/riot/esm/core/compute-initial-props.js
generated
vendored
Normal file
19
node_modules/riot/esm/core/compute-initial-props.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/* 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 };
|
Reference in New Issue
Block a user