fromComponents static method
Builds an Isbn from its GS1 prefix (978 or 979) and nine-digit body, computing the
check digit, reporting the IsbnFailure when the parts don't form a valid ISBN.
Implementation
static ParseOutcome<IsbnFailure, Isbn> fromComponents({
required Digits prefix,
required Digits body,
}) {
final assembledIsbn = _withCheckDigit('${prefix.asString}${body.asString}');
final failure = _failureFor(assembledIsbn);
return failure != null ? ParseFailure(failure) : ParseSuccess(._(assembledIsbn));
}