Skip to content

Commit 12c598c

Browse files
committed
use kaccelero json
1 parent 67f54a9 commit 12c598c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

nextjs/src/commonMain/kotlin/dev/kdriver/nextjs/DefaultCapturedPushes.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dev.kdriver.nextjs
22

3+
import dev.kaccelero.serializers.Serialization
34
import dev.kdriver.cdp.domain.page
45
import dev.kdriver.core.tab.ReadyState
56
import dev.kdriver.core.tab.Tab
@@ -43,7 +44,7 @@ class DefaultCapturedPushes(private val tab: Tab) : CapturedPushes {
4344
override suspend fun fetchAll(): List<JsonElement> {
4445
runCatching { tab.waitForReadyState(ReadyState.COMPLETE) }
4546
val raw = tab.evaluate<String>("JSON.stringify(window.__capturedNextF)") ?: "[]"
46-
val jsonArray = Json.parseToJsonElement(raw).jsonArray
47+
val jsonArray = Serialization.json.parseToJsonElement(raw).jsonArray
4748
val results = mutableListOf<JsonElement>()
4849
for (push in jsonArray) {
4950
var args = push.jsonArray
@@ -54,7 +55,7 @@ class DefaultCapturedPushes(private val tab: Tab) : CapturedPushes {
5455
val objects = extractJsonObjects(payload)
5556
for (obj in objects) {
5657
try {
57-
results += Json.parseToJsonElement(obj)
58+
results += Serialization.json.parseToJsonElement(obj)
5859
} catch (_: Exception) {
5960
}
6061
}

0 commit comments

Comments
 (0)