wrap method
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
value
isnull
or empty- both ansiOutputEnabled and
forScript
arefalse
. - type is AnsiCodeType.reset
Implementation
String? wrap(String? value, {bool forScript = false}) =>
_isNoop(type == AnsiCodeType.reset, value, forScript)
? value
: '${_escapeValue(forScript: forScript)}$value'
'${reset!._escapeValue(forScript: forScript)}';