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 result = !ports
? [] ? []
: (() => { : (() => {
const allPorts = ports.split(',') return ports.split(',').map((untypedPort) => {
return allPorts.map((untypedPort) => {
const exposedFragments = untypedPort.trim().split('->') const exposedFragments = untypedPort.trim().split('->')
const [port, protocol] = const [port, protocol] =
exposedFragments.length === 1 exposedFragments.length === 1