From ade68bbd5b9e36c36ee68c6c65a435a480b9b7b6 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Sat, 22 Sep 2018 10:45:25 -0400 Subject: [PATCH] fix: add runtime to deps --- examples/Api.js | 16 +++++++++++++--- package.json | 2 ++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/examples/Api.js b/examples/Api.js index dad4644e6..24f433ce0 100644 --- a/examples/Api.js +++ b/examples/Api.js @@ -117,8 +117,7 @@ class Api extends React.Component { return i === list.length - 1 ? current : current.concat(' | ') }, []) - case 'array': - case 'Array': { + case 'array': { let child = this.renderType({ type: type.value }) return ( @@ -140,7 +139,18 @@ class Api extends React.Component { renderEnum(enumType) { const enumValues = enumType.value || [] - return {enumValues.join(' | ')} + if (!Array.isArray(enumValues)) return enumValues + + const renderedEnumValues = [] + enumValues.forEach(({ value }, i) => { + if (i > 0) { + renderedEnumValues.push( | ) + } + + renderedEnumValues.push({value}) + }) + + return {renderedEnumValues} } renderControllableNote(prop, propName) { diff --git a/package.json b/package.json index 3b049451b..0f1eb5c65 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,8 @@ "webpack-dev-server": "^3.1.8" }, "dependencies": { + "@babel/cli": "^7.1.0", + "@babel/runtime": "^7.0.0", "classnames": "^2.2.6", "date-arithmetic": "^3.0.0", "dom-helpers": "^2.3.0 || ^3.0.0",