$
This commit is contained in:
23
node_modules/riot/esm/core/create-children-components-object.js
generated
vendored
Normal file
23
node_modules/riot/esm/core/create-children-components-object.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
import { callOrAssign, camelToDashCase } from '@riotjs/util';
|
||||
import { createComponentFromWrapper } from './create-component-from-wrapper.js';
|
||||
|
||||
/**
|
||||
* Create the subcomponents that can be included inside a tag in runtime
|
||||
* @param {Object} components - components imported in runtime
|
||||
* @returns {Object} all the components transformed into Riot.Component factory functions
|
||||
*/
|
||||
|
||||
function createChildrenComponentsObject(components) {
|
||||
if (components === void 0) {
|
||||
components = {};
|
||||
}
|
||||
|
||||
return Object.entries(callOrAssign(components)).reduce((acc, _ref) => {
|
||||
let [key, value] = _ref;
|
||||
acc[camelToDashCase(key)] = createComponentFromWrapper(value);
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
|
||||
export { createChildrenComponentsObject };
|
Reference in New Issue
Block a user