Sawtaytoes
1/12/2019 - 10:05 AM

Transducer `reduce` With Optimized `concat`

createExecutableObservable(
  from(
    itemsByLine
    .split('\n')
  )
)
.pipe(
  filter(Boolean),
  filter(item => (
    !(
      whitelist
      .includes(item)
    )
  )),
  reduce(
    (
      combined,
      item,
    ) => (
      combined
      .concat([
        `*${item}*`,
        `*.${item}.*`,
      ])
    ),
    [],
  )
)
.execute()