refactor: replace variable by chaining

This commit is contained in:
Alexander Zeitler 2021-04-11 19:39:44 +02:00
parent 57f00b36fe
commit b487be048b

View file

@ -83,8 +83,7 @@ export const mapPorts = (
const result = !ports
? []
: (() => {
const allPorts = ports.split(',')
return allPorts.map((untypedPort) => {
return ports.split(',').map((untypedPort) => {
const exposedFragments = untypedPort.trim().split('->')
const [port, protocol] =
exposedFragments.length === 1