Build(deps-dev): bump prettier from 1.18.2 to 1.19.1 (#4328)

* Build(deps-dev): bump prettier from 1.18.2 to 1.19.1

Bumps [prettier](https://github.com/prettier/prettier) from 1.18.2 to 1.19.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/1.18.2...1.19.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Build(deps-dev): bump prettier from 1.18.2 to 1.19.1

Bumps [prettier](https://github.com/prettier/prettier) from 1.18.2 to 1.19.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/1.18.2...1.19.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore: apply new prettier formatting

* chore: try prettier, again
This commit is contained in:
dependabot-preview[bot]
2019-11-15 19:33:40 -06:00
committed by Caleb Cartwright
parent 3028608f4c
commit 0f332413df
13 changed files with 71 additions and 57 deletions

View File

@@ -130,13 +130,10 @@ export default function PathBuilder({
tokens
.filter(t => typeof t !== 'string')
.map(t => t as Key)
.reduce(
(accum, { name }) => {
accum[name] = ''
return accum
},
{} as { [k: string]: string }
)
.reduce((accum, { name }) => {
accum[name] = ''
return accum
}, {} as { [k: string]: string })
)
useEffect(() => {

View File

@@ -241,33 +241,27 @@ export default function QueryStringBuilder({
const [queryParams, setQueryParams] = useState(() =>
// For each of the custom query params defined in `exampleParams`,
// create empty values in `queryParams`.
Object.entries(exampleParams).reduce(
(accum, [name, value]) => {
// Custom query params are either string or boolean. Inspect the example
// value to infer which one, and set empty values accordingly.
// Throughout the component, these two types are supported in the same
// manner: by inspecting this value type.
const isStringParam = typeof value === 'string'
accum[name] = isStringParam ? '' : true
return accum
},
{} as { [k: string]: string | boolean }
)
Object.entries(exampleParams).reduce((accum, [name, value]) => {
// Custom query params are either string or boolean. Inspect the example
// value to infer which one, and set empty values accordingly.
// Throughout the component, these two types are supported in the same
// manner: by inspecting this value type.
const isStringParam = typeof value === 'string'
accum[name] = isStringParam ? '' : true
return accum
}, {} as { [k: string]: string | boolean })
)
// For each of the standard badge options, create empty values in
// `badgeOptions`. When `initialStyle` has been provided, use it.
const [badgeOptions, setBadgeOptions] = useState(() =>
supportedBadgeOptions.reduce(
(accum, { name }) => {
if (name === 'style') {
accum[name] = initialStyle
} else {
accum[name] = ''
}
return accum
},
{} as Record<BadgeOptionName, string>
)
supportedBadgeOptions.reduce((accum, { name }) => {
if (name === 'style') {
accum[name] = initialStyle
} else {
accum[name] = ''
}
return accum
}, {} as Record<BadgeOptionName, string>)
)
function handleServiceQueryParamChange({

View File

@@ -99,13 +99,10 @@ export default function Main({ pageContext }: { pageContext: PageContext }) {
category: Category
definitions: ServiceDefinition[]
}) {
const flattened = definitions.reduce(
(accum, current) => {
const { examples } = current
return accum.concat(examples)
},
[] as Example[]
)
const flattened = definitions.reduce((accum, current) => {
const { examples } = current
return accum.concat(examples)
}, [] as Example[])
return (
<div>