KScript docs
EN

Built-in API gaps

Collections and text

Proposed API Today Gap
list->flat_map(fn) ->map(fn)->flatten() Flatten exactly one level with a single operation and define how it handles typed lists.
list->partition(fn) ->filter(fn) and ->reject(fn) Split into matching and remaining lists with one predicate call per item.
map->pick(keys), map->omit(keys) ->filter(fn); list ->pluck(keys) projects fields from each item. Project or drop a set of keys from a single map. Useful for view data and request payloads.
map->deep_merge(other) ->merge(other) combines top-level keys. Merge nested config while documenting array replacement, null values, and key precedence.
string->normalize_unicode(form?) @slugify() produces a slug. Case and whitespace normalization are separate operations. Normalize equivalent Unicode spellings without changing case, dropping accents, or generating a slug.

Edit this page on GitHub