Conformance Examples 0.1.0 — Transforms: transform-truncate¶
truncate-default-ellipsis¶
Default ellipsis is "..."; ellipsis is included in the total length.
Template
Context
Output
truncate-custom-ellipsis¶
Custom ellipsis replaces the default and is counted toward total length.
Template
Context
Output
truncate-input-shorter-than-length¶
When input is shorter than length, return input unchanged.
Template
Context
Output
truncate-length-equals-input-length¶
When input length exactly matches the requested length, return input unchanged.
Template
Context
Output
truncate-length-smaller-than-ellipsis¶
When length is smaller than the ellipsis length, return the first length chars of the ellipsis.
Template
Context
Output
truncate-empty-ellipsis¶
Empty ellipsis means a plain take(length) truncation.
Template
Context
Output
truncate-non-integer-length-is-null¶
Non-integer length is a soft failure, so truncate yields null.
Template
Context
Output
truncate-negative-length-is-null¶
Negative length is a soft failure, so truncate yields null.
Template
Context
Output
truncate-astral-counts-code-points¶
Length counts code points, so truncating an all-astral string keeps whole characters rather than splitting a surrogate pair.
Template
Context
Output
Source fixture: transforms/transform-truncate.json