[F] Fix json

This commit is contained in:
Azalea
2025-03-11 02:48:31 -04:00
parent 6252cbbefe
commit 5375c3c1fa
16 changed files with 137 additions and 276 deletions

View File

@@ -30,7 +30,7 @@ typealias PagePost = (MutJDict) -> Unit
data class PagedProcessor(val add: JDict?, val fn: PagedHandler, var post: PagePost? = null)
// A very :3 way of declaring APIs
abstract class MeowApi(val serialize: (String, Any?) -> String) {
abstract class MeowApi(val serialize: (String, Any) -> String) {
val initH = mutableMapOf<String, SpecialHandler>()
infix operator fun String.invoke(fn: SpecialHandler) = initH.set("${this}Api", fn)
infix fun String.static(fn: () -> Any) = serialize(this, fn()).let { resp -> this { resp } }