Package-level declarations

Types

Link copied to clipboard

A window over a range of another CharSequence that shares its characters instead of copying them. The view is only materialized by toString.

Link copied to clipboard
expect class ConcurrentCache<K : Any, V : Any>

A map that associates each key with at most one value, safe under the platform's concurrency model: concurrent getOrPut calls for the same key always return the same instance, making it safe to store mutable values.

actual class ConcurrentCache<K : Any, V : Any>
Link copied to clipboard
expect class ConcurrentQueue<T : Any>

A FIFO queue, safe to fill from concurrent producers under the platform's concurrency model.

actual class ConcurrentQueue<T : Any>
Link copied to clipboard
object Escape

Utilities for escaping and unescaping strings for various targets.

Link copied to clipboard
sealed interface EscapeTarget

Represents a target (commonly a language or format) that strings can be escaped for.

Link copied to clipboard
object IOUtils

Utility methods for file-based operations.

Link copied to clipboard

Formatter of integers as Roman numerals.

Link copied to clipboard
class ScopedCounter(maxDepth: Int, onOverflow: () -> Nothing)

A thread-safe counter that tracks a depth value within nested scopes.

Link copied to clipboard
sealed interface StringCase

A general purpose strategy to transform a string to a specific case type.

Link copied to clipboard
sealed interface UnescapeTarget

Represents a target (commonly a language or format) that strings can be unescaped from.

Properties

Link copied to clipboard

Whether this string is a valid URL.

Link copied to clipboard

Name of the enum in kebab-case. Example: TOP_LEFT_CORNER ->top-left-corner

Functions

Link copied to clipboard

Transforms this string to a specific case.

Link copied to clipboard
expect fun <K : Any, V : Any> concurrentMapOf(): MutableMap<K, V>
actual fun <K : Any, V : Any> concurrentMapOf(): MutableMap<K, V>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Indents each line of this string by indent.

Link copied to clipboard
fun <T> Sequence<T>.iterator(consumeAmount: Int): Iterator<T>
Link copied to clipboard
expect fun <T, R> List<T>.mapParallel(minItems: Int = DEFAULT_MIN_ITEMS_FOR_PARALLELISM, transform: (T) -> R): List<R>

Maps each element of this list using transform, executing transformations in parallel when the platform supports it and the list is large enough to benefit from concurrency. Results are returned in the same order as the input list.

actual fun <T, R> List<T>.mapParallel(minItems: Int, transform: (T) -> R): List<R>

Uses java.util.stream.Stream.parallel with the common java.util.concurrent.ForkJoinPool, which handles nested parallelism via work-stealing without risking deadlocks.

Link copied to clipboard
fun IntRange.offset(offset: Int): IntRange

Returns a new IntRange with the specified offset added to both the start and end of the range.

Link copied to clipboard
fun String.removeOptionalPrefix(prefix: String, ignoreCase: Boolean = false): Pair<String, Boolean>
Link copied to clipboard
fun StringBuilder.replace(oldValue: String, newValue: String): StringBuilder

An optimized way to replace all occurrences of oldValue with newValue in a StringBuilder.

Link copied to clipboard

Sanitizes this string for use as a stable, anchor-like identifier:

Link copied to clipboard
Link copied to clipboard

Strips the anchor (fragment) from a URL string.

Link copied to clipboard
fun CharSequence.substringWithinBounds(startIndex: Int, endIndex: Int): String
Link copied to clipboard
fun CharSequence.takeLines(count: Int, addOmittedLinesSuffix: Boolean): String
Link copied to clipboard
Link copied to clipboard

Converts this string to a URI-like identifier:

Link copied to clipboard
fun String.toUrlOrNull(): Url?
Link copied to clipboard
Link copied to clipboard

Discards blank entries and trims each remaining entry.

Link copied to clipboard
fun CharSequence.view(start: Int, end: Int = length): CharSequence
Link copied to clipboard
expect inline fun <R> withLock(lock: Any, block: () -> R): R

Runs block while holding lock, so that concurrent callers on the same lock run one at a time under the platform's concurrency model.

actual inline fun <R> withLock(lock: Any, block: () -> R): R