1 | import mapValues from 'lodash/mapValues';
|
2 | import { combineParameters } from './parameters';
|
3 | export const ensureArgTypes = context => {
|
4 | const {
|
5 | argTypes: userArgTypes = {},
|
6 | args = {}
|
7 | } = context.parameters;
|
8 | if (!args) return userArgTypes;
|
9 | const argTypes = mapValues(args, (_arg, name) => ({
|
10 | name
|
11 | }));
|
12 | return combineParameters(argTypes, userArgTypes);
|
13 | }; |
\ | No newline at end of file |