wrap method

String? wrap(
  1. String? value, {
  2. bool forScript = false,
})

Wraps value with the escape value for this code, followed by resetAll.

If forScript is true, the return value is an unescaped literal. The value of ansiOutputEnabled is also ignored.

Returns value unchanged if

Implementation

String? wrap(String? value, {bool forScript = false}) =>
    _isNoop(type == AnsiCodeType.reset, value, forScript)
        ? value
        : '${_escapeValue(forScript: forScript)}$value'
            '${reset!._escapeValue(forScript: forScript)}';