From 1e7d48d9839bd919b2e6bd33bb10d79757d91b1c Mon Sep 17 00:00:00 2001 From: Gert Hengeveld Date: Wed, 23 Jun 2021 12:52:37 +0200 Subject: [PATCH] Use argType.type.summary to map argTypes if we don't have argType.type.name --- lib/client-api/src/args.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/client-api/src/args.ts b/lib/client-api/src/args.ts index f09e3bf91910..cc4e4ea8a37c 100644 --- a/lib/client-api/src/args.ts +++ b/lib/client-api/src/args.ts @@ -3,13 +3,13 @@ import { once } from '@storybook/client-logger'; import isPlainObject from 'lodash/isPlainObject'; import dedent from 'ts-dedent'; -type ValueType = { name: string; value?: ObjectValueType | ValueType }; +type ValueType = { name?: string; summary?: string; value?: ObjectValueType | ValueType }; type ObjectValueType = Record; const INCOMPATIBLE = Symbol('incompatible'); const map = (arg: unknown, type: ValueType): any => { if (arg === undefined || arg === null || !type) return arg; - switch (type.name) { + switch (type.name || type.summary) { case 'string': return String(arg); case 'enum':