Script.mapLines constructor
Creates a Script from a function that maps strings to strings.
This script passes each line of stdin to mapper
and emits the result via
stdout.
Implementation
factory Script.mapLines(String Function(String line) mapper,
{String? name}) =>
Script.fromLineTransformer(
StreamTransformer.fromBind((stream) => stream.map(mapper)),
name: name ?? mapper.toString());