unpack method

LuaObject? unpack()

Tries to unpack a list of values into a single value. If this is LuaObject returns itself. If this is LuaArgPack use the method. If this is anything else, convert to a lua object.

Implementation

LuaObject? unpack() => switch (this) {
  final LuaObject obj => obj,
  final LuaArgPack p => p.unpack(),
  final Object o => o.toLua('arg'),
};