-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Is your feature request related to a problem? Please describe.
In some workflows, we need to extract parts of a string based on a known delimiter. For example, given "dev:data", I often want to extract the "data" part.
I could use something like keep.split("dev:data", ":")[1]
Describe the solution you’d like
Introduce a safe utility function such as:
keep.splitPart(str, delimiter, index, defaultValue?)
This would return the part at the given index if it exists, and fall back to an optional default value (or an empty string/null) if it doesn’t.
For example:
keep.splitPart("development-project:data", ":", 1, "") would return data
keep.splitPart("justonepart", ":", 1, "missing") would safely return missing instead of failing.
Additional context
This is especially useful in notification workflows or enrichment steps where data may be inconsistent, and runtime safety is critical.