From dc77d8f25e8d9f198eb1135b01eb5b04dc9555ec Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Fri, 15 Mar 2019 17:20:20 +0200 Subject: [PATCH] chore: minor refactor --- src/components/Fields/Extensions.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Fields/Extensions.tsx b/src/components/Fields/Extensions.tsx index 27c03c68..5a450ce4 100644 --- a/src/components/Fields/Extensions.tsx +++ b/src/components/Fields/Extensions.tsx @@ -20,16 +20,17 @@ export interface ExtensionsProps { export class Extensions extends React.PureComponent { render() { + const exts = this.props.extensions; return ( {options => ( <> {options.showExtensions && - Object.keys(this.props.extensions).map(key => ( + Object.keys(exts).map(key => ( {key.substring(2)}: {' '} - {JSON.stringify(this.props.extensions[key]).replace(/(^")|("$)/g, '')} + {typeof exts[key] === 'string' ? exts[key] : JSON.stringify(exts[key])} ))}