File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
app/src/main/java/moe/matsuri/nb4a/utils Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,20 @@ object Util {
122
122
val currentMap = (to[k] as Map <* , * >).toMutableMap()
123
123
currentMap + = v
124
124
to[k] = currentMap
125
+ } else if (v is List <* >) {
126
+ if (k.startsWith(" +" )) { // prepend
127
+ val dstKey = k.removePrefix(" +" )
128
+ var currentList = (to[dstKey] as List <* >).toMutableList()
129
+ currentList = (v + currentList).toMutableList()
130
+ to[dstKey] = currentList
131
+ } else if (k.endsWith(" +" )) { // append
132
+ val dstKey = k.removeSuffix(" +" )
133
+ var currentList = (to[dstKey] as List <* >).toMutableList()
134
+ currentList = (currentList + v).toMutableList()
135
+ to[dstKey] = currentList
136
+ } else {
137
+ to[k] = v
138
+ }
125
139
} else {
126
140
to[k] = v
127
141
}
You can’t perform that action at this time.
0 commit comments