toIdValue function

Identifier toIdValue(
  1. Object? data
)

Converts data to Identifier or throws FormatException if cannot convert.

Implementation

Identifier toIdValue(Object? data) {
  if (data == null) throw const NullValueException();
  if (data is Identifier) {
    return data;
  } else {
    return Identifier.from(data);
  }
}