Language.deserialize constructor

Language.deserialize(
  1. CborObject cbor
)

Implementation

factory Language.deserialize(CborObject cbor) {
  if (cbor is CborBytesValue) {
    final decodingView = CborObject.fromCbor(cbor.value)
        .cast<CborIntValue>("Invalid language view encoding cbor bytes.");
    return fromValue(decodingView.value);
  }
  return fromValue(
      cbor.cast<CborIntValue>("Invalid language cbor bytes.").value);
}