diff --git a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/names/Name.kt b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/names/Name.kt index 6896437f..160ea3a1 100644 --- a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/names/Name.kt +++ b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/names/Name.kt @@ -134,6 +134,11 @@ public val Name.length: Int get() = tokens.size */ public fun Name.lastOrNull(): NameToken? = tokens.lastOrNull() +/** + * Last token or throw exception + */ +public fun Name.last(): NameToken = tokens.last() + /** * First token of the name or null if it is empty */