chooseCloneNaming static method
Picks a Naming for a clone based on its original conditions and optionally provided new conditions.
Implementation
static Naming chooseCloneNaming({
required String originalName,
required String? newName,
required Naming originalNaming,
required Naming? newNaming,
}) {
if (newNaming != null) {
// if provided, then use that
return newNaming;
}
if (newName == null && newNaming == null) {
// if not provided, we can default to mergeable, since we clone the old
// name and don't necessarily need the duplicate around
return Naming.mergeable;
}
// otherwise, use default
return Naming.chooseNaming(newName, newNaming);
}