1
import * as Rsg from 'react-styleguidist'
2
import { SanitizedStyleguidistConfig } from '../../types/StyleGuide'
3 1
import processComponent from './processComponent'
4

5
/**
6
 * Process each component in a list.
7
 *
8
 * @param {Array} components File names of components.
9
 * @param {object} config
10
 * @returns {object|null}
11
 */
12 1
export default function getComponents(
13
	components: string[],
14
	config: SanitizedStyleguidistConfig,
15 1
	subComponentsPaths?: Record<string, string[]>
16
): Rsg.LoaderComponent[] {
17 1
	return components.map(filepath =>
18 1
		processComponent(
19
			filepath,
20
			config,
21 1
			subComponentsPaths ? subComponentsPaths[filepath] : undefined
22
		)
23
	)
24
}

Read our documentation on viewing source code .

Loading