UNPKG

703 Btext/x-handlebars-templateView Raw
1/**
2 * Index module for the directory.
3 * This is an auto-generated file and DO NOT edit manually.
4 * @module Index
5 *
6 * Generated by {{generator}}, from a template provided by {{pkg.name}}.
7 *
8 * @see https://facebook.github.io/react/
9 */
10
11"use strict";
12
13{{#each params.modules}}
14import {{name}} from './{{filename}}';
15{{/each}}
16
17/** @lends Index */
18const Index = {
19{{#each params.modules}} {{name}}{{#if @last}}{{else}},{{/if}}
20{{/each}}
21};
22
23/** Dynamic resolver */
24function resolve(name) {
25 if(!name){
26 return;
27 }
28 if (Index[name]) {
29 return Index[name];
30 } else {
31 throw new Error(`Unknown name: ${name}`);
32 }
33}
34
35export default Object.assign(resolve, Index);
36
\No newline at end of file