/* * SPDX-FileCopyrightText: 2023 Linnea Gräf * * SPDX-License-Identifier: GPL-3.0-or-later */ package moe.nea.firmament.util import kotlin.properties.ReadOnlyProperty fun ReadOnlyProperty.map(mapper: (V) -> M): ReadOnlyProperty { return ReadOnlyProperty { thisRef, property -> mapper(this@map.getValue(thisRef, property)) } }