Skip to content

trimValue

trimValue(value): string

Defined in: src/format.ts:29

Strips leading/trailing code points <= U+0020, as Java String.trim does.

Deliberately NOT String.prototype.trim(), which also strips U+00A0 and U+FEFF. AEAT requires edge-space removal but does not specify its exact Unicode boundary; preserving these characters avoids changing low-level inputs without evidence. Interior whitespace is preserved verbatim.

The start < end/end > start loop bounds are mutation-tested as equivalent, not merely untested: String.prototype.slice returns “” for any start past end, and whenever a bound would matter (the loop decrementing/incrementing past the other index) the character it would then inspect was already established whitespace by the OTHER loop, so a missing/widened bound only ever walks further through whitespace to the same final “” — verified by exhaustive search over whitespace/non- whitespace strings up to length 6 plus 2M random fuzz inputs, with no observable difference found. No test can kill an equivalent mutant.

string | null | undefined

string