wrapLines
wrapLines(
props):string[]
Defined in: packages/core/src/fields/utils.ts:21
Wraps a string into lines that do not exceed maxLen characters, splitting
on word boundaries.
Used by adminFieldToJSDocComment to keep JSDoc comment lines within the
conventional 80-character limit before emitting them into generated source files.
Parameters
Section titled “Parameters”Input props.
maxLen
Section titled “maxLen”number
Maximum character length per line.
string
The string to wrap.
Returns
Section titled “Returns”string[]
An array of strings, each no longer than maxLen characters.
Example
Section titled “Example”wrapLines({ text: "This is a long description that should wrap.", maxLen: 20 })// → ["This is a long", "description that", "should wrap."]