commonMain.com.funnysaltyfish.partialjsonparser.tokenizer.utils.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of partial-json-parser Show documentation
Show all versions of partial-json-parser Show documentation
Parse incomplete JSON (like what ChatGPT generates in stream mode) in Kotlin, obtain as much as possible information fastly.
package com.funnysaltyfish.partialjsonparser.tokenizer
import com.funnysaltyfish.partialjsonparser.ParseContext
/**
* import { ParseContext } from '../types';
*
* export function isEnd(context: ParseContext) {
* return context.index >= context.source.length;
* }
*
* export function isIndexEnd(context: ParseContext, index: number) {
* return index >= context.source.length;
* }
*
*/
internal fun isEnd(context: ParseContext): Boolean {
return context.index >= context.source.length
}
internal fun isIndexEnd(context: ParseContext, index: Int): Boolean {
return index >= context.source.length
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy