wrapAlways method

$Value wrapAlways(
  1. dynamic value, {
  2. bool recursive = false,
})

Attempt to wrap a Dart value into a $Value, falling back to wrapping in an $Object

Implementation

$Value wrapAlways(dynamic value, {bool recursive = false}) {
  try {
    return wrap(value, recursive: recursive);
  } catch (e) {
    return $Object(value);
  }
}